def delete_configuration(self, configuration): """Deletes a configuration. """ check_resource_type(configuration, CONFIGURATION_PATH, message="A configuration id is needed.") configuration_id = get_configuration_id(configuration) if configuration_id: return self._delete("%s%s" % (self.url, configuration_id))
def update_configuration(self, configuration, changes): """Updates a configuration. """ check_resource_type(configuration, CONFIGURATION_PATH, message="A configuration id is needed.") configuration_id = get_configuration_id(configuration) if configuration_id: body = json.dumps(changes) return self._update("%s%s" % (self.url, configuration_id), body)
def get_configuration(self, configuration, query_string=''): """Retrieves a configuration. The configuration parameter should be a string containing the configuration id or the dict returned by create_configuration. """ check_resource_type(configuration, CONFIGURATION_PATH, message="A configuration id is needed.") configuration_id = get_configuration_id(configuration) if configuration_id: return self._get("%s%s" % (self.url, configuration_id), query_string=query_string)