api_client
api_client ¶
ApiClient_ScopeEnum ¶
Bases: DomoEnumMixin, Enum
Valid scopes for API client access.
Scopes define what resources and operations an API client can access. Multiple scopes can be assigned to a single API client.
create_api_client
async
¶
create_api_client(
auth: DomoFullAuth,
client_name: str,
client_description: str = f"generated via DL {replace('-', '')}",
scope: list[ApiClient_ScopeEnum] | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs,
) -> ResponseGetData
Create a new API client (developer token) with specified scopes.
Creates a new API client with the provided name, description, and scopes. This operation requires DomoFullAuth (username and password authentication).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoFullAuth
|
DomoFullAuth object (username and password required) |
required |
client_name
|
str
|
Name for the new API client |
required |
client_description
|
str
|
Optional description for the API client |
f'generated via DL {replace('-', '')}'
|
scope
|
list[ApiClient_ScopeEnum] | None
|
list of ApiClient_ScopeEnum values, defaults to [data, audit] |
None
|
context
|
RouteContext | None
|
Optional RouteContext for request configuration |
None
|
return_raw
|
bool
|
Return raw API response without processing |
False
|
**context_kwargs
|
Additional context parameters (session, debug_api, etc.) |
{}
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing the newly created API client data |
Raises:
| Type | Description |
|---|---|
InvalidAuthTypeError
|
If auth is not DomoFullAuth |
ApiClient_CRUD_Error
|
If API client creation fails |
Source code in src/crew_dcs/routes/instance_config/api_client.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 | |
get_api_clients
async
¶
get_api_clients(
auth: DomoAuth,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Retrieve all API clients (developer tokens) for the authenticated instance.
Fetches a list of all API clients associated with the current Domo instance. Each client includes metadata such as name, description, scopes, and ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object containing instance and credentials |
required |
context
|
RouteContext | None
|
Optional RouteContext for request configuration |
None
|
return_raw
|
bool
|
Return raw API response without processing |
False
|
**context_kwargs
|
Additional context parameters (session, debug_api, etc.) |
{}
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing list of API clients |
Raises:
| Type | Description |
|---|---|
ApiClient_GET_Error
|
If API client retrieval fails |
Source code in src/crew_dcs/routes/instance_config/api_client.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 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 113 114 115 116 117 118 119 | |
get_client_by_id
async
¶
get_client_by_id(
auth: DomoAuth,
client_id: int,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Retrieve a specific API client by its ID.
Fetches details of a single API client identified by the provided client_id. This function internally calls get_api_clients and filters the results.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object containing instance and credentials |
required |
client_id
|
int
|
Unique identifier for the API client |
required |
context
|
RouteContext | None
|
Optional RouteContext for request configuration |
None
|
return_raw
|
bool
|
Return raw API response without processing |
False
|
**context_kwargs
|
Additional context parameters (session, debug_api, etc.) |
{}
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object containing the specific API client data |
Raises:
| Type | Description |
|---|---|
ApiClient_GET_Error
|
If API client retrieval fails |
StopIteration
|
If no client with the specified ID is found |
Source code in src/crew_dcs/routes/instance_config/api_client.py
122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 | |
revoke_api_client
async
¶
revoke_api_client(
auth: DomoAuth,
client_id: str,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> ResponseGetData
Revoke (delete) an existing API client by its ID.
Permanently revokes an API client, invalidating its credentials and preventing further API access.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
auth
|
DomoAuth
|
Authentication object containing instance and credentials |
required |
client_id
|
str
|
Unique identifier for the API client to revoke |
required |
return_raw
|
bool
|
Return raw API response without processing |
False
|
context
|
RouteContext | None
|
RouteContext for request configuration |
None
|
**context_kwargs
|
Additional context parameters (session, debug_api, etc.) |
{}
|
Returns:
| Type | Description |
|---|---|
ResponseGetData
|
ResponseGetData object with confirmation message |
Raises:
| Type | Description |
|---|---|
ApiClient_RevokeError
|
If API client revocation fails |
Source code in src/crew_dcs/routes/instance_config/api_client.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 | |