Skip to main content

Methods

List virtual accounts for the tenant.

Parameters

limit
typing.Optional[int]
Number of items per page
offset
typing.Optional[int]
Number of items to skip

Returns

SyncPager[VirtualAccount]
SyncPager[VirtualAccount]
🔗 VirtualAccountReturn all virtual accounts for the tenant

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.virtual_accounts.list(
    limit=10,
    offset=10,
)

# Iterate through results
for item in response:
    print(item.name)

# Or paginate page by page
for page in response.iter_pages():
    for item in page:
        print(item.name)
Creates a new virtual account or updates an existing one based on the provided manifest.

Parameters

manifest
VirtualAccountManifest
required
🔗 VirtualAccountManifestVirtual account manifest
dry_run
typing.Optional[bool]
Dry run

Returns

GetVirtualAccountResponse
GetVirtualAccountResponse
🔗 GetVirtualAccountResponseVirtual account created/updated successfully

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.virtual_accounts.create_or_update(
    manifest={"key": "value"},
    dry_run=False,
)
Get virtual account by id

Parameters

id
str
required
serviceaccount id

Returns

GetVirtualAccountResponse
GetVirtualAccountResponse
🔗 GetVirtualAccountResponseReturns the virtual account associated with the provided virtual account id

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.virtual_accounts.get(
    id="id_value",
)
Delete a virtual account associated with the provided virtual account id.

Parameters

id
str
required
serviceaccount id

Returns

DeleteVirtualAccountResponse
DeleteVirtualAccountResponse
🔗 DeleteVirtualAccountResponseVirtual account deleted successfully

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.virtual_accounts.delete(
    id="id_value",
)
Get token for a virtual account by id

Parameters

id
str
required
serviceaccount id

Returns

GetTokenForVirtualAccountResponse
GetTokenForVirtualAccountResponse
🔗 GetTokenForVirtualAccountResponseToken for the virtual account

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.virtual_accounts.get_token(
    id="id_value",
)
Syncs the virtual account token to the configured secret store. Returns the updated JWT with sync metadata including timestamp and error (if any).

Parameters

id
str
required
serviceaccount id

Returns

SyncVirtualAccountTokenResponse
SyncVirtualAccountTokenResponse
🔗 SyncVirtualAccountTokenResponseToken synced successfully to secret store

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.virtual_accounts.sync_to_secret_store(
    id="id_value",
)
Regenerate token for a virtual account by id. The old token will remain valid for the specified grace period.

Parameters

id
str
required
serviceaccount id
grace_period_in_days
float
required
Grace period in days for which the old token will remain valid after regeneration

Returns

GetTokenForVirtualAccountResponse
GetTokenForVirtualAccountResponse
🔗 GetTokenForVirtualAccountResponseToken for the virtual account

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.virtual_accounts.regenerate_token(
    id="id_value",
    grace_period_in_days="value",
)
Delete a JWT for a virtual account by id

Parameters

id
str
required
virtual account id
jwt_id
str
required
JWT id

Returns

None
None

Usage

from truefoundry import TrueFoundry

client = TrueFoundry(
    api_key="YOUR_API_KEY",
    base_url="https://yourhost.com/path/to/api",
)

client.virtual_accounts.delete_jwt(
    id="id_value",
    jwt_id="value",
)