Skip to content

gc_batch.models.batch_config

Configuration models for the gc-batch client.

This module contains configuration classes used to initialize the GCBatchClient.

BatchClientConfig

Bases: BaseModel

Configuration for the GCBatchClient.

This configuration is used to initialize a GCBatchClient instance with the necessary GCP project and location settings.

Attributes:

Name Type Description
location str

The GCP region where Batch jobs will be created (e.g., "us-central1").

project_id str

The GCP project ID where Batch jobs will be managed.

settings GCBatchSettings

Deployment-specific configuration (job-name prefix, job profiles, etc.). Defaults to :class:GCBatchSettings with neutral values.

Example
from gc_batch import BatchClientConfig, GCBatchClient

config = BatchClientConfig(
    location="us-central1",
    project_id="my-gcp-project"
)
client = GCBatchClient(config)
Source code in src/gc_batch/models/batch_config.py
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
class BatchClientConfig(BaseModel):
    """Configuration for the GCBatchClient.

    This configuration is used to initialize a GCBatchClient instance with
    the necessary GCP project and location settings.

    Attributes:
        location: The GCP region where Batch jobs will be created (e.g., "us-central1").
        project_id: The GCP project ID where Batch jobs will be managed.
        settings: Deployment-specific configuration (job-name prefix, job
            profiles, etc.). Defaults to :class:`GCBatchSettings` with neutral
            values.

    Example:
        ```python
        from gc_batch import BatchClientConfig, GCBatchClient

        config = BatchClientConfig(
            location="us-central1",
            project_id="my-gcp-project"
        )
        client = GCBatchClient(config)
        ```
    """

    location: str
    project_id: str
    settings: GCBatchSettings = Field(default_factory=GCBatchSettings)

location instance-attribute

project_id instance-attribute

settings = Field(default_factory=GCBatchSettings) class-attribute instance-attribute