Project and Budget
Module to handle a project.
- class qarnot.project.Project(uuid: str)[source]
Bases:
objectRepresents an organization project.
Note
A
Projectmust be retrieved withqarnot.connection.Connection.user_info.projectsor with helpersqarnot.project.Project.retrieve_by_uuid(),qarnot.project.Project.retrieve_by_name()orqarnot.project.Project.retrieve_by_slug()- __init__(uuid: str)[source]
Create a new
Project.- Parameters:
uuid (
str) – identifier of the project
- property uuid
- Type:
- Getter:
Returns this project’s uuid
The project’s uuid.
Automatically set when a project is submitted.
- property slug
- Type:
- Getter:
Returns this project’s slug name
The project’s slug name.
The project’s slug is be DNS compliant and unique. It can be used to identified a project instead of its uuid.
- property description
- Type:
- Getter:
Returns this project’s description
The project’s description.
- property organization_uuid
- Type:
- Getter:
Returns this project’s organization’s uuid
The uuid of the organization this project is attached to.
- property is_default
- Type:
- Getter:
Returns true if this project is the default one of the organization
- static retrieve_default(connection)[source]
Retrieve default project of the organization if any.
- Parameters:
connection (qarnot.connection.Connection) – the cluster to retrieve the project from
- Return type:
- Returns:
The retrieved project.
- Raises:
QarnotGenericException – API general error, see message for details
UnauthorizedException – invalid credentials
MissingProjectException – no such project
- static retrieve_by_uuid(connection, uuid)[source]
Retrieve project given its uuid.
- Parameters:
connection (qarnot.connection.Connection) – the cluster to retrieve the project from
uuid (str) – the uuid of the project to retrieve
- Return type:
- Returns:
The retrieved project.
- Raises:
QarnotGenericException – API general error, see message for details
UnauthorizedException – invalid credentials
MissingProjectException – no such project
- static retrieve_by_slug(connection, slug)[source]
Retrieve project given its slug.
- Parameters:
connection (qarnot.connection.Connection) – the cluster to retrieve the project from
slug (str) – the slug of the project to retrieve
- Return type:
- Returns:
The retrieved project.
- Raises:
QarnotGenericException – API general error, see message for details
UnauthorizedException – invalid credentials
MissingProjectException – no such project
- static retrieve_by_name(connection, name)[source]
Retrieve project given its name.
- Parameters:
connection (qarnot.connection.Connection) – the cluster to retrieve the project from
name (str) – the name of the project to retrieve
- Return type:
- Returns:
The retrieved project.
- Raises:
QarnotGenericException – API general error, see message for details
UnauthorizedException – invalid credentials
MissingProjectException – no such project
- get_active_budgets(connection) List[Budget][source]
Retrieve project currently active budgets.
- Parameters:
connection (qarnot.connection.Connection) – the cluster to retrieve the project from
name (str) – the name of the project to retrieve
- Return type:
list(
Budget)- Returns:
The retrieved active budgets of the project.
- Raises:
QarnotGenericException – API general error, see message for details
UnauthorizedException – invalid credentials
MissingProjectException – no such project
- get_all_budgets(connection) List[Budget][source]
Retrieve all project budgets.
- Parameters:
connection (qarnot.connection.Connection) – the cluster to retrieve the project from
name (str) – the name of the project to retrieve
- Return type:
list(
Budget)- Returns:
The retrieved budgets of the project.
- Raises:
QarnotGenericException – API general error, see message for details
UnauthorizedException – invalid credentials
MissingProjectException – no such project