Skip to content

DomoSandbox

DomoSandbox

DomoSandbox package.

DomoRepository dataclass

DomoRepository(
    auth: DomoAuth,
    id: str,
    raw: dict,
    name: str = "",
    last_updated_dt: datetime | None = None,
    commit_dt: datetime | None = None,
    commit_version: str | None = None,
    content_page_id_ls: list[str] | None = None,
    content_card_id_ls: list[str] | None = None,
    content_dataflow_id_ls: list[str] | None = None,
    content_view_id_ls: list[str] | None = None,
)

Bases: DomoEntity_w_Lineage

commit async

commit(
    summary: str,
    hidden: bool = False,
    commit: CommitCreate | dict[str, Any] | None = None,
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

Create a commit on this repository (POST .../commitRequests).

Parameters:

Name Type Description Default
summary str

Commit summary (ignored if commit is provided)

required
hidden bool

Whether the commit is hidden from the history UI

False
commit CommitCreate | dict[str, Any] | None

Optional full CommitCreate (or raw dict) overriding summary/hidden

None
Source code in src/crew_dcs/classes/DomoSandbox/core.py
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
async def commit(
    self,
    summary: str,
    hidden: bool = False,
    commit: CommitCreate | dict[str, Any] | None = None,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    """Create a commit on this repository (POST .../commitRequests).

    Args:
        summary: Commit summary (ignored if ``commit`` is provided)
        hidden: Whether the commit is hidden from the history UI
        commit: Optional full ``CommitCreate`` (or raw dict) overriding summary/hidden
    """
    context = RouteContext.build_context(
        context=context, session=session, debug_api=debug_api, **context_kwargs
    )
    body = (
        commit
        if commit is not None
        else CommitCreate(summary=summary, hidden=hidden)
    )
    return await sandbox_routes.create_commit(
        auth=self.auth,
        repository_id=self.id,
        commit=body,
        context=context,
    )

from_dict classmethod

from_dict(auth: DomoAuth, obj: dict[str, Any])

Create DomoRepository instance from API response dictionary.

Parameters:

Name Type Description Default
auth DomoAuth

Authentication object

required
obj dict[str, Any]

API response dictionary

required

Returns:

Type Description

DomoRepository instance

Source code in src/crew_dcs/classes/DomoSandbox/core.py
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
@classmethod
def from_dict(cls, auth: DomoAuth, obj: dict[str, Any]):
    """Create DomoRepository instance from API response dictionary.

    Args:
        auth: Authentication object
        obj: API response dictionary

    Returns:
        DomoRepository instance
    """
    return cls(
        auth=auth,
        id=obj["id"],
        raw=obj,
        name=obj["name"],
        content_page_id_ls=obj["repositoryContent"]["pageIds"],
        content_card_id_ls=obj["repositoryContent"]["cardIds"],
        content_dataflow_id_ls=obj["repositoryContent"]["dataflowIds"],
        content_view_id_ls=obj["repositoryContent"]["viewIds"],
        last_updated_dt=dtut.parse(obj["updated"]).replace(tzinfo=None),
        commit_dt=dtut.parse(obj["lastCommit"]["completed"]).replace(tzinfo=None),
        commit_version=obj["lastCommit"]["commitName"],
    )

get_by_id async classmethod

get_by_id(
    auth: DomoAuth,
    repository_id: str,
    session: AsyncClient | None = None,
    context: RouteContext | None = None,
    debug_api: bool = False,
    debug_num_stacks_to_drop: int = 2,
    return_raw: bool = False,
)

Get a repository by ID using RouteContext for logging and caching.

Source code in src/crew_dcs/classes/DomoSandbox/core.py
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
@classmethod
async def get_by_id(
    cls,
    auth: DomoAuth,
    repository_id: str,
    session: httpx.AsyncClient | None = None,
    context: RouteContext | None = None,
    debug_api: bool = False,
    debug_num_stacks_to_drop: int = 2,
    return_raw: bool = False,
):
    """Get a repository by ID using RouteContext for logging and caching."""
    context = RouteContext.build_context(
        context=context,
        session=session,
        debug_api=debug_api,
        debug_num_stacks_to_drop=debug_num_stacks_to_drop,
        parent_class=cls.__name__,
    )

    res = await sandbox_routes.get_repo_from_id(
        auth=auth,
        repository_id=repository_id,
        context=context,
        return_raw=return_raw,
    )

    if return_raw:
        return res

    return cls.from_dict(obj=res.response, auth=auth)

get_commit_requests async

get_commit_requests(
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

Get commit requests for this repository (GET .../commitRequests).

Source code in src/crew_dcs/classes/DomoSandbox/core.py
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
async def get_commit_requests(
    self,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    """Get commit requests for this repository (GET .../commitRequests)."""
    context = RouteContext.build_context(
        context=context, session=session, debug_api=debug_api, **context_kwargs
    )
    return await sandbox_routes.get_commit_requests(
        auth=self.auth,
        repository_id=self.id,
        context=context,
    )

get_commits async

get_commits(
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

Get commits for this repository (GET .../commits).

Source code in src/crew_dcs/classes/DomoSandbox/core.py
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
async def get_commits(
    self,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    """Get commits for this repository (GET .../commits)."""
    context = RouteContext.build_context(
        context=context, session=session, debug_api=debug_api, **context_kwargs
    )
    return await sandbox_routes.get_commits(
        auth=self.auth,
        repository_id=self.id,
        context=context,
    )

get_entity_by_id async classmethod

get_entity_by_id(
    auth: DomoAuth,
    entity_id: str,
    session: AsyncClient | None = None,
    debug_api: bool = False,
    debug_num_stacks_to_drop: int = 2,
)

Internal method to get entity by ID (required by DomoEntity_w_Lineage).

Source code in src/crew_dcs/classes/DomoSandbox/core.py
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
@classmethod
async def get_entity_by_id(
    cls,
    auth: DomoAuth,
    entity_id: str,
    session: httpx.AsyncClient | None = None,
    debug_api: bool = False,
    debug_num_stacks_to_drop: int = 2,
):
    """Internal method to get entity by ID (required by DomoEntity_w_Lineage)."""
    return await cls.get_by_id(
        auth=auth,
        repository_id=entity_id,
        session=session,
        debug_api=debug_api,
        debug_num_stacks_to_drop=debug_num_stacks_to_drop,
    )

get_instance_access async

get_instance_access(
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

Get the instances with access to this repository (GET .../access).

Source code in src/crew_dcs/classes/DomoSandbox/core.py
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
async def get_instance_access(
    self,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    """Get the instances with access to this repository (GET .../access)."""
    context = RouteContext.build_context(
        context=context, session=session, debug_api=debug_api, **context_kwargs
    )
    return await sandbox_routes.get_instance_access(
        auth=self.auth,
        repository_id=self.id,
        context=context,
    )

get_permissions async

get_permissions(
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

Get user/group permissions for this repository (GET .../permissions).

Source code in src/crew_dcs/classes/DomoSandbox/core.py
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
async def get_permissions(
    self,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    """Get user/group permissions for this repository (GET .../permissions)."""
    context = RouteContext.build_context(
        context=context, session=session, debug_api=debug_api, **context_kwargs
    )
    return await sandbox_routes.get_repo_permissions(
        auth=self.auth,
        repository_id=self.id,
        context=context,
    )
promote_and_link(
    deployment_id: str,
    commit_id: str,
    mapping: (
        list[ContentMapping | dict[str, Any]] | None
    ) = None,
    seeding_repo_name: str | None = None,
    approval_id: str | None = None,
    request: (
        PromoteAndSeedRequest | dict[str, Any] | None
    ) = None,
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

Promote a commit to a deployment and link/seed content (POST .../promoteAndSeed).

Parameters:

Name Type Description Default
deployment_id str

Target deployment

required
commit_id str

Commit to promote

required
mapping list[ContentMapping | dict[str, Any]] | None

Content mapping entries (required if request not given)

None
seeding_repo_name str | None

Optional seeding repository name

None
approval_id str | None

Optional approval ID

None
request PromoteAndSeedRequest | dict[str, Any] | None

Optional full PromoteAndSeedRequest (or raw dict) overriding the above

None
Source code in src/crew_dcs/classes/DomoSandbox/core.py
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
async def promote_and_link(
    self,
    deployment_id: str,
    commit_id: str,
    mapping: list[ContentMapping | dict[str, Any]] | None = None,
    seeding_repo_name: str | None = None,
    approval_id: str | None = None,
    request: PromoteAndSeedRequest | dict[str, Any] | None = None,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    """Promote a commit to a deployment and link/seed content (POST .../promoteAndSeed).

    Args:
        deployment_id: Target deployment
        commit_id: Commit to promote
        mapping: Content mapping entries (required if ``request`` not given)
        seeding_repo_name: Optional seeding repository name
        approval_id: Optional approval ID
        request: Optional full ``PromoteAndSeedRequest`` (or raw dict) overriding the above
    """
    context = RouteContext.build_context(
        context=context, session=session, debug_api=debug_api, **context_kwargs
    )
    body = (
        request
        if request is not None
        else PromoteAndSeedRequest(
            commit_id=commit_id,
            mapping=mapping or [],
            seeding_repo_name=seeding_repo_name,
            approval_id=approval_id,
        )
    )
    return await sandbox_routes.promote_and_seed(
        auth=self.auth,
        repository_id=self.id,
        deployment_id=deployment_id,
        request=body,
        context=context,
    )

set_instance_access async

set_instance_access(
    domains: list[str],
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

Set the instances with access to this repository (POST .../access).

Parameters:

Name Type Description Default
domains list[str]

Instance domains, e.g. ["sub.domain.tld"]

required
Source code in src/crew_dcs/classes/DomoSandbox/core.py
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
async def set_instance_access(
    self,
    domains: list[str],
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    """Set the instances with access to this repository (POST .../access).

    Args:
        domains: Instance domains, e.g. ``["sub.domain.tld"]``
    """
    context = RouteContext.build_context(
        context=context, session=session, debug_api=debug_api, **context_kwargs
    )
    return await sandbox_routes.update_repo_instance_access(
        auth=self.auth,
        repository_id=self.id,
        domains=domains,
        context=context,
    )

set_permissions async

set_permissions(
    updates: list[
        RepositoryPermissionUpdate | dict[str, Any]
    ],
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

Update user/group permissions for this repository (POST .../permissions).

Parameters:

Name Type Description Default
updates list[RepositoryPermissionUpdate | dict[str, Any]]

RepositoryPermissionUpdate entries (or raw dicts)

required
Source code in src/crew_dcs/classes/DomoSandbox/core.py
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
async def set_permissions(
    self,
    updates: list[RepositoryPermissionUpdate | dict[str, Any]],
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    """Update user/group permissions for this repository (POST .../permissions).

    Args:
        updates: ``RepositoryPermissionUpdate`` entries (or raw dicts)
    """
    context = RouteContext.build_context(
        context=context, session=session, debug_api=debug_api, **context_kwargs
    )
    return await sandbox_routes.update_repo_permissions(
        auth=self.auth,
        repository_id=self.id,
        updates=updates,
        context=context,
    )

DomoSandbox dataclass

DomoSandbox(
    auth: DomoAuth,
    repositories: list[DomoRepository] | None = None,
)

Bases: DomoManager

list_instances async

list_instances(
    limit: int = 250,
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

List authorized instances (GET /version/v1/authorizations).

Source code in src/crew_dcs/classes/DomoSandbox/core.py
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
async def list_instances(
    self,
    limit: int = 250,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    """List authorized instances (GET /version/v1/authorizations)."""
    context = RouteContext.build_context(
        context=context, session=session, debug_api=debug_api, **context_kwargs
    )
    return await sandbox_routes.get_instances(
        auth=self.auth,
        limit=limit,
        context=context,
    )

search_commit_history async

search_commit_history(
    filters: dict | None = None,
    sort: str = "completed",
    order: str = "desc",
    date_filters: dict | None = None,
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

Search commit history across repositories (POST /version/v1/commitRequests/search).

Source code in src/crew_dcs/classes/DomoSandbox/core.py
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
async def search_commit_history(
    self,
    filters: dict | None = None,
    sort: str = "completed",
    order: str = "desc",
    date_filters: dict | None = None,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    """Search commit history across repositories (POST /version/v1/commitRequests/search)."""
    context = RouteContext.build_context(
        context=context, session=session, debug_api=debug_api, **context_kwargs
    )
    return await sandbox_routes.search_commit_history(
        auth=self.auth,
        filters=filters,
        sort=sort,
        order=order,
        date_filters=date_filters,
        context=context,
    )

search_promotion_history async

search_promotion_history(
    filters: dict | None = None,
    sort: str = "completed",
    order: str = "desc",
    date_filters: dict | None = None,
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

Search promotion history across repositories (POST /version/v1/promotions/search).

Source code in src/crew_dcs/classes/DomoSandbox/core.py
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
async def search_promotion_history(
    self,
    filters: dict | None = None,
    sort: str = "completed",
    order: str = "desc",
    date_filters: dict | None = None,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    """Search promotion history across repositories (POST /version/v1/promotions/search)."""
    context = RouteContext.build_context(
        context=context, session=session, debug_api=debug_api, **context_kwargs
    )
    return await sandbox_routes.search_promotion_history(
        auth=self.auth,
        filters=filters,
        sort=sort,
        order=order,
        date_filters=date_filters,
        context=context,
    )

update_instance_alias async

update_instance_alias(
    aliased_domain: str,
    alias: str,
    debug_api: bool = False,
    session: AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs
) -> ResponseGetData

Update an instance alias (POST /version/v1/authorizations/aliases).

Source code in src/crew_dcs/classes/DomoSandbox/core.py
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
async def update_instance_alias(
    self,
    aliased_domain: str,
    alias: str,
    debug_api: bool = False,
    session: httpx.AsyncClient | None = None,
    *,
    context: RouteContext | None = None,
    **context_kwargs,
) -> rgd.ResponseGetData:
    """Update an instance alias (POST /version/v1/authorizations/aliases)."""
    context = RouteContext.build_context(
        context=context, session=session, debug_api=debug_api, **context_kwargs
    )
    return await sandbox_routes.update_instance_alias(
        auth=self.auth,
        aliased_domain=aliased_domain,
        alias=alias,
        context=context,
    )

Sandbox_CRUD_Error

Sandbox_CRUD_Error(
    operation: str,
    repository_id: str | None = None,
    message: str | None = None,
    res=None,
    **kwargs
)

Bases: RouteError

Raised when sandbox create, update, or delete operations fail.

Source code in src/crew_dcs/routes/sandbox.py
68
69
70
71
72
73
74
75
76
77
78
79
80
81
def __init__(
    self,
    operation: str,
    repository_id: str | None = None,
    message: str | None = None,
    res=None,
    **kwargs,
):
    super().__init__(
        message=message or f"Sandbox {operation} operation failed",
        entity_id=repository_id,
        res=res,
        **kwargs,
    )

Sandbox_GET_Error

Sandbox_GET_Error(
    repository_id: str | None = None,
    message: str | None = None,
    res=None,
    **kwargs
)

Bases: RouteError

Raised when sandbox retrieval operations fail.

Source code in src/crew_dcs/routes/sandbox.py
50
51
52
53
54
55
56
57
58
59
60
61
62
def __init__(
    self,
    repository_id: str | None = None,
    message: str | None = None,
    res=None,
    **kwargs,
):
    super().__init__(
        message=message or "Sandbox retrieval failed",
        entity_id=repository_id,
        res=res,
        **kwargs,
    )

Modules