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))
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)
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))