Skip to content

projects

Project

A project or repo

cpu_hours_given: Optional[float] = Field(None, title='Cpu Hours Given') class-attribute instance-attribute

cpu_hours_used: Optional[float] = Field(None, title='Cpu Hours Used') class-attribute instance-attribute

cpu_project_hours_given: Optional[float] = Field(None, title='Cpu Project Hours Given') class-attribute instance-attribute

cpu_project_hours_used: Optional[float] = Field(None, title='Cpu Project Hours Used') class-attribute instance-attribute

description: str = Field(..., title='Description') class-attribute instance-attribute

gpu_hours_given: Optional[float] = Field(None, title='Gpu Hours Given') class-attribute instance-attribute

gpu_hours_used: Optional[float] = Field(None, title='Gpu Hours Used') class-attribute instance-attribute

gpu_project_hours_given: Optional[float] = Field(None, title='Gpu Project Hours Given') class-attribute instance-attribute

gpu_project_hours_used: Optional[float] = Field(None, title='Gpu Project Hours Used') class-attribute instance-attribute

hours_given: Optional[float] = Field(None, title='Hours Given') class-attribute instance-attribute

hours_used: Optional[float] = Field(None, title='Hours Used') class-attribute instance-attribute

hpss_usage: Optional[List[StorageStats]] = Field(None, title='Hpss Usage') class-attribute instance-attribute

id: int = Field(..., title='Id') class-attribute instance-attribute

iris_role: Optional[str] = Field(None, title='Iris Role') class-attribute instance-attribute

projdir_usage: Optional[List[StorageStats]] = Field(None, title='Projdir Usage') class-attribute instance-attribute

project_hours_given: Optional[float] = Field(None, title='Project Hours Given') class-attribute instance-attribute

project_hours_used: Optional[float] = Field(None, title='Project Hours Used') class-attribute instance-attribute

project_projdir_usage: Optional[StorageStats] = None class-attribute instance-attribute

repo_name: str = Field(..., title='Repo Name') class-attribute instance-attribute

cpu_hours_given: Optional[float] = Field(None, title='Cpu Hours Given') class-attribute instance-attribute

cpu_hours_used: Optional[float] = Field(None, title='Cpu Hours Used') class-attribute instance-attribute

cpu_project_hours_given: Optional[float] = Field(None, title='Cpu Project Hours Given') class-attribute instance-attribute

cpu_project_hours_used: Optional[float] = Field(None, title='Cpu Project Hours Used') class-attribute instance-attribute

description: str = Field(..., title='Description') class-attribute instance-attribute

gpu_hours_given: Optional[float] = Field(None, title='Gpu Hours Given') class-attribute instance-attribute

gpu_hours_used: Optional[float] = Field(None, title='Gpu Hours Used') class-attribute instance-attribute

gpu_project_hours_given: Optional[float] = Field(None, title='Gpu Project Hours Given') class-attribute instance-attribute

gpu_project_hours_used: Optional[float] = Field(None, title='Gpu Project Hours Used') class-attribute instance-attribute

hours_given: Optional[float] = Field(None, title='Hours Given') class-attribute instance-attribute

hours_used: Optional[float] = Field(None, title='Hours Used') class-attribute instance-attribute

hpss_usage: Optional[List[StorageStats]] = Field(None, title='Hpss Usage') class-attribute instance-attribute

id: int = Field(..., title='Id') class-attribute instance-attribute

iris_role: Optional[str] = Field(None, title='Iris Role') class-attribute instance-attribute

model_config = ConfigDict(arbitrary_types_allowed=True) class-attribute instance-attribute

name: str = Field(alias='repo_name') class-attribute instance-attribute

projdir_usage: Optional[List[StorageStats]] = Field(None, title='Projdir Usage') class-attribute instance-attribute

project_hours_given: Optional[float] = Field(None, title='Project Hours Given') class-attribute instance-attribute

project_hours_used: Optional[float] = Field(None, title='Project Hours Used') class-attribute instance-attribute

project_projdir_usage: Optional[StorageStats] = None class-attribute instance-attribute

repo_name: str = Field(..., title='Repo Name') class-attribute instance-attribute

create_group(name)

Create a new project.

Parameters:

Name Type Description Default
name str

The project name

required
Source code in sfapi_client/_sync/projects.py
def create_group(self, name: str) -> "Group":  # noqa: F821
    """
    Create a new project.
    :param name: The project name
    """
    from .groups import Group

    params = {"name": name, "repo_name": self.repo_name}

    r = self.client.post("account/groups", data=params)
    json_response = r.json()
    try:
        group = Group.model_validate(dict(json_response, client=self.client))
    except ValidationError:
        # See if we have validation error raise it
        if "details" in json_response:
            raise SfApiError(r.text())
        else:
            raise RuntimeError(r.text())

    group.client = self.client

    return group