Add get_parameter_history implementation and tests

This commit is contained in:
William Richard 2019-11-04 12:49:09 -05:00
commit aeb7974549
No known key found for this signature in database
GPG key ID: ACD9DA4E735E6D14
3 changed files with 71 additions and 1 deletions

View file

@ -527,7 +527,10 @@ class SimpleSystemManagerBackend(BaseBackend):
return result
return result
def get_parameter_history(self, name, with_decryption):
if name in self._parameters:
return self._parameters[name]
return None
def _match_filters(self, parameter, filters=None):
"""Return True if the given parameter matches all the filters"""

View file

@ -139,6 +139,19 @@ class SimpleSystemManagerResponse(BaseResponse):
response = {"Version": result}
return json.dumps(response)
def get_parameter_history(self):
name = self._get_param('Name')
with_decryption = self._get_param("WithDecryption")
result = self.ssm_backend.get_parameter_history(name, with_decryption)
response = {"Parameters": []}
for parameter_version in result:
param_data = parameter_version.describe_response_object(decrypt=with_decryption)
response['Parameters'].append(param_data)
return json.dumps(response)
def add_tags_to_resource(self):
resource_id = self._get_param("ResourceId")
resource_type = self._get_param("ResourceType")