Пример #1
0
    def delete_sample(self, sample):
        """Deletes a sample.

        """
        check_resource_type(sample, SAMPLE_PATH,
                            message="A sample id is needed.")
        sample_id = get_sample_id(sample)
        if sample_id:
            return self._delete("%s%s" % (self.url, sample_id))
Пример #2
0
    def delete_sample(self, sample):
        """Deletes a sample.

        """
        check_resource_type(sample, SAMPLE_PATH,
                            message="A sample id is needed.")
        sample_id = get_sample_id(sample)
        if sample_id:
            return self._delete("%s%s" % (self.url, sample_id))
Пример #3
0
    def update_sample(self, sample, changes):
        """Updates a sample.

        """
        check_resource_type(sample, SAMPLE_PATH,
                            message="A sample id is needed.")
        sample_id = get_sample_id(sample)
        if sample_id:
            body = json.dumps(changes)
            return self._update("%s%s" % (self.url, sample_id), body)
Пример #4
0
    def update_sample(self, sample, changes):
        """Updates a sample.

        """
        check_resource_type(sample, SAMPLE_PATH,
                            message="A sample id is needed.")
        sample_id = get_sample_id(sample)
        if sample_id:
            body = json.dumps(changes)
            return self._update("%s%s" % (self.url, sample_id), body)
Пример #5
0
    def get_sample(self, sample, query_string=''):
        """Retrieves a sample.

           The sample parameter should be a string containing the
           sample id or the dict returned by create_sample.
           As sample is an evolving object that is processed
           until it reaches the FINISHED or FAULTY state, the function will
           return a dict that encloses the sample values and state info
           available at the time it is called.
        """
        check_resource_type(sample, SAMPLE_PATH,
                            message="A sample id is needed.")
        sample_id = get_sample_id(sample)
        if sample_id:
            return self._get("%s%s" % (self.url, sample_id),
                             query_string=query_string)
Пример #6
0
    def get_sample(self, sample, query_string=''):
        """Retrieves a sample.

           The sample parameter should be a string containing the
           sample id or the dict returned by create_sample.
           As sample is an evolving object that is processed
           until it reaches the FINISHED or FAULTY state, the function will
           return a dict that encloses the sample values and state info
           available at the time it is called.
        """
        check_resource_type(sample, SAMPLE_PATH,
                            message="A sample id is needed.")
        sample_id = get_sample_id(sample)
        if sample_id:
            return self._get("%s%s" % (self.url, sample_id),
                             query_string=query_string)