예제 #1
0
    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))
예제 #2
0
    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))
예제 #3
0
    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)
예제 #4
0
    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)
예제 #5
0
    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)
예제 #6
0
    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)