buildgrid.cleanup.janitor.config module

class buildgrid.cleanup.janitor.config.S3Config(*, access_key: str, bucket_regex: str, endpoint: str, path_prefix: str, secret_key: str)

Bases: BaseModel

access_key: str
bucket_regex: str
endpoint: str
path_prefix: str
secret_key: str
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'access_key': FieldInfo(annotation=str, required=True), 'bucket_regex': FieldInfo(annotation=str, required=True), 'endpoint': FieldInfo(annotation=str, required=True), 'path_prefix': FieldInfo(annotation=str, required=True), 'secret_key': FieldInfo(annotation=str, required=True)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class buildgrid.cleanup.janitor.config.RedisConfig(*, db: int | None = None, dns_srv_record: str | None = None, index_prefix: str, key_batch_size: int, password: str | None = None, host: str | None = None, port: int | None = None, sentinel_master_name: str | None = None)

Bases: BaseModel

db: int | None
dns_srv_record: str | None
index_prefix: str
key_batch_size: int
password: str | None
host: str | None
port: int | None
sentinel_master_name: str | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'db': FieldInfo(annotation=Union[int, NoneType], required=False), 'dns_srv_record': FieldInfo(annotation=Union[str, NoneType], required=False), 'host': FieldInfo(annotation=Union[str, NoneType], required=False), 'index_prefix': FieldInfo(annotation=str, required=True), 'key_batch_size': FieldInfo(annotation=int, required=True), 'password': FieldInfo(annotation=Union[str, NoneType], required=False), 'port': FieldInfo(annotation=Union[int, NoneType], required=False), 'sentinel_master_name': FieldInfo(annotation=Union[str, NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

class buildgrid.cleanup.janitor.config.JanitorConfig(*, redis: RedisConfig | None = None, sleep_interval: int, s3: S3Config, sql_connection_string: str | None = None)

Bases: BaseModel

redis: RedisConfig | None
sleep_interval: int
s3: S3Config
sql_connection_string: str | None
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'redis': FieldInfo(annotation=Union[RedisConfig, NoneType], required=False), 's3': FieldInfo(annotation=S3Config, required=True), 'sleep_interval': FieldInfo(annotation=int, required=True), 'sql_connection_string': FieldInfo(annotation=Union[str, NoneType], required=False)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

buildgrid.cleanup.janitor.config.parse_janitor_config(path: str | bytes | os.PathLike[str]) JanitorConfig