Example #1
0
    def delete_project(self, project):
        """Deletes a project.

        """
        check_resource_type(project, PROJECT_PATH, message="A project id is needed.")
        project_id = get_project_id(project)
        if project_id:
            return self._delete("%s%s" % (self.url, project_id))
Example #2
0
    def delete_project(self, project):
        """Deletes a project.

        """
        check_resource_type(project, PROJECT_PATH,
                            message="A project id is needed.")
        project_id = get_project_id(project)
        if project_id:
            return self._delete("%s%s" % (self.url, project_id))
Example #3
0
    def update_project(self, project, changes):
        """Updates a project.

        """
        check_resource_type(project, PROJECT_PATH, message="A project id is needed.")
        project_id = get_project_id(project)
        if project_id:
            body = json.dumps(changes)
            return self._update("%s%s" % (self.url, project_id), body)
Example #4
0
    def update_project(self, project, changes):
        """Updates a project.

        """
        check_resource_type(project, PROJECT_PATH,
                            message="A project id is needed.")
        project_id = get_project_id(project)
        if project_id:
            body = json.dumps(changes)
            return self._update("%s%s" % (self.url, project_id), body)
Example #5
0
    def get_project(self, project):
        """Retrieves a project.

           The project parameter should be a string containing the
           project id or the dict returned by create_project.
           As every resource, is an evolving object that is processed
           until it reaches the FINISHED or FAULTY state. The function will
           return a dict that encloses the project values and state info
           available at the time it is called.
        """
        check_resource_type(project, PROJECT_PATH, message="A project id is needed.")
        project_id = get_project_id(project)
        if project_id:
            return self._get("%s%s" % (self.url, project_id))
Example #6
0
    def get_project(self, project):
        """Retrieves a project.

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