Beispiel #1
0
    def get_fusion(self,
                   fusion,
                   query_string='',
                   shared_username=None,
                   shared_api_key=None):
        """Retrieves a fusion.

           The model parameter should be a string containing the
           fusion id or the dict returned by
           create_fusion.
           As a fusion is an evolving object that is processed
           until it reaches the FINISHED or FAULTY state, the function will
           return a dict that encloses the fusion
           values and state info available at the time it is called.

           If this is a shared fusion, the username and
           sharing api key must also be provided.
        """
        check_resource_type(fusion,
                            FUSION_PATH,
                            message="A fusion id is needed.")
        fusion_id = get_fusion_id(fusion)
        if fusion_id:
            return self._get("%s%s" % (self.url, fusion_id),
                             query_string=query_string,
                             shared_username=shared_username,
                             shared_api_key=shared_api_key)
Beispiel #2
0
    def delete_fusion(self, fusion):
        """Deletes a fusion.

        """
        check_resource_type(fusion, FUSION_PATH,
                            message="A fusion id is needed.")
        fusion_id = get_fusion_id(fusion)
        if fusion_id:
            return self._delete("%s%s" % (self.url, fusion_id))
Beispiel #3
0
    def delete_fusion(self, fusion):
        """Deletes a fusion.

        """
        check_resource_type(fusion,
                            FUSION_PATH,
                            message="A fusion id is needed.")
        fusion_id = get_fusion_id(fusion)
        if fusion_id:
            return self._delete("%s%s" % (self.url, fusion_id))
Beispiel #4
0
    def update_fusion(self, fusion, changes):
        """Updates a fusion.

        """
        check_resource_type(fusion,
                            FUSION_PATH,
                            message="A fusion id is needed.")
        fusion_id = get_fusion_id(fusion)
        if fusion_id:
            body = json.dumps(changes)
            return self._update("%s%s" % (self.url, fusion_id), body)
Beispiel #5
0
    def update_fusion(self, fusion, changes):
        """Updates a fusion.

        """
        check_resource_type(fusion, FUSION_PATH,
                            message="A fusion id is needed.")
        fusion_id = get_fusion_id(fusion)
        if fusion_id:
            body = json.dumps(changes)
            return self._update(
                "%s%s" % (self.url, fusion_id), body)
Beispiel #6
0
    def get_fusion(self, fusion, query_string='',
                   shared_username=None, shared_api_key=None):
        """Retrieves a fusion.

           The model parameter should be a string containing the
           fusion id or the dict returned by
           create_fusion.
           As a fusion is an evolving object that is processed
           until it reaches the FINISHED or FAULTY state, the function will
           return a dict that encloses the fusion
           values and state info available at the time it is called.

           If this is a shared fusion, the username and
           sharing api key must also be provided.
        """
        check_resource_type(fusion, FUSION_PATH,
                            message="A fusion id is needed.")
        fusion_id = get_fusion_id(fusion)
        if fusion_id:
            return self._get("%s%s" % (self.url, fusion_id),
                             query_string=query_string,
                             shared_username=shared_username,
                             shared_api_key=shared_api_key)