Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .api-codegen-source.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"api_codegen_commit": "b27f74ff3939c82958fe0c5cc0810ad45d9b4a75",
"api_codegen_run_id": 39868898264,
"generated_at": "2026-10-22T23:00:57Z",
"api_codegen_commit": "b9fdacd68be04eb9a5faaad578feddcd9473554f",
"api_codegen_run_id": 40019114408,
"generated_at": "2026-10-23T20:26:22Z",
"generator_version": "7.23.0",
"monolith_commit": "faf363f752df13b6a4e63abb2a8f856eab1f7065",
"monolith_run_id": 39868208395,
"exported_at": "2026-10-22T22:57:41Z"
"monolith_commit": "a0f20333c2f99443f97e74076e78de04ad1e4598",
"monolith_run_id": 40018283606,
"exported_at": "2026-10-23T20:22:20Z"
}
2 changes: 1 addition & 1 deletion docs/ConnectionOut.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Name | Type | Description | Notes
**etl_container_name** | **str** | Display name of that ETL container. Null when there is no ETL container. |
**deployment_id** | **UUID** | The deployment the connection runs through, taken from its warehouse, BI container or ETL container. Null when that has no deployment, as an Airflow ETL container has none. The id may name a deployment on Monte Carlo's older collection platform, which the deployments endpoints do not list. |
**deployment_name** | **str** | Display name of that deployment. Null when there is no deployment to name. |
**credentials_id** | **UUID** | The credentials the connection reads with. Null for a connection created before credentials became their own resource, and for one created outside this API. |
**credentials_id** | **UUID** | The credentials the connection reads with. Null for a connection created before credentials became their own resource, and for one created outside this API until an update sets `credentials_id`. |
**credentials_storage_type** | [**CredentialsStorageType**](CredentialsStorageType.md) | Where that secret lives. Null when there are no credentials to describe. |
**job_types** | **List[str]** | The jobs Monte Carlo runs on this connection, such as `metadata`. |
**created_time** | **datetime** | When the connection was created. |
Expand Down
3 changes: 2 additions & 1 deletion docs/ConnectionPatch.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# ConnectionPatch

A change to an existing connection: a new name, ETL turned on or off, or new dbt Cloud settings.
A change to an existing connection: a new name, ETL turned on or off, new dbt Cloud settings, or other credentials.

## Properties

Expand All @@ -9,6 +9,7 @@ Name | Type | Description | Notes
**name** | **str** | New display name for the connection. Omit it to leave the name unchanged. An explicit null is ignored, the same as omitting the field. | [optional]
**job_types** | **List[str]** | The connection's job types with `etl` added or removed. Adding `etl` turns on ETL collection for a Snowflake (Snowflake Tasks), Power BI (dataflows) or Salesforce Data Cloud connection, and creates the ETL container that `etl_container_id` then names. Removing it deletes that container. No other job can be added or removed. Omit it to leave the job types unchanged. | [optional]
**dbt_cloud** | [**DbtCloudSettingsIn**](DbtCloudSettingsIn.md) | Which dbt Cloud runs a dbt Cloud webhook connection processes. A dbt Cloud webhook reports runs from every environment in the dbt account. These settings decide which of them Monte Carlo processes for the connection's warehouse. Only a dbt Cloud webhook connection takes it. An object replaces the settings whole. Null resets them to the defaults. Omit it to leave them unchanged. | [optional]
**credentials_id** | **UUID** | Credentials for the connection to read with from now on. They must be for the connection's own type, and may be stored by Monte Carlo or self-hosted. The previous credentials are kept, and can be deleted once nothing uses them. Omit it to keep the current credentials. An explicit null is ignored, the same as omitting the field. | [optional]

## Example

Expand Down
17 changes: 13 additions & 4 deletions docs/ConnectionsApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -417,11 +417,19 @@ Name | Type | Description | Notes

Update a connection

Rename a connection, turn its ETL on or off, or change its dbt Cloud settings.
Rename a connection, turn its ETL on or off, change its dbt Cloud settings, or point it
at other credentials.

The type, the warehouse, BI container or ETL container and the credentials are fixed when
the connection is created. Two connections on one warehouse or BI container cannot share a
name.
The type and the warehouse, BI container or ETL container are fixed when the connection is
created. Two connections on one warehouse or BI container cannot share a name.

`credentials_id` points the connection at other credentials of its own type, in place. This
is how a connection created in the Monte Carlo app gets credentials this API manages, and
how a connection moves between credentials Monte Carlo stores and self-hosted ones.
Self-hosted credentials need a collection agent on the connection's deployment. The
credentials of a dbt Cloud webhook connection, or of one that runs through the Snowflake
agent, cannot be changed. The previous credentials are kept. Once a connection has
credentials, change its secret through those credentials, not in the app.

`job_types` takes one change: `etl` added or removed. Adding it to a Snowflake, Power BI
or Salesforce Data Cloud connection turns on Snowflake Tasks, Power BI dataflows or Data
Expand Down Expand Up @@ -508,6 +516,7 @@ Name | Type | Description | Notes
**409** | Conflict | - |
**422** | Unprocessable Entity | - |
**429** | Too Many Requests | - |
**503** | Service Unavailable | - |
**401** | Authentication credentials are missing or invalid. | - |
**403** | The request was authenticated, but the caller is not allowed to perform this operation. Read `code` to tell the reasons apart: `account_frozen` means the account is paused, rather than that the caller lacks permission. | - |
**500** | An unexpected error prevented the request from being processed. | - |
Expand Down
17 changes: 13 additions & 4 deletions pycarlo2/api/connections_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -714,11 +714,19 @@ def update_connection(
) -> ConnectionOut:
"""Update a connection

Rename a connection, turn its ETL on or off, or change its dbt Cloud settings.
Rename a connection, turn its ETL on or off, change its dbt Cloud settings, or point it
at other credentials.

The type, the warehouse, BI container or ETL container and the credentials are fixed when
the connection is created. Two connections on one warehouse or BI container cannot share a
name.
The type and the warehouse, BI container or ETL container are fixed when the connection is
created. Two connections on one warehouse or BI container cannot share a name.

`credentials_id` points the connection at other credentials of its own type, in place. This
is how a connection created in the Monte Carlo app gets credentials this API manages, and
how a connection moves between credentials Monte Carlo stores and self-hosted ones.
Self-hosted credentials need a collection agent on the connection's deployment. The
credentials of a dbt Cloud webhook connection, or of one that runs through the Snowflake
agent, cannot be changed. The previous credentials are kept. Once a connection has
credentials, change its secret through those credentials, not in the app.

`job_types` takes one change: `etl` added or removed. Adding it to a Snowflake, Power BI
or Salesforce Data Cloud connection turns on Snowflake Tasks, Power BI dataflows or Data
Expand Down Expand Up @@ -771,6 +779,7 @@ def update_connection(
'409': "ProblemOut",
'422': "ProblemOut",
'429': "ProblemOut",
'503': "ProblemOut",
'401': "ProblemOut",
'403': "ProblemOut",
'500': "ProblemOut",
Expand Down
2 changes: 1 addition & 1 deletion pycarlo2/models/connection_out.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ConnectionOut(BaseModel):
etl_container_name: Optional[StrictStr] = Field(description="Display name of that ETL container. Null when there is no ETL container.")
deployment_id: Optional[UUID] = Field(description="The deployment the connection runs through, taken from its warehouse, BI container or ETL container. Null when that has no deployment, as an Airflow ETL container has none. The id may name a deployment on Monte Carlo's older collection platform, which the deployments endpoints do not list.")
deployment_name: Optional[StrictStr] = Field(description="Display name of that deployment. Null when there is no deployment to name.")
credentials_id: Optional[UUID] = Field(description="The credentials the connection reads with. Null for a connection created before credentials became their own resource, and for one created outside this API.")
credentials_id: Optional[UUID] = Field(description="The credentials the connection reads with. Null for a connection created before credentials became their own resource, and for one created outside this API until an update sets `credentials_id`.")
credentials_storage_type: Optional[CredentialsStorageType] = Field(description="Where that secret lives. Null when there are no credentials to describe.")
job_types: List[StrictStr] = Field(description="The jobs Monte Carlo runs on this connection, such as `metadata`.")
created_time: datetime = Field(description="When the connection was created.")
Expand Down
16 changes: 12 additions & 4 deletions pycarlo2/models/connection_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,22 @@
from pydantic import BaseModel, ConfigDict, Field, StrictStr
from typing import Any, ClassVar, Dict, List, Optional
from typing_extensions import Annotated
from uuid import UUID
from pycarlo2.models.dbt_cloud_settings_in import DbtCloudSettingsIn
from typing import Optional, Set
from typing_extensions import Self
from pydantic_core import to_jsonable_python

class ConnectionPatch(BaseModel):
"""
A change to an existing connection: a new name, ETL turned on or off, or new dbt Cloud
settings.
A change to an existing connection: a new name, ETL turned on or off, new dbt Cloud
settings, or other credentials.
""" # noqa: E501
name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=200)]] = Field(default=None, description="New display name for the connection. Omit it to leave the name unchanged. An explicit null is ignored, the same as omitting the field.")
job_types: Optional[Annotated[List[StrictStr], Field(min_length=1)]] = Field(default=None, description="The connection's job types with `etl` added or removed. Adding `etl` turns on ETL collection for a Snowflake (Snowflake Tasks), Power BI (dataflows) or Salesforce Data Cloud connection, and creates the ETL container that `etl_container_id` then names. Removing it deletes that container. No other job can be added or removed. Omit it to leave the job types unchanged.")
dbt_cloud: Optional[DbtCloudSettingsIn] = Field(default=None, description="Which dbt Cloud runs a dbt Cloud webhook connection processes. A dbt Cloud webhook reports runs from every environment in the dbt account. These settings decide which of them Monte Carlo processes for the connection's warehouse. Only a dbt Cloud webhook connection takes it. An object replaces the settings whole. Null resets them to the defaults. Omit it to leave them unchanged.")
__properties: ClassVar[List[str]] = ["name", "job_types", "dbt_cloud"]
credentials_id: Optional[UUID] = Field(default=None, description="Credentials for the connection to read with from now on. They must be for the connection's own type, and may be stored by Monte Carlo or self-hosted. The previous credentials are kept, and can be deleted once nothing uses them. Omit it to keep the current credentials. An explicit null is ignored, the same as omitting the field.")
__properties: ClassVar[List[str]] = ["name", "job_types", "dbt_cloud", "credentials_id"]

model_config = ConfigDict(
validate_by_name=True,
Expand Down Expand Up @@ -85,6 +87,11 @@ def to_dict(self) -> Dict[str, Any]:
if self.dbt_cloud is None and "dbt_cloud" in self.model_fields_set:
_dict['dbt_cloud'] = None

# set to None if credentials_id (nullable) is None
# and model_fields_set contains the field
if self.credentials_id is None and "credentials_id" in self.model_fields_set:
_dict['credentials_id'] = None

return _dict

@classmethod
Expand All @@ -99,7 +106,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
_obj = cls.model_validate({
"name": obj.get("name"),
"job_types": obj.get("job_types"),
"dbt_cloud": DbtCloudSettingsIn.from_dict(obj["dbt_cloud"]) if obj.get("dbt_cloud") is not None else None
"dbt_cloud": DbtCloudSettingsIn.from_dict(obj["dbt_cloud"]) if obj.get("dbt_cloud") is not None else None,
"credentials_id": obj.get("credentials_id")
})
return _obj

Expand Down
Loading