Project and Budget

Module to handle a project.

class qarnot.project.Project(uuid: str)[source]

Bases: object

Represents an organization project.

Note

A Project must be retrieved with qarnot.connection.Connection.user_info.projects or with helpers qarnot.project.Project.retrieve_by_uuid(), qarnot.project.Project.retrieve_by_name() or qarnot.project.Project.retrieve_by_slug()

__init__(uuid: str)[source]

Create a new Project.

Parameters:

uuid (str) – identifier of the project

property uuid
Type:

str

Getter:

Returns this project’s uuid

The project’s uuid.

Automatically set when a project is submitted.

property name
Type:

str

Getter:

Returns this project’s name

The project’s name.

property slug
Type:

str

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:

str

Getter:

Returns this project’s description

The project’s description.

property organization_uuid
Type:

str

Getter:

Returns this project’s organization’s uuid

The uuid of the organization this project is attached to.

property is_default
Type:

bool

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:

Project

Returns:

The retrieved project.

Raises:
static retrieve_by_uuid(connection, uuid)[source]

Retrieve project given its uuid.

Parameters:
Return type:

Project

Returns:

The retrieved project.

Raises:
static retrieve_by_slug(connection, slug)[source]

Retrieve project given its slug.

Parameters:
Return type:

Project

Returns:

The retrieved project.

Raises:
static retrieve_by_name(connection, name)[source]

Retrieve project given its name.

Parameters:
Return type:

Project

Returns:

The retrieved project.

Raises:
get_active_budgets(connection) List[Budget][source]

Retrieve project currently active budgets.

Parameters:
Return type:

list(Budget)

Returns:

The retrieved active budgets of the project.

Raises:
get_all_budgets(connection) List[Budget][source]

Retrieve all project budgets.

Parameters:
Return type:

list(Budget)

Returns:

The retrieved budgets of the project.

Raises:
classmethod from_json(payload)[source]

Create a Project object from a json project.

Parameters:

payload (dict) – Dictionary representing the project

Returns:

The created Project.