Exemplo n.º 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))
Exemplo n.º 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))
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)
Exemplo n.º 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)