id
stringlengths 7
77
| text
stringlengths 0
3.4k
| metadata
dict |
---|---|---|
astrapy.admin.check_id_endpoint_parg_kwargs
|
Utility function helping with the transition to endpoint-first constructors,
with ID being the other possibility.
It is called with the positional argument, the api_endpoint and id kwargs: it
then verifies legitimacy and returns a normalized (endpoint, id) "either" value.
Note: this uses the ID regexp to recognize IDs. Crucially, no endpoint regexp
here, since even non-Astra endpoints must be properly processed by this validator.
|
{
"kind": "function",
"name": "check_id_endpoint_parg_kwargs",
"path": "astrapy.admin.check_id_endpoint_parg_kwargs",
"parameters": [
{
"name": "p_arg",
"type": "str | None",
"description": null,
"default": null,
"value": null
},
{
"name": "api_endpoint",
"type": "str | None",
"description": null,
"default": null,
"value": null
},
{
"name": "id",
"type": "str | None",
"description": null,
"default": null,
"value": null
}
],
"returns": [
{
"name": null,
"type": "tuple[str | None, str | None]",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.fetch_raw_database_info_from_id_token
|
Fetch database information through the DevOps API and return it in
full, exactly like the API gives it back.
|
{
"kind": "function",
"name": "fetch_raw_database_info_from_id_token",
"path": "astrapy.admin.fetch_raw_database_info_from_id_token",
"parameters": [
{
"name": "id",
"type": "str",
"description": "e. g. \"01234567-89ab-cdef-0123-456789abcdef\".",
"default": null,
"value": null
},
{
"name": "token",
"type": "str | None",
"description": "a valid token to access the database information.",
"default": null,
"value": null
},
{
"name": "environment",
"type": "str",
"description": "a string representing the target Data API environment.\nIt can be left unspecified for the default value of `Environment.PROD`.\nOnly Astra DB environments can be meaningfully supplied.",
"default": "Environment.PROD",
"value": "Environment.PROD"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for waiting on a response.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "The full response from the DevOps API about the database."
}
],
"gathered_types": [
"astrapy.constants.Environment",
"PROD"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.async_fetch_raw_database_info_from_id_token
|
Fetch database information through the DevOps API and return it in
full, exactly like the API gives it back.
Async version of the function, for use in an asyncio context.
|
{
"kind": "function",
"name": "async_fetch_raw_database_info_from_id_token",
"path": "astrapy.admin.async_fetch_raw_database_info_from_id_token",
"parameters": [
{
"name": "id",
"type": "str",
"description": "e. g. \"01234567-89ab-cdef-0123-456789abcdef\".",
"default": null,
"value": null
},
{
"name": "token",
"type": "str | None",
"description": "a valid token to access the database information.",
"default": null,
"value": null
},
{
"name": "environment",
"type": "str",
"description": "a string representing the target Data API environment.\nIt can be left unspecified for the default value of `Environment.PROD`.\nOnly Astra DB environments can be meaningfully supplied.",
"default": "Environment.PROD",
"value": "Environment.PROD"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for waiting on a response.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "The full response from the DevOps API about the database."
}
],
"gathered_types": [
"astrapy.constants.Environment",
"PROD"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.fetch_database_info
|
Fetch database information through the DevOps API.
|
{
"kind": "function",
"name": "fetch_database_info",
"path": "astrapy.admin.fetch_database_info",
"parameters": [
{
"name": "api_endpoint",
"type": "str",
"description": "a full API endpoint for the Data API.",
"default": null,
"value": null
},
{
"name": "token",
"type": "str | None",
"description": "a valid token to access the database information.",
"default": null,
"value": null
},
{
"name": "keyspace",
"type": "str | None",
"description": "the desired keyspace that will be used in the result.\nIf not specified, the resulting database info will show it as None.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for waiting on a response.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "DatabaseInfo | None",
"description": "A DatabaseInfo object."
},
{
"name": null,
"type": "DatabaseInfo | None",
"description": "If the API endpoint fails to be parsed, None is returned."
},
{
"name": null,
"type": "DatabaseInfo | None",
"description": "For valid-looking endpoints, if something goes wrong an exception is raised."
}
],
"gathered_types": [
"astrapy.info.DatabaseInfo"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.async_fetch_database_info
|
Fetch database information through the DevOps API.
Async version of the function, for use in an asyncio context.
|
{
"kind": "function",
"name": "async_fetch_database_info",
"path": "astrapy.admin.async_fetch_database_info",
"parameters": [
{
"name": "api_endpoint",
"type": "str",
"description": "a full API endpoint for the Data API.",
"default": null,
"value": null
},
{
"name": "token",
"type": "str | None",
"description": "a valid token to access the database information.",
"default": null,
"value": null
},
{
"name": "keyspace",
"type": "str | None",
"description": "the desired keyspace that will be used in the result.\nIf not specified, the resulting database info will show it as None.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for waiting on a response.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "DatabaseInfo | None",
"description": "A DatabaseInfo object."
},
{
"name": null,
"type": "DatabaseInfo | None",
"description": "If the API endpoint fails to be parsed, None is returned."
},
{
"name": null,
"type": "DatabaseInfo | None",
"description": "For valid-looking endpoints, if something goes wrong an exception is raised."
}
],
"gathered_types": [
"astrapy.info.DatabaseInfo"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.normalize_region_for_id
|
{
"kind": "function",
"name": "normalize_region_for_id",
"path": "astrapy.admin.normalize_region_for_id",
"parameters": [
{
"name": "database_id",
"type": "str",
"description": null,
"default": null,
"value": null
},
{
"name": "token_str",
"type": "str | None",
"description": null,
"default": null,
"value": null
},
{
"name": "environment",
"type": "str",
"description": null,
"default": null,
"value": null
},
{
"name": "region_param",
"type": "str | None",
"description": null,
"default": null,
"value": null
},
{
"name": "max_time_ms",
"type": "int | None",
"description": null,
"default": null,
"value": null
}
],
"returns": [
{
"name": null,
"type": "str",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.AstraDBAdmin
|
An "admin" object, able to perform administrative tasks at the databases
level, such as creating, listing or dropping databases.
|
{
"kind": "class",
"name": "AstraDBAdmin",
"path": "astrapy.admin.AstraDBAdmin",
"parameters": [
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "an access token with enough permission to perform admin tasks.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "environment",
"type": "str | None",
"description": "a label, whose value is one of Environment.PROD (default),\nEnvironment.DEV or Environment.TEST.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which DevOps API calls are performed. These end up in\nthe request user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the DevOps API calls\nare performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`. Removal 2.0.",
"default": "None",
"value": "None"
},
{
"name": "dev_ops_url",
"type": "str | None",
"description": "in case of custom deployments, this can be used to specify\nthe URL to the DevOps API, such as \"https://api.astra.datastax.com\".\nGenerally it can be omitted. The environment (prod/dev/...) is\ndetermined from the API Endpoint.",
"default": "None",
"value": "None"
},
{
"name": "dev_ops_api_version",
"type": "str | None",
"description": "this can specify a custom version of the DevOps API\n(such as \"v2\"). Generally not needed.",
"default": "None",
"value": "None"
}
],
"returns": null,
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.constants.CallerType"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> from astrapy import DataAPIClient\n>>> my_client = DataAPIClient(\"AstraCS:...\")\n>>> my_astra_db_admin = my_client.get_admin()\n>>> database_list = my_astra_db_admin.list_databases()\n>>> len(database_list)\n3\n>>> database_list[2].id\n'01234567-...'\n>>> my_db_admin = my_astra_db_admin.get_database_admin(\"01234567-...\")\n>>> my_db_admin.list_keyspaces()\n['default_keyspace', 'staging_keyspace']",
"references": [
"astrapy.client.DataAPIClient"
],
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBAdmin.token_provider
|
{
"kind": "attribute",
"name": "token_provider",
"path": "astrapy.admin.AstraDBAdmin.token_provider",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "token_provider = coerce_token_provider(token)",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.AstraDBAdmin.environment
|
{
"kind": "attribute",
"name": "environment",
"path": "astrapy.admin.AstraDBAdmin.environment",
"parameters": null,
"returns": null,
"gathered_types": [
"astrapy.constants.Environment",
"PROD"
],
"value": "environment = environment or Environment.PROD.lower()",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.AstraDBAdmin.dev_ops_url
|
{
"kind": "attribute",
"name": "dev_ops_url",
"path": "astrapy.admin.AstraDBAdmin.dev_ops_url",
"parameters": null,
"returns": null,
"gathered_types": [
"astrapy.defaults.DEV_OPS_URL_ENV_MAP"
],
"value": "dev_ops_url = DEV_OPS_URL_ENV_MAP[self.environment]",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.AstraDBAdmin.callers
|
{
"kind": "attribute",
"name": "callers",
"path": "astrapy.admin.AstraDBAdmin.callers",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "callers = callers_param",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.AstraDBAdmin.with_options
|
Create a clone of this AstraDBAdmin with some changed attributes.
|
{
"kind": "function",
"name": "with_options",
"path": "astrapy.admin.AstraDBAdmin.with_options",
"parameters": [
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "an Access Token to the database. Example: `\"AstraCS:xyz...\"`.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which DevOps API calls are performed. These end up in\nthe request user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the DevOps API calls\nare performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`.\nRemoval 2.0.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AstraDBAdmin",
"description": "a new AstraDBAdmin instance."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.admin.AstraDBAdmin",
"astrapy.constants.CallerType"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> another_astra_db_admin = my_astra_db_admin.with_options(\n... callers=[(\"caller_identity\", \"1.2.0\")],\n... )",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBAdmin.set_caller
|
Set a new identity for the application/framework on behalf of which
the DevOps API calls will be performed (the "caller").
New objects spawned from this client afterwards will inherit the new settings.
|
{
"kind": "function",
"name": "set_caller",
"path": "astrapy.admin.AstraDBAdmin.set_caller",
"parameters": [
{
"name": "caller_name",
"type": "str | None",
"description": "name of the application, or framework, on behalf of which\nthe DevOps API calls are performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "None",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_astra_db_admin.set_caller(\n... callers=[(\"the_caller\", \"0.1.0\")],\n... )",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBAdmin.list_databases
|
Get the list of databases, as obtained with a request to the DevOps API.
|
{
"kind": "function",
"name": "list_databases",
"path": "astrapy.admin.AstraDBAdmin.list_databases",
"parameters": [
{
"name": "include",
"type": "str | None",
"description": "a filter on what databases are to be returned. As per\nDevOps API, defaults to \"nonterminated\". Pass \"all\" to include\nthe already terminated databases.",
"default": "None",
"value": "None"
},
{
"name": "provider",
"type": "str | None",
"description": "a filter on the cloud provider for the databases.\nAs per DevOps API, defaults to \"ALL\". Pass e.g. \"AWS\" to\nrestrict the results.",
"default": "None",
"value": "None"
},
{
"name": "page_size",
"type": "int | None",
"description": "number of results per page from the DevOps API. Optional.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "CommandCursor[AdminDatabaseInfo]",
"description": "A CommandCursor to iterate over the detected databases,"
},
{
"name": null,
"type": "CommandCursor[AdminDatabaseInfo]",
"description": "represented as AdminDatabaseInfo objects."
}
],
"gathered_types": [
"astrapy.info.AdminDatabaseInfo",
"astrapy.cursors.CommandCursor"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> database_cursor = my_astra_db_admin.list_databases()\n>>> database_list = list(database_cursor)\n>>> len(database_list)\n3\n>>> database_list[2].id\n'01234567-...'\n>>> database_list[2].status\n'ACTIVE'\n>>> database_list[2].info.region\n'eu-west-1'",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBAdmin.async_list_databases
|
Get the list of databases, as obtained with a request to the DevOps API.
Async version of the method, for use in an asyncio context.
|
{
"kind": "function",
"name": "async_list_databases",
"path": "astrapy.admin.AstraDBAdmin.async_list_databases",
"parameters": [
{
"name": "include",
"type": "str | None",
"description": "a filter on what databases are to be returned. As per\nDevOps API, defaults to \"nonterminated\". Pass \"all\" to include\nthe already terminated databases.",
"default": "None",
"value": "None"
},
{
"name": "provider",
"type": "str | None",
"description": "a filter on the cloud provider for the databases.\nAs per DevOps API, defaults to \"ALL\". Pass e.g. \"AWS\" to\nrestrict the results.",
"default": "None",
"value": "None"
},
{
"name": "page_size",
"type": "int | None",
"description": "number of results per page from the DevOps API. Optional.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "CommandCursor[AdminDatabaseInfo]",
"description": "A CommandCursor to iterate over the detected databases,"
},
{
"name": null,
"type": "CommandCursor[AdminDatabaseInfo]",
"description": "represented as AdminDatabaseInfo objects."
},
{
"name": null,
"type": "CommandCursor[AdminDatabaseInfo]",
"description": "Note that the return type is not an awaitable, rather"
},
{
"name": null,
"type": "CommandCursor[AdminDatabaseInfo]",
"description": "a regular iterable, e.g. for use in ordinary \"for\" loops."
}
],
"gathered_types": [
"astrapy.info.AdminDatabaseInfo",
"astrapy.cursors.CommandCursor"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> async def check_if_db_exists(db_id: str) -> bool:\n... db_cursor = await my_astra_db_admin.async_list_databases()\n... db_list = list(dd_cursor)\n... return db_id in db_list\n...\n>>> asyncio.run(check_if_db_exists(\"xyz\"))\nTrue\n>>> asyncio.run(check_if_db_exists(\"01234567-...\"))\nFalse",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBAdmin.database_info
|
Get the full information on a given database, through a request to the DevOps API.
|
{
"kind": "function",
"name": "database_info",
"path": "astrapy.admin.AstraDBAdmin.database_info",
"parameters": [
{
"name": "id",
"type": "str",
"description": "the ID of the target database, e. g.\n\"01234567-89ab-cdef-0123-456789abcdef\".",
"default": null,
"value": null
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AdminDatabaseInfo",
"description": "An AdminDatabaseInfo object."
}
],
"gathered_types": [
"astrapy.info.AdminDatabaseInfo"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> details_of_my_db = my_astra_db_admin.database_info(\"01234567-...\")\n>>> details_of_my_db.id\n'01234567-...'\n>>> details_of_my_db.status\n'ACTIVE'\n>>> details_of_my_db.info.region\n'eu-west-1'",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBAdmin.async_database_info
|
Get the full information on a given database, through a request to the DevOps API.
This is an awaitable method suitable for use within an asyncio event loop.
|
{
"kind": "function",
"name": "async_database_info",
"path": "astrapy.admin.AstraDBAdmin.async_database_info",
"parameters": [
{
"name": "id",
"type": "str",
"description": "the ID of the target database, e. g.\n\"01234567-89ab-cdef-0123-456789abcdef\".",
"default": null,
"value": null
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AdminDatabaseInfo",
"description": "An AdminDatabaseInfo object."
}
],
"gathered_types": [
"astrapy.info.AdminDatabaseInfo"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> async def check_if_db_active(db_id: str) -> bool:\n... db_info = await my_astra_db_admin.async_database_info(db_id)\n... return db_info.status == \"ACTIVE\"\n...\n>>> asyncio.run(check_if_db_active(\"01234567-...\"))\nTrue",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBAdmin.create_database
|
Create a database as requested, optionally waiting for it to be ready.
|
{
"kind": "function",
"name": "create_database",
"path": "astrapy.admin.AstraDBAdmin.create_database",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the desired name for the database.",
"default": null,
"value": null
},
{
"name": "cloud_provider",
"type": "str",
"description": "one of 'aws', 'gcp' or 'azure'.",
"default": null,
"value": null
},
{
"name": "region",
"type": "str",
"description": "any of the available cloud regions.",
"default": null,
"value": null
},
{
"name": "keyspace",
"type": "str | None",
"description": "name for the one keyspace the database starts with.\nIf omitted, DevOps API will use its default.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "wait_until_active",
"type": "bool",
"description": "if True (default), the method returns only after\nthe newly-created database is in ACTIVE state (a few minutes,\nusually). If False, it will return right after issuing the\ncreation request to the DevOps API, and it will be responsibility\nof the caller to check the database status before working with it.",
"default": "True",
"value": "True"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the creation request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AstraDBDatabaseAdmin",
"description": "An AstraDBDatabaseAdmin instance."
}
],
"gathered_types": [
"astrapy.admin.AstraDBDatabaseAdmin"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_new_db_admin = my_astra_db_admin.create_database(\n... \"new_database\",\n... cloud_provider=\"aws\",\n... region=\"ap-south-1\",\n... )\n>>> my_new_db = my_new_db_admin.get_database()\n>>> my_coll = my_new_db.create_collection(\"movies\", dimension=2)\n>>> my_coll.insert_one({\"title\": \"The Title\", \"$vector\": [0.1, 0.2]})",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBAdmin.async_create_database
|
Create a database as requested, optionally waiting for it to be ready.
This is an awaitable method suitable for use within an asyncio event loop.
|
{
"kind": "function",
"name": "async_create_database",
"path": "astrapy.admin.AstraDBAdmin.async_create_database",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the desired name for the database.",
"default": null,
"value": null
},
{
"name": "cloud_provider",
"type": "str",
"description": "one of 'aws', 'gcp' or 'azure'.",
"default": null,
"value": null
},
{
"name": "region",
"type": "str",
"description": "any of the available cloud regions.",
"default": null,
"value": null
},
{
"name": "keyspace",
"type": "str | None",
"description": "name for the one keyspace the database starts with.\nIf omitted, DevOps API will use its default.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "wait_until_active",
"type": "bool",
"description": "if True (default), the method returns only after\nthe newly-created database is in ACTIVE state (a few minutes,\nusually). If False, it will return right after issuing the\ncreation request to the DevOps API, and it will be responsibility\nof the caller to check the database status before working with it.",
"default": "True",
"value": "True"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the creation request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AstraDBDatabaseAdmin",
"description": "An AstraDBDatabaseAdmin instance."
}
],
"gathered_types": [
"astrapy.admin.AstraDBDatabaseAdmin"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> asyncio.run(\n... my_astra_db_admin.async_create_database(\n... \"new_database\",\n... cloud_provider=\"aws\",\n... region=\"ap-south-1\",\n.... )\n... )\nAstraDBDatabaseAdmin(id=...)",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBAdmin.drop_database
|
Drop a database, i.e. delete it completely and permanently with all its data.
|
{
"kind": "function",
"name": "drop_database",
"path": "astrapy.admin.AstraDBAdmin.drop_database",
"parameters": [
{
"name": "id",
"type": "str",
"description": "The ID of the database to drop, e. g.\n\"01234567-89ab-cdef-0123-456789abcdef\".",
"default": null,
"value": null
},
{
"name": "wait_until_active",
"type": "bool",
"description": "if True (default), the method returns only after\nthe database has actually been deleted (generally a few minutes).\nIf False, it will return right after issuing the\ndrop request to the DevOps API, and it will be responsibility\nof the caller to check the database status/availability\nafter that, if desired.",
"default": "True",
"value": "True"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the deletion request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> database_list_pre = my_astra_db_admin.list_databases()\n>>> len(database_list_pre)\n3\n>>> my_astra_db_admin.drop_database(\"01234567-...\")\n{'ok': 1}\n>>> database_list_post = my_astra_db_admin.list_databases()\n>>> len(database_list_post)\n2",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBAdmin.async_drop_database
|
Drop a database, i.e. delete it completely and permanently with all its data.
Async version of the method, for use in an asyncio context.
|
{
"kind": "function",
"name": "async_drop_database",
"path": "astrapy.admin.AstraDBAdmin.async_drop_database",
"parameters": [
{
"name": "id",
"type": "str",
"description": "The ID of the database to drop, e. g.\n\"01234567-89ab-cdef-0123-456789abcdef\".",
"default": null,
"value": null
},
{
"name": "wait_until_active",
"type": "bool",
"description": "if True (default), the method returns only after\nthe database has actually been deleted (generally a few minutes).\nIf False, it will return right after issuing the\ndrop request to the DevOps API, and it will be responsibility\nof the caller to check the database status/availability\nafter that, if desired.",
"default": "True",
"value": "True"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the deletion request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> asyncio.run(\n... my_astra_db_admin.async_drop_database(\"01234567-...\")\n... )\n{'ok': 1}",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBAdmin.get_database_admin
|
Create an AstraDBDatabaseAdmin object for admin work within a certain database.
|
{
"kind": "function",
"name": "get_database_admin",
"path": "astrapy.admin.AstraDBAdmin.get_database_admin",
"parameters": [
{
"name": "api_endpoint_or_id",
"type": "str | None",
"description": "positional parameter that can stand for both\n`api_endpoint` and `id`. Passing them together is an error.",
"default": "None",
"value": "None"
},
{
"name": "api_endpoint",
"type": "str | None",
"description": "the API Endpoint for the target database\n(e.g. `https://<ID>-<REGION>.apps.astra.datastax.com`).\nThe database must exist already for the resulting object\nto be effectively used; in other words, this invocation\ndoes not create the database, just the object instance.",
"default": "None",
"value": "None"
},
{
"name": "id",
"type": "str | None",
"description": "the target database ID. This is alternative to using the API Endpoint.",
"default": "None",
"value": "None"
},
{
"name": "region",
"type": "str | None",
"description": "the region to use for connecting to the database. The\ndatabase must be located in that region. This parameter can be used\nonly if the database is specified by its ID (instead of API Endpoint).\nIf this parameter is not passed, and cannot be inferred\nfrom the API endpoint, an additional DevOps API request is made\nto determine the default region and use it subsequently.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API\nHTTP request should it be necessary (see the `region` argument).",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AstraDBDatabaseAdmin",
"description": "An AstraDBDatabaseAdmin instance representing the requested database."
}
],
"gathered_types": [
"astrapy.admin.AstraDBDatabaseAdmin"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db_admin = my_astra_db_admin.get_database_admin(\"01234567-...\")\n>>> my_db_admin.list_keyspaces()\n['default_keyspace']\n>>> my_db_admin.create_keyspace(\"that_other_one\")\n{'ok': 1}\n>>> my_db_admin.list_keyspaces()\n['default_keyspace', 'that_other_one']",
"references": null,
"note": "This method does not perform any admin-level operation through\nthe DevOps API. For actual creation of a database, see the\n`create_database` method.",
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBAdmin.get_database
|
Create a Database instance for a specific database, to be used
when doing data-level work (such as creating/managing collections).
|
{
"kind": "function",
"name": "get_database",
"path": "astrapy.admin.AstraDBAdmin.get_database",
"parameters": [
{
"name": "api_endpoint_or_id",
"type": "str | None",
"description": "positional parameter that can stand for both\n`api_endpoint` and `id`. Passing them together is an error.",
"default": "None",
"value": "None"
},
{
"name": "api_endpoint",
"type": "str | None",
"description": "the API Endpoint for the target database\n(e.g. `https://<ID>-<REGION>.apps.astra.datastax.com`).\nThe database must exist already for the resulting object\nto be effectively used; in other words, this invocation\ndoes not create the database, just the object instance.",
"default": "None",
"value": "None"
},
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "if supplied, is passed to the Database instead of\nthe one set for this object.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "keyspace",
"type": "str | None",
"description": "used to specify a certain keyspace the resulting\nDatabase will primarily work on. If not specified, an additional\nDevOps API call reveals the default keyspace for the target database.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "id",
"type": "str | None",
"description": "the target database ID. This is alternative to using the API Endpoint.",
"default": "None",
"value": "None"
},
{
"name": "region",
"type": "str | None",
"description": "the region to use for connecting to the database. The\ndatabase must be located in that region. This parameter can be used\nonly if the database is specified by its ID (instead of API Endpoint).\nIf this parameter is not passed, and cannot be inferred\nfrom the API endpoint, an additional DevOps API request is made\nto determine the default region and use it subsequently.",
"default": "None",
"value": "None"
},
{
"name": "api_path",
"type": "str | None",
"description": "path to append to the API Endpoint. In typical usage, this\nshould be left to its default of \"/api/json\".",
"default": "None",
"value": "None"
},
{
"name": "api_version",
"type": "str | None",
"description": "version specifier to append to the API path. In typical\nusage, this should be left to its default of \"v1\".",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API\nHTTP request should it be necessary (see the `region` argument).",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "Database",
"description": "A Database object ready to be used."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.database.Database"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db = my_astra_db_admin.get_database(\n... \"https://<ID>-<REGION>.apps.astra.datastax.com\",\n... keyspace=\"my_prod_keyspace\",\n... )\n>>> coll = my_db.create_collection(\"movies\", dimension=2)\n>>> my_coll.insert_one({\"title\": \"The Title\", \"$vector\": [0.3, 0.4]})",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBAdmin.get_async_database
|
Create an AsyncDatabase instance for a specific database, to be used
when doing data-level work (such as creating/managing collections).
|
{
"kind": "function",
"name": "get_async_database",
"path": "astrapy.admin.AstraDBAdmin.get_async_database",
"parameters": [
{
"name": "api_endpoint_or_id",
"type": "str | None",
"description": "positional parameter that can stand for both\n`api_endpoint` and `id`. Passing them together is an error.",
"default": "None",
"value": "None"
},
{
"name": "api_endpoint",
"type": "str | None",
"description": "the API Endpoint for the target database\n(e.g. `https://<ID>-<REGION>.apps.astra.datastax.com`).\nThe database must exist already for the resulting object\nto be effectively used; in other words, this invocation\ndoes not create the database, just the object instance.",
"default": "None",
"value": "None"
},
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "if supplied, is passed to the Database instead of\nthe one set for this object.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "keyspace",
"type": "str | None",
"description": "used to specify a certain keyspace the resulting\nAsyncDatabase will primarily work on. If not specified, an additional\nDevOps API call reveals the default keyspace for the target database.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "id",
"type": "str | None",
"description": "the target database ID. This is alternative to using the API Endpoint.",
"default": "None",
"value": "None"
},
{
"name": "region",
"type": "str | None",
"description": "the region to use for connecting to the database. The\ndatabase must be located in that region. This parameter can be used\nonly if the database is specified by its ID (instead of API Endpoint).\nIf this parameter is not passed, and cannot be inferred\nfrom the API endpoint, an additional DevOps API request is made\nto determine the default region and use it subsequently.",
"default": "None",
"value": "None"
},
{
"name": "api_path",
"type": "str | None",
"description": "path to append to the API Endpoint. In typical usage, this\nshould be left to its default of \"/api/json\".",
"default": "None",
"value": "None"
},
{
"name": "api_version",
"type": "str | None",
"description": "version specifier to append to the API path. In typical\nusage, this should be left to its default of \"v1\".",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": null,
"description": "a timeout, in milliseconds, for the DevOps API\nHTTP request should it be necessary (see the `region` argument).",
"default": null,
"value": null
}
],
"returns": [
{
"name": null,
"type": "AsyncDatabase",
"description": "An AsyncDatabase object ready to be used."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.database.AsyncDatabase"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> async def create_use_collection(\n... admin: AstraDBAdmin,\n... api_endpoint: str,\n... keyspace: str,\n... ) -> None:\n... my_async_db = admin.get_async_database(\n... api_endpoint,\n... keyspace=keyspace,\n... )\n... a_coll = await my_async_db.create_collection(\"movies\", dimension=2)\n... await a_coll.insert_one(\n... {\"title\": \"The Title\", \"$vector\": [0.3, 0.4]}\n... )\n...\n>>> asyncio.run(create_use_collection(\n... my_admin,\n... \"https://<ID>-<REGION>.apps.astra.datastax.com\",\n... \"default_keyspace\",\n... ))\n>>>",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin
|
An abstract class defining the interface for a database admin object.
This supports generic keyspace crud, as well as spawning databases,
without committing to a specific database architecture (e.g. Astra DB).
|
{
"kind": "class",
"name": "DatabaseAdmin",
"path": "astrapy.admin.DatabaseAdmin",
"parameters": null,
"returns": null,
"gathered_types": [
"ABC"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": [
"ABC"
],
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": [
"astrapy.admin.AstraDBDatabaseAdmin",
"astrapy.admin.DataAPIDatabaseAdmin"
],
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.environment
|
{
"kind": "attribute",
"name": "environment",
"path": "astrapy.admin.DatabaseAdmin.environment",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "environment: str",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.DatabaseAdmin.spawner_database
|
{
"kind": "attribute",
"name": "spawner_database",
"path": "astrapy.admin.DatabaseAdmin.spawner_database",
"parameters": null,
"returns": null,
"gathered_types": [
"astrapy.database.Database",
"astrapy.database.AsyncDatabase"
],
"value": "spawner_database: Database | AsyncDatabase",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.DatabaseAdmin.list_namespaces
|
Get a list of namespaces for the database.
|
{
"kind": "function",
"name": "list_namespaces",
"path": "astrapy.admin.DatabaseAdmin.list_namespaces",
"parameters": [
{
"name": "pargs",
"type": "Any",
"description": null,
"default": "()",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "list[str]",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.list_keyspaces
|
Get a list of keyspaces for the database.
|
{
"kind": "function",
"name": "list_keyspaces",
"path": "astrapy.admin.DatabaseAdmin.list_keyspaces",
"parameters": [
{
"name": "pargs",
"type": "Any",
"description": null,
"default": "()",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "list[str]",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.create_namespace
|
Create a namespace in the database, returning {'ok': 1} if successful.
|
{
"kind": "function",
"name": "create_namespace",
"path": "astrapy.admin.DatabaseAdmin.create_namespace",
"parameters": [
{
"name": "name",
"type": "str",
"description": null,
"default": null,
"value": null
},
{
"name": "update_db_keyspace",
"type": "bool | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "update_db_namespace",
"type": "bool | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.create_keyspace
|
Create a keyspace in the database, returning {'ok': 1} if successful.
|
{
"kind": "function",
"name": "create_keyspace",
"path": "astrapy.admin.DatabaseAdmin.create_keyspace",
"parameters": [
{
"name": "name",
"type": "str",
"description": null,
"default": null,
"value": null
},
{
"name": "update_db_keyspace",
"type": "bool | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "update_db_namespace",
"type": "bool | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.drop_namespace
|
Drop (delete) a namespace from the database, returning {'ok': 1} if successful.
|
{
"kind": "function",
"name": "drop_namespace",
"path": "astrapy.admin.DatabaseAdmin.drop_namespace",
"parameters": [
{
"name": "name",
"type": "str",
"description": null,
"default": null,
"value": null
},
{
"name": "pargs",
"type": "Any",
"description": null,
"default": "()",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.drop_keyspace
|
Drop (delete) a keyspace from the database, returning {'ok': 1} if successful.
|
{
"kind": "function",
"name": "drop_keyspace",
"path": "astrapy.admin.DatabaseAdmin.drop_keyspace",
"parameters": [
{
"name": "name",
"type": "str",
"description": null,
"default": null,
"value": null
},
{
"name": "pargs",
"type": "Any",
"description": null,
"default": "()",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.async_list_namespaces
|
Get a list of namespaces for the database.
(Async version of the method.)
|
{
"kind": "function",
"name": "async_list_namespaces",
"path": "astrapy.admin.DatabaseAdmin.async_list_namespaces",
"parameters": [
{
"name": "pargs",
"type": "Any",
"description": null,
"default": "()",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "list[str]",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.async_list_keyspaces
|
Get a list of keyspaces for the database.
(Async version of the method.)
|
{
"kind": "function",
"name": "async_list_keyspaces",
"path": "astrapy.admin.DatabaseAdmin.async_list_keyspaces",
"parameters": [
{
"name": "pargs",
"type": "Any",
"description": null,
"default": "()",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "list[str]",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.async_create_namespace
|
Create a namespace in the database, returning {'ok': 1} if successful.
(Async version of the method.)
|
{
"kind": "function",
"name": "async_create_namespace",
"path": "astrapy.admin.DatabaseAdmin.async_create_namespace",
"parameters": [
{
"name": "name",
"type": "str",
"description": null,
"default": null,
"value": null
},
{
"name": "update_db_keyspace",
"type": "bool | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "update_db_namespace",
"type": "bool | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.async_create_keyspace
|
Create a keyspace in the database, returning {'ok': 1} if successful.
(Async version of the method.)
|
{
"kind": "function",
"name": "async_create_keyspace",
"path": "astrapy.admin.DatabaseAdmin.async_create_keyspace",
"parameters": [
{
"name": "name",
"type": "str",
"description": null,
"default": null,
"value": null
},
{
"name": "update_db_keyspace",
"type": "bool | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "update_db_namespace",
"type": "bool | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.async_drop_namespace
|
Drop (delete) a namespace from the database, returning {'ok': 1} if successful.
(Async version of the method.)
|
{
"kind": "function",
"name": "async_drop_namespace",
"path": "astrapy.admin.DatabaseAdmin.async_drop_namespace",
"parameters": [
{
"name": "name",
"type": "str",
"description": null,
"default": null,
"value": null
},
{
"name": "pargs",
"type": "Any",
"description": null,
"default": "()",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.async_drop_keyspace
|
Drop (delete) a keyspace from the database, returning {'ok': 1} if successful.
(Async version of the method.)
|
{
"kind": "function",
"name": "async_drop_keyspace",
"path": "astrapy.admin.DatabaseAdmin.async_drop_keyspace",
"parameters": [
{
"name": "name",
"type": "str",
"description": null,
"default": null,
"value": null
},
{
"name": "pargs",
"type": "Any",
"description": null,
"default": "()",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.get_database
|
Get a Database object from this database admin.
|
{
"kind": "function",
"name": "get_database",
"path": "astrapy.admin.DatabaseAdmin.get_database",
"parameters": [
{
"name": "pargs",
"type": "Any",
"description": null,
"default": "()",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "Database",
"description": null
}
],
"gathered_types": [
"astrapy.database.Database"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.get_async_database
|
Get an AsyncDatabase object from this database admin.
|
{
"kind": "function",
"name": "get_async_database",
"path": "astrapy.admin.DatabaseAdmin.get_async_database",
"parameters": [
{
"name": "pargs",
"type": "Any",
"description": null,
"default": "()",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "AsyncDatabase",
"description": null
}
],
"gathered_types": [
"astrapy.database.AsyncDatabase"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.find_embedding_providers
|
Query the Data API for the available embedding providers.
|
{
"kind": "function",
"name": "find_embedding_providers",
"path": "astrapy.admin.DatabaseAdmin.find_embedding_providers",
"parameters": [
{
"name": "pargs",
"type": "Any",
"description": null,
"default": "()",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "FindEmbeddingProvidersResult",
"description": null
}
],
"gathered_types": [
"astrapy.info.FindEmbeddingProvidersResult"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DatabaseAdmin.async_find_embedding_providers
|
Query the Data API for the available embedding providers.
(Async version of the method.)
|
{
"kind": "function",
"name": "async_find_embedding_providers",
"path": "astrapy.admin.DatabaseAdmin.async_find_embedding_providers",
"parameters": [
{
"name": "pargs",
"type": "Any",
"description": null,
"default": "()",
"value": null
},
{
"name": "kwargs",
"type": "Any",
"description": null,
"default": "{}",
"value": null
}
],
"returns": [
{
"name": null,
"type": "FindEmbeddingProvidersResult",
"description": null
}
],
"gathered_types": [
"astrapy.info.FindEmbeddingProvidersResult"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin
|
An "admin" object, able to perform administrative tasks at the keyspaces level
(i.e. within a certain database), such as creating/listing/dropping keyspaces.
This is one layer below the AstraDBAdmin concept, in that it is tied to
a single database and enables admin work within it. As such, it is generally
created by a method call on an AstraDBAdmin.
|
{
"kind": "class",
"name": "AstraDBDatabaseAdmin",
"path": "astrapy.admin.AstraDBDatabaseAdmin",
"parameters": [
{
"name": "api_endpoint",
"type": "str",
"description": "the API Endpoint for the target database\n(e.g. `https://<ID>-<REGION>.apps.astra.datastax.com`).\nThe database must exist already for the resulting object\nto be effectively used; in other words, this invocation\ndoes not create the database, just the object instance.",
"default": null,
"value": null
},
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "an access token with enough permission to perform admin tasks.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "environment",
"type": "str | None",
"description": "a label, whose value is one of Environment.PROD (default),\nEnvironment.DEV or Environment.TEST.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which Data API and DevOps API calls are performed.\nThese end up in the request user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the Data API and\nDevOps API calls are performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`. Removal 2.0.",
"default": "None",
"value": "None"
},
{
"name": "dev_ops_url",
"type": "str | None",
"description": "in case of custom deployments, this can be used to specify\nthe URL to the DevOps API, such as \"https://api.astra.datastax.com\".\nGenerally it can be omitted. The environment (prod/dev/...) is\ndetermined from the API Endpoint.",
"default": "None",
"value": "None"
},
{
"name": "dev_ops_api_version",
"type": "str | None",
"description": "this can specify a custom version of the DevOps API\n(such as \"v2\"). Generally not needed.",
"default": "None",
"value": "None"
},
{
"name": "api_path",
"type": "str | None",
"description": "path to append to the API Endpoint. In typical usage, this\nclass is created by a method such as `Database.get_database_admin()`,\nwhich passes the matching value. Generally to be left to its Astra DB\ndefault of \"/api/json\".",
"default": "None",
"value": "None"
},
{
"name": "api_version",
"type": "str | None",
"description": "version specifier to append to the API path. In typical\nusage, this class is created by a method such as\n`Database.get_database_admin()`, which passes the matching value.\nGenerally to be left to its Astra DB default of \"/v1\".",
"default": "None",
"value": "None"
},
{
"name": "spawner_database",
"type": "Database | AsyncDatabase | None",
"description": "either a Database or an AsyncDatabase instance. This represents\nthe database class which spawns this admin object, so that, if required,\na keyspace creation can retroactively \"use\" the new keyspace in the spawner.\nUsed to enable the Async/Database.get_admin_database().create_keyspace() pattern.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API\nHTTP request should it be necessary (see the `region` argument).",
"default": "None",
"value": "None"
}
],
"returns": null,
"gathered_types": [
"astrapy.constants.CallerType",
"astrapy.admin.DatabaseAdmin",
"astrapy.database.AsyncDatabase",
"astrapy.authentication.TokenProvider",
"astrapy.database.Database"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": [
"astrapy.admin.DatabaseAdmin"
],
"exports": null,
"example": ">>> from astrapy import DataAPIClient\n>>> my_client = DataAPIClient(\"AstraCS:...\")\n>>> admin_for_my_db = my_client.get_admin().get_database_admin(\n... \"https://<ID>-<REGION>.apps.astra.datastax.com\"\n... )\n>>> admin_for_my_db.list_keyspaces()\n['default_keyspace', 'staging_keyspace']\n>>> admin_for_my_db.info().status\n'ACTIVE'",
"references": [
"astrapy.client.DataAPIClient"
],
"note": "creating an instance of AstraDBDatabaseAdmin does not trigger actual creation\nof the database itself, which should exist beforehand. To create databases,\nsee the AstraDBAdmin class.",
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.token_provider
|
{
"kind": "attribute",
"name": "token_provider",
"path": "astrapy.admin.AstraDBDatabaseAdmin.token_provider",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "token_provider = coerce_token_provider(token)",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.AstraDBDatabaseAdmin.environment
|
{
"kind": "attribute",
"name": "environment",
"path": "astrapy.admin.AstraDBDatabaseAdmin.environment",
"parameters": null,
"returns": null,
"gathered_types": [
"astrapy.constants.Environment",
"PROD"
],
"value": "environment = environment or Environment.PROD.lower()",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.AstraDBDatabaseAdmin.api_endpoint
|
{
"kind": "attribute",
"name": "api_endpoint",
"path": "astrapy.admin.AstraDBDatabaseAdmin.api_endpoint",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "api_endpoint = api_endpoint",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.AstraDBDatabaseAdmin.callers
|
{
"kind": "attribute",
"name": "callers",
"path": "astrapy.admin.AstraDBDatabaseAdmin.callers",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "callers = callers_param",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.AstraDBDatabaseAdmin.api_path
|
{
"kind": "attribute",
"name": "api_path",
"path": "astrapy.admin.AstraDBDatabaseAdmin.api_path",
"parameters": null,
"returns": null,
"gathered_types": [
"astrapy.defaults.API_PATH_ENV_MAP"
],
"value": "api_path = api_path if api_path is not None else API_PATH_ENV_MAP[self.environment]",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.AstraDBDatabaseAdmin.api_version
|
{
"kind": "attribute",
"name": "api_version",
"path": "astrapy.admin.AstraDBDatabaseAdmin.api_version",
"parameters": null,
"returns": null,
"gathered_types": [
"astrapy.defaults.API_VERSION_ENV_MAP"
],
"value": "api_version = api_version if api_version is not None else API_VERSION_ENV_MAP[self.environment]",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.AstraDBDatabaseAdmin.spawner_database
|
{
"kind": "attribute",
"name": "spawner_database",
"path": "astrapy.admin.AstraDBDatabaseAdmin.spawner_database",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "spawner_database = spawner_database",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.AstraDBDatabaseAdmin.dev_ops_url
|
{
"kind": "attribute",
"name": "dev_ops_url",
"path": "astrapy.admin.AstraDBDatabaseAdmin.dev_ops_url",
"parameters": null,
"returns": null,
"gathered_types": [
"astrapy.defaults.DEV_OPS_URL_ENV_MAP"
],
"value": "dev_ops_url = dev_ops_url if dev_ops_url is not None else DEV_OPS_URL_ENV_MAP[self.environment].rstrip('/')",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.AstraDBDatabaseAdmin.dev_ops_api_version
|
{
"kind": "attribute",
"name": "dev_ops_api_version",
"path": "astrapy.admin.AstraDBDatabaseAdmin.dev_ops_api_version",
"parameters": null,
"returns": null,
"gathered_types": [
"astrapy.defaults.DEV_OPS_VERSION_ENV_MAP"
],
"value": "dev_ops_api_version = dev_ops_api_version if dev_ops_api_version is not None else DEV_OPS_VERSION_ENV_MAP[self.environment].strip('/')",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.AstraDBDatabaseAdmin.with_options
|
Create a clone of this AstraDBDatabaseAdmin with some changed attributes.
|
{
"kind": "function",
"name": "with_options",
"path": "astrapy.admin.AstraDBDatabaseAdmin.with_options",
"parameters": [
{
"name": "api_endpoint",
"type": "str | None",
"description": "the API Endpoint for the target database\n(e.g. `https://<ID>-<REGION>.apps.astra.datastax.com`).\nThe database must exist already for the resulting object\nto be effectively used; in other words, this invocation\ndoes not create the database, just the object instance.",
"default": "None",
"value": "None"
},
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "an Access Token to the database. Example: `\"AstraCS:xyz...\"`.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which Data API and DevOps API calls are performed.\nThese end up in the request user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the Data API and\nDevOps API calls are performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`.\nRemoval 2.0.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AstraDBDatabaseAdmin",
"description": "a new AstraDBDatabaseAdmin instance."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.constants.CallerType",
"astrapy.admin.AstraDBDatabaseAdmin"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_other_db = admin_for_my_db.with_options(\n... \"https://<ID>-<REGION>.apps.astra.datastax.com\",\n... )",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.set_caller
|
Set a new identity for the application/framework on behalf of which
the DevOps API calls will be performed (the "caller").
New objects spawned from this client afterwards will inherit the new settings.
|
{
"kind": "function",
"name": "set_caller",
"path": "astrapy.admin.AstraDBDatabaseAdmin.set_caller",
"parameters": [
{
"name": "caller_name",
"type": "str | None",
"description": "name of the application, or framework, on behalf of which\nthe DevOps API calls are performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "None",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_db.set_caller(\n... caller_name=\"the_caller\",\n... caller_version=\"0.1.0\",\n... )",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.id
|
The ID of this database admin.
|
{
"kind": "attribute",
"name": "id",
"path": "astrapy.admin.AstraDBDatabaseAdmin.id",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "id: str",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db_admin.id\n'01234567-89ab-cdef-0123-456789abcdef'",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.region
|
The region for this database admin.
|
{
"kind": "attribute",
"name": "region",
"path": "astrapy.admin.AstraDBDatabaseAdmin.region",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "region: str",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db_admin.region\n'us-east-1'",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.from_astra_db_admin
|
Create an AstraDBDatabaseAdmin from an AstraDBAdmin and an API Endpoint.
|
{
"kind": "function",
"name": "from_astra_db_admin",
"path": "astrapy.admin.AstraDBDatabaseAdmin.from_astra_db_admin",
"parameters": [
{
"name": "api_endpoint",
"type": "str",
"description": "the API Endpoint for the target database\n(e.g. `https://<ID>-<REGION>.apps.astra.datastax.com`).\nThe database must exist already for the resulting object\nto be effectively used; in other words, this invocation\ndoes not create the database, just the object instance.",
"default": null,
"value": null
},
{
"name": "astra_db_admin",
"type": "AstraDBAdmin",
"description": "an AstraDBAdmin object that has visibility over\nthe target database.",
"default": null,
"value": null
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API\nHTTP request should it be necessary (see the `region` argument).",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AstraDBDatabaseAdmin",
"description": "An AstraDBDatabaseAdmin object, for admin work within the database."
}
],
"gathered_types": [
"astrapy.admin.AstraDBAdmin",
"astrapy.admin.AstraDBDatabaseAdmin"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> from astrapy import DataAPIClient, AstraDBDatabaseAdmin\n>>> admin_for_my_db = AstraDBDatabaseAdmin.from_astra_db_admin(\n... \"https://<ID>-<REGION>.apps.astra.datastax.com\",\n... astra_db_admin=DataAPIClient(\"AstraCS:...\").get_admin(),\n... )\n>>> admin_for_my_db.list_keyspaces()\n['default_keyspace', 'staging_keyspace']\n>>> admin_for_my_db.info().status\n'ACTIVE'",
"references": [
"astrapy.admin.AstraDBDatabaseAdmin",
"astrapy.client.DataAPIClient"
],
"note": "Creating an instance of AstraDBDatabaseAdmin does not trigger actual creation\nof the database itself, which should exist beforehand. To create databases,\nsee the AstraDBAdmin class.",
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.from_api_endpoint
|
Create an AstraDBDatabaseAdmin from an API Endpoint and optionally a token.
|
{
"kind": "function",
"name": "from_api_endpoint",
"path": "astrapy.admin.AstraDBDatabaseAdmin.from_api_endpoint",
"parameters": [
{
"name": "api_endpoint",
"type": "str",
"description": "the API Endpoint for the target database\n(e.g. `https://<ID>-<REGION>.apps.astra.datastax.com`).\nThe database must exist already for the resulting object\nto be effectively used; in other words, this invocation\ndoes not create the database, just the object instance.",
"default": null,
"value": null
},
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "an access token with enough permissions to do admin work.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which Data API and DevOps API calls are performed.\nThese end up in the request user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the Data API and\nDevOps API calls are performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`.\nRemoval 2.0.",
"default": "None",
"value": "None"
},
{
"name": "dev_ops_url",
"type": "str | None",
"description": "in case of custom deployments, this can be used to specify\nthe URL to the DevOps API, such as \"https://api.astra.datastax.com\".\nGenerally it can be omitted. The environment (prod/dev/...) is\ndetermined from the API Endpoint.",
"default": "None",
"value": "None"
},
{
"name": "dev_ops_api_version",
"type": "str | None",
"description": "this can specify a custom version of the DevOps API\n(such as \"v2\"). Generally not needed.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AstraDBDatabaseAdmin",
"description": "An AstraDBDatabaseAdmin object, for admin work within the database."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.constants.CallerType",
"astrapy.admin.AstraDBDatabaseAdmin"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> from astrapy import AstraDBDatabaseAdmin\n>>> admin_for_my_db = AstraDBDatabaseAdmin.from_api_endpoint(\n... api_endpoint=\"https://01234567-....apps.astra.datastax.com\",\n... token=\"AstraCS:...\",\n... )\n>>> admin_for_my_db.list_keyspaces()\n['default_keyspace', 'another_keyspace']\n>>> admin_for_my_db.info().status\n'ACTIVE'",
"references": [
"astrapy.admin.AstraDBDatabaseAdmin"
],
"note": "Creating an instance of AstraDBDatabaseAdmin does not trigger actual creation\nof the database itself, which should exist beforehand. To create databases,\nsee the AstraDBAdmin class.",
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.info
|
Query the DevOps API for the full info on this database.
|
{
"kind": "function",
"name": "info",
"path": "astrapy.admin.AstraDBDatabaseAdmin.info",
"parameters": [
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AdminDatabaseInfo",
"description": "An AdminDatabaseInfo object."
}
],
"gathered_types": [
"astrapy.info.AdminDatabaseInfo"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db_info = admin_for_my_db.info()\n>>> my_db_info.status\n'ACTIVE'\n>>> my_db_info.info.region\n'us-east1'",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.async_info
|
Query the DevOps API for the full info on this database.
Async version of the method, for use in an asyncio context.
|
{
"kind": "function",
"name": "async_info",
"path": "astrapy.admin.AstraDBDatabaseAdmin.async_info",
"parameters": [
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "AdminDatabaseInfo",
"description": "An AdminDatabaseInfo object."
}
],
"gathered_types": [
"astrapy.info.AdminDatabaseInfo"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> async def wait_until_active(db_admin: AstraDBDatabaseAdmin) -> None:\n... while True:\n... info = await db_admin.async_info()\n... if info.status == \"ACTIVE\":\n... return\n...\n>>> asyncio.run(wait_until_active(admin_for_my_db))",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.list_namespaces
|
Query the DevOps API for a list of the namespaces in the database.
*DEPRECATED* (removal in 2.0). Switch to the "list_keyspaces" method.**
|
{
"kind": "function",
"name": "list_namespaces",
"path": "astrapy.admin.AstraDBDatabaseAdmin.list_namespaces",
"parameters": [
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "list[str]",
"description": "A list of the namespaces, each a string, in no particular order."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_db.list_namespaces()\n['default_keyspace', 'staging_namespace']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.list_keyspaces
|
Query the DevOps API for a list of the keyspaces in the database.
|
{
"kind": "function",
"name": "list_keyspaces",
"path": "astrapy.admin.AstraDBDatabaseAdmin.list_keyspaces",
"parameters": [
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "list[str]",
"description": "A list of the keyspaces, each a string, in no particular order."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_db.list_keyspaces()\n['default_keyspace', 'staging_keyspace']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.async_list_namespaces
|
Query the DevOps API for a list of the namespaces in the database.
Async version of the method, for use in an asyncio context.
*DEPRECATED* (removal in 2.0). Switch to the "keyspace" property.**
|
{
"kind": "function",
"name": "async_list_namespaces",
"path": "astrapy.admin.AstraDBDatabaseAdmin.async_list_namespaces",
"parameters": [
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "list[str]",
"description": "A list of the namespaces, each a string, in no particular order."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> async def check_if_ns_exists(\n... db_admin: AstraDBDatabaseAdmin, namespace: str\n... ) -> bool:\n... ns_list = await db_admin.async_list_namespaces()\n... return namespace in ns_list\n...\n>>> asyncio.run(check_if_ns_exists(admin_for_my_db, \"dragons\"))\nFalse\n>>> asyncio.run(check_if_db_exists(admin_for_my_db, \"app_namespace\"))\nTrue",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.async_list_keyspaces
|
Query the DevOps API for a list of the keyspaces in the database.
Async version of the method, for use in an asyncio context.
|
{
"kind": "function",
"name": "async_list_keyspaces",
"path": "astrapy.admin.AstraDBDatabaseAdmin.async_list_keyspaces",
"parameters": [
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "list[str]",
"description": "A list of the keyspaces, each a string, in no particular order."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> async def check_if_ks_exists(\n... db_admin: AstraDBDatabaseAdmin, keyspace: str\n... ) -> bool:\n... ks_list = await db_admin.async_list_keyspaces()\n... return keyspace in ks_list\n...\n>>> asyncio.run(check_if_ks_exists(admin_for_my_db, \"dragons\"))\nFalse\n>>> asyncio.run(check_if_db_exists(admin_for_my_db, \"app_keyspace\"))\nTrue",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.create_namespace
|
Create a namespace in this database as requested,
optionally waiting for it to be ready.
*DEPRECATED* (removal in 2.0). Switch to the "keyspace" property.**
|
{
"kind": "function",
"name": "create_namespace",
"path": "astrapy.admin.AstraDBDatabaseAdmin.create_namespace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the namespace name. If supplying a namespace that exists\nalready, the method call proceeds as usual, no errors are\nraised, and the whole invocation is a no-op.",
"default": null,
"value": null
},
{
"name": "wait_until_active",
"type": "bool",
"description": "if True (default), the method returns only after\nthe target database is in ACTIVE state again (a few\nseconds, usually). If False, it will return right after issuing the\ncreation request to the DevOps API, and it will be responsibility\nof the caller to check the database status/namespace availability\nbefore working with it.",
"default": "True",
"value": "True"
},
{
"name": "update_db_keyspace",
"type": "bool | None",
"description": "if True, the `Database` or `AsyncDatabase` class\nthat spawned this DatabaseAdmin, if any, gets updated to work on\nthe newly-created keyspace starting when this method returns.",
"default": "None",
"value": "None"
},
{
"name": "update_db_namespace",
"type": "bool | None",
"description": "an alias for update_db_keyspace.\n*DEPRECATED* as of v1.5.0, removal in v2.0.0.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the creation request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db_admin.list_namespaces()\n['default_keyspace']\n>>> my_db_admin.create_namespace(\"that_other_one\")\n{'ok': 1}\n>>> my_db_admin.list_namespaces()\n['default_keyspace', 'that_other_one']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.create_keyspace
|
Create a keyspace in this database as requested,
optionally waiting for it to be ready.
|
{
"kind": "function",
"name": "create_keyspace",
"path": "astrapy.admin.AstraDBDatabaseAdmin.create_keyspace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the keyspace name. If supplying a keyspace that exists\nalready, the method call proceeds as usual, no errors are\nraised, and the whole invocation is a no-op.",
"default": null,
"value": null
},
{
"name": "wait_until_active",
"type": "bool",
"description": "if True (default), the method returns only after\nthe target database is in ACTIVE state again (a few\nseconds, usually). If False, it will return right after issuing the\ncreation request to the DevOps API, and it will be responsibility\nof the caller to check the database status/keyspace availability\nbefore working with it.",
"default": "True",
"value": "True"
},
{
"name": "update_db_keyspace",
"type": "bool | None",
"description": "if True, the `Database` or `AsyncDatabase` class\nthat spawned this DatabaseAdmin, if any, gets updated to work on\nthe newly-created keyspace starting when this method returns.",
"default": "None",
"value": "None"
},
{
"name": "update_db_namespace",
"type": "bool | None",
"description": "an alias for update_db_keyspace.\n*DEPRECATED* as of v1.5.0, removal in v2.0.0.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the creation request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db_admin.keyspaces()\n['default_keyspace']\n>>> my_db_admin.create_keyspace(\"that_other_one\")\n{'ok': 1}\n>>> my_db_admin.list_keyspaces()\n['default_keyspace', 'that_other_one']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.async_create_namespace
|
Create a namespace in this database as requested,
optionally waiting for it to be ready.
Async version of the method, for use in an asyncio context.
*DEPRECATED* (removal in 2.0). Switch to the "async_create_keyspace" method.**
|
{
"kind": "function",
"name": "async_create_namespace",
"path": "astrapy.admin.AstraDBDatabaseAdmin.async_create_namespace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the namespace name. If supplying a namespace that exists\nalready, the method call proceeds as usual, no errors are\nraised, and the whole invocation is a no-op.",
"default": null,
"value": null
},
{
"name": "wait_until_active",
"type": "bool",
"description": "if True (default), the method returns only after\nthe target database is in ACTIVE state again (a few\nseconds, usually). If False, it will return right after issuing the\ncreation request to the DevOps API, and it will be responsibility\nof the caller to check the database status/namespace availability\nbefore working with it.",
"default": "True",
"value": "True"
},
{
"name": "update_db_keyspace",
"type": "bool | None",
"description": "if True, the `Database` or `AsyncDatabase` class\nthat spawned this DatabaseAdmin, if any, gets updated to work on\nthe newly-created keyspace starting when this method returns.",
"default": "None",
"value": "None"
},
{
"name": "update_db_namespace",
"type": "bool | None",
"description": "an alias for update_db_keyspace.\n*DEPRECATED* as of v1.5.0, removal in v2.0.0.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the creation request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> asyncio.run(\n... my_db_admin.async_create_namespace(\"app_namespace\")\n... )\n{'ok': 1}",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.async_create_keyspace
|
Create a keyspace in this database as requested,
optionally waiting for it to be ready.
Async version of the method, for use in an asyncio context.
|
{
"kind": "function",
"name": "async_create_keyspace",
"path": "astrapy.admin.AstraDBDatabaseAdmin.async_create_keyspace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the keyspace name. If supplying a keyspace that exists\nalready, the method call proceeds as usual, no errors are\nraised, and the whole invocation is a no-op.",
"default": null,
"value": null
},
{
"name": "wait_until_active",
"type": "bool",
"description": "if True (default), the method returns only after\nthe target database is in ACTIVE state again (a few\nseconds, usually). If False, it will return right after issuing the\ncreation request to the DevOps API, and it will be responsibility\nof the caller to check the database status/keyspace availability\nbefore working with it.",
"default": "True",
"value": "True"
},
{
"name": "update_db_keyspace",
"type": "bool | None",
"description": "if True, the `Database` or `AsyncDatabase` class\nthat spawned this DatabaseAdmin, if any, gets updated to work on\nthe newly-created keyspace starting when this method returns.",
"default": "None",
"value": "None"
},
{
"name": "update_db_namespace",
"type": "bool | None",
"description": "an alias for update_db_keyspace.\n*DEPRECATED* as of v1.5.0, removal in v2.0.0.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the creation request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> asyncio.run(\n... my_db_admin.async_create_keyspace(\"app_keyspace\")\n... )\n{'ok': 1}",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.drop_namespace
|
Delete a namespace from the database, optionally waiting for the database
to become active again.
*DEPRECATED* (removal in 2.0). Switch to the "drop_keyspace" method.**
|
{
"kind": "function",
"name": "drop_namespace",
"path": "astrapy.admin.AstraDBDatabaseAdmin.drop_namespace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the namespace to delete. If it does not exist in this database,\nan error is raised.",
"default": null,
"value": null
},
{
"name": "wait_until_active",
"type": "bool",
"description": "if True (default), the method returns only after\nthe target database is in ACTIVE state again (a few\nseconds, usually). If False, it will return right after issuing the\ndeletion request to the DevOps API, and it will be responsibility\nof the caller to check the database status/namespace availability\nbefore working with it.",
"default": "True",
"value": "True"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the deletion request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db_admin.list_namespaces()\n['default_keyspace', 'that_other_one']\n>>> my_db_admin.drop_namespace(\"that_other_one\")\n{'ok': 1}\n>>> my_db_admin.list_namespaces()\n['default_keyspace']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.drop_keyspace
|
Delete a keyspace from the database, optionally waiting for the database
to become active again.
|
{
"kind": "function",
"name": "drop_keyspace",
"path": "astrapy.admin.AstraDBDatabaseAdmin.drop_keyspace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the keyspace to delete. If it does not exist in this database,\nan error is raised.",
"default": null,
"value": null
},
{
"name": "wait_until_active",
"type": "bool",
"description": "if True (default), the method returns only after\nthe target database is in ACTIVE state again (a few\nseconds, usually). If False, it will return right after issuing the\ndeletion request to the DevOps API, and it will be responsibility\nof the caller to check the database status/keyspace availability\nbefore working with it.",
"default": "True",
"value": "True"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the deletion request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db_admin.list_keyspaces()\n['default_keyspace', 'that_other_one']\n>>> my_db_admin.drop_keyspace(\"that_other_one\")\n{'ok': 1}\n>>> my_db_admin.list_keyspaces()\n['default_keyspace']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.async_drop_namespace
|
Delete a namespace from the database, optionally waiting for the database
to become active again.
Async version of the method, for use in an asyncio context.
*DEPRECATED* (removal in 2.0). Switch to the "async_drop_namespace" method.**
|
{
"kind": "function",
"name": "async_drop_namespace",
"path": "astrapy.admin.AstraDBDatabaseAdmin.async_drop_namespace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the namespace to delete. If it does not exist in this database,\nan error is raised.",
"default": null,
"value": null
},
{
"name": "wait_until_active",
"type": "bool",
"description": "if True (default), the method returns only after\nthe target database is in ACTIVE state again (a few\nseconds, usually). If False, it will return right after issuing the\ndeletion request to the DevOps API, and it will be responsibility\nof the caller to check the database status/namespace availability\nbefore working with it.",
"default": "True",
"value": "True"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the deletion request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> asyncio.run(\n... my_db_admin.async_drop_namespace(\"app_namespace\")\n... )\n{'ok': 1}",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.async_drop_keyspace
|
Delete a keyspace from the database, optionally waiting for the database
to become active again.
Async version of the method, for use in an asyncio context.
|
{
"kind": "function",
"name": "async_drop_keyspace",
"path": "astrapy.admin.AstraDBDatabaseAdmin.async_drop_keyspace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the keyspace to delete. If it does not exist in this database,\nan error is raised.",
"default": null,
"value": null
},
{
"name": "wait_until_active",
"type": "bool",
"description": "if True (default), the method returns only after\nthe target database is in ACTIVE state again (a few\nseconds, usually). If False, it will return right after issuing the\ndeletion request to the DevOps API, and it will be responsibility\nof the caller to check the database status/keyspace availability\nbefore working with it.",
"default": "True",
"value": "True"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the deletion request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> asyncio.run(\n... my_db_admin.async_drop_keyspace(\"app_keyspace\")\n... )\n{'ok': 1}",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.drop
|
Drop this database, i.e. delete it completely and permanently with all its data.
This method wraps the `drop_database` method of the AstraDBAdmin class,
where more information may be found.
|
{
"kind": "function",
"name": "drop",
"path": "astrapy.admin.AstraDBDatabaseAdmin.drop",
"parameters": [
{
"name": "wait_until_active",
"type": "bool",
"description": "if True (default), the method returns only after\nthe database has actually been deleted (generally a few minutes).\nIf False, it will return right after issuing the\ndrop request to the DevOps API, and it will be responsibility\nof the caller to check the database status/availability\nafter that, if desired.",
"default": "True",
"value": "True"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the deletion request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db_admin.list_keyspaces()\n['default_keyspace', 'that_other_one']\n>>> my_db_admin.drop()\n{'ok': 1}\n>>> my_db_admin.list_keyspaces() # raises a 404 Not Found http error",
"references": null,
"note": "Once the method succeeds, methods on this object -- such as `info()`,\nor `list_keyspaces()` -- can still be invoked: however, this hardly\nmakes sense as the underlying actual database is no more.\nIt is responsibility of the developer to design a correct flow\nwhich avoids using a deceased database any further.",
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.async_drop
|
Drop this database, i.e. delete it completely and permanently with all its data.
Async version of the method, for use in an asyncio context.
This method wraps the `drop_database` method of the AstraDBAdmin class,
where more information may be found.
|
{
"kind": "function",
"name": "async_drop",
"path": "astrapy.admin.AstraDBDatabaseAdmin.async_drop",
"parameters": [
{
"name": "wait_until_active",
"type": "bool",
"description": "if True (default), the method returns only after\nthe database has actually been deleted (generally a few minutes).\nIf False, it will return right after issuing the\ndrop request to the DevOps API, and it will be responsibility\nof the caller to check the database status/availability\nafter that, if desired.",
"default": "True",
"value": "True"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the deletion request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> asyncio.run(my_db_admin.async_drop())\n{'ok': 1}",
"references": null,
"note": "Once the method succeeds, methods on this object -- such as `info()`,\nor `list_keyspaces()` -- can still be invoked: however, this hardly\nmakes sense as the underlying actual database is no more.\nIt is responsibility of the developer to design a correct flow\nwhich avoids using a deceased database any further.",
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.get_database
|
Create a Database instance from this database admin, for data-related tasks.
|
{
"kind": "function",
"name": "get_database",
"path": "astrapy.admin.AstraDBDatabaseAdmin.get_database",
"parameters": [
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "if supplied, is passed to the Database instead of\nthe one set for this object. Useful if one wants to work in\na least-privilege manner, limiting the permissions for non-admin work.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "keyspace",
"type": "str | None",
"description": "an optional keyspace to set in the resulting Database.\nThe same default logic as for `AstraDBAdmin.get_database` applies.",
"default": "None",
"value": "None"
},
{
"name": "namespace",
"type": "str | None",
"description": "an alias for `keyspace`. *DEPRECATED*, removal in 2.0.",
"default": "None",
"value": "None"
},
{
"name": "region",
"type": "str | None",
"description": "*This parameter is deprecated and should not be used.*\nIgnored in the method.",
"default": "None",
"value": "None"
},
{
"name": "api_path",
"type": "str | None",
"description": "path to append to the API Endpoint. In typical usage, this\nshould be left to its default of \"/api/json\".",
"default": "None",
"value": "None"
},
{
"name": "api_version",
"type": "str | None",
"description": "version specifier to append to the API path. In typical\nusage, this should be left to its default of \"v1\".",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "Database",
"description": "A Database object, ready to be used for working with data and collections."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.database.Database"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> my_db = my_db_admin.get_database()\n>>> my_db.list_collection_names()\n['movies', 'another_collection']",
"references": null,
"note": "creating an instance of Database does not trigger actual creation\nof the database itself, which should exist beforehand. To create databases,\nsee the AstraDBAdmin class.",
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.get_async_database
|
Create an AsyncDatabase instance out of this class for working
with the data in it.
This method has identical behavior and signature as the sync
counterpart `get_database`: please see that one for more details.
|
{
"kind": "function",
"name": "get_async_database",
"path": "astrapy.admin.AstraDBDatabaseAdmin.get_async_database",
"parameters": [
{
"name": "token",
"type": "str | TokenProvider | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "keyspace",
"type": "str | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "namespace",
"type": "str | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "region",
"type": "str | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "api_path",
"type": "str | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "api_version",
"type": "str | None",
"description": null,
"default": "None",
"value": null
},
{
"name": "max_time_ms",
"type": "int | None",
"description": null,
"default": "None",
"value": null
}
],
"returns": [
{
"name": null,
"type": "AsyncDatabase",
"description": null
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.database.AsyncDatabase"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.find_embedding_providers
|
Example (output abridged and indented for clarity):
>>> admin_for_my_db.find_embedding_providers()
FindEmbeddingProvidersResult(embedding_providers=..., openai, ...)
>>> admin_for_my_db.find_embedding_providers().embedding_providers
{
'openai': EmbeddingProvider(
display_name='OpenAI',
models=[
EmbeddingProviderModel(name='text-embedding-3-small'),
...
]
),
...
}
|
{
"kind": "function",
"name": "find_embedding_providers",
"path": "astrapy.admin.AstraDBDatabaseAdmin.find_embedding_providers",
"parameters": [
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "FindEmbeddingProvidersResult",
"description": "A `FindEmbeddingProvidersResult` object with the complete information"
},
{
"name": null,
"type": "FindEmbeddingProvidersResult",
"description": "returned by the API about available embedding providers"
}
],
"gathered_types": [
"astrapy.info.FindEmbeddingProvidersResult"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.AstraDBDatabaseAdmin.async_find_embedding_providers
|
Example (output abridged and indented for clarity):
>>> admin_for_my_db.find_embedding_providers()
FindEmbeddingProvidersResult(embedding_providers=..., openai, ...)
>>> admin_for_my_db.find_embedding_providers().embedding_providers
{
'openai': EmbeddingProvider(
display_name='OpenAI',
models=[
EmbeddingProviderModel(name='text-embedding-3-small'),
...
]
),
...
}
|
{
"kind": "function",
"name": "async_find_embedding_providers",
"path": "astrapy.admin.AstraDBDatabaseAdmin.async_find_embedding_providers",
"parameters": [
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "FindEmbeddingProvidersResult",
"description": "A `FindEmbeddingProvidersResult` object with the complete information"
},
{
"name": null,
"type": "FindEmbeddingProvidersResult",
"description": "returned by the API about available embedding providers"
}
],
"gathered_types": [
"astrapy.info.FindEmbeddingProvidersResult"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DataAPIDatabaseAdmin
|
An "admin" object for non-Astra Data API environments, to perform administrative
tasks at the keyspaces level such as creating/listing/dropping keyspaces.
Conforming to the architecture of non-Astra deployments of the Data API,
this object works within the one existing database. It is within that database
that the keyspace CRUD operations (and possibly other admin operations)
are performed. Since non-Astra environment lack the concept of an overall
admin (such as the all-databases AstraDBAdmin class), a `DataAPIDatabaseAdmin`
is generally created by invoking the `get_database_admin` method of the
corresponding `Database` object (which in turn is spawned by a DataAPIClient).
|
{
"kind": "class",
"name": "DataAPIDatabaseAdmin",
"path": "astrapy.admin.DataAPIDatabaseAdmin",
"parameters": [
{
"name": "api_endpoint",
"type": "str",
"description": "the full URI to access the Data API,\ne.g. \"http://localhost:8181\".",
"default": null,
"value": null
},
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "an access token with enough permission to perform admin tasks.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "environment",
"type": "str | None",
"description": "a label, whose value is one of Environment.OTHER (default)\nor other non-Astra environment values in the `Environment` enum.",
"default": "None",
"value": "None"
},
{
"name": "api_path",
"type": "str | None",
"description": "path to append to the API Endpoint. In typical usage, this\nclass is created by a method such as `Database.get_database_admin()`,\nwhich passes the matching value. Defaults to this portion of the path\nbeing absent.",
"default": "None",
"value": "None"
},
{
"name": "api_version",
"type": "str | None",
"description": "version specifier to append to the API path. In typical\nusage, this class is created by a method such as\n`Database.get_database_admin()`, which passes the matching value.\nDefaults to this portion of the path being absent.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which Data API calls are performed. These end up in the\nrequest user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the Data API calls\nare performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`. Removal 2.0.",
"default": "None",
"value": "None"
},
{
"name": "spawner_database",
"type": "Database | AsyncDatabase | None",
"description": "either a Database or an AsyncDatabase instance.\nThis represents the database class which spawns this admin object, so that,\nif required, a keyspace creation can retroactively \"use\" the new keyspace\nin the spawner. Used to enable the\nAsync/Database.get_admin_database().create_keyspace() pattern.",
"default": "None",
"value": "None"
}
],
"returns": null,
"gathered_types": [
"astrapy.constants.CallerType",
"astrapy.admin.DatabaseAdmin",
"astrapy.database.AsyncDatabase",
"astrapy.authentication.TokenProvider",
"astrapy.database.Database"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": [
"astrapy.admin.DatabaseAdmin"
],
"exports": null,
"example": ">>> from astrapy import DataAPIClient\n>>> from astrapy.constants import Environment\n>>> from astrapy.authentication import UsernamePasswordTokenProvider\n>>>\n>>> token_provider = UsernamePasswordTokenProvider(\"username\", \"password\")\n>>> endpoint = \"http://localhost:8181\"\n>>>\n>>> client = DataAPIClient(\n>>> token=token_provider,\n>>> environment=Environment.OTHER,\n>>> )\n>>> database = client.get_database(endpoint)\n>>> admin_for_my_db = database.get_database_admin()\n>>>\n>>> admin_for_my_db.list_keyspaces()\n['keyspace1', 'keyspace2']",
"references": [
"astrapy.constants.Environment",
"astrapy.client.DataAPIClient",
"astrapy.authentication.UsernamePasswordTokenProvider"
],
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DataAPIDatabaseAdmin.environment
|
{
"kind": "attribute",
"name": "environment",
"path": "astrapy.admin.DataAPIDatabaseAdmin.environment",
"parameters": null,
"returns": null,
"gathered_types": [
"astrapy.constants.Environment",
"OTHER"
],
"value": "environment = environment or Environment.OTHER.lower()",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.DataAPIDatabaseAdmin.token_provider
|
{
"kind": "attribute",
"name": "token_provider",
"path": "astrapy.admin.DataAPIDatabaseAdmin.token_provider",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "token_provider = coerce_token_provider(token)",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.DataAPIDatabaseAdmin.api_endpoint
|
{
"kind": "attribute",
"name": "api_endpoint",
"path": "astrapy.admin.DataAPIDatabaseAdmin.api_endpoint",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "api_endpoint = api_endpoint",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.DataAPIDatabaseAdmin.callers
|
{
"kind": "attribute",
"name": "callers",
"path": "astrapy.admin.DataAPIDatabaseAdmin.callers",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "callers = callers_param",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.DataAPIDatabaseAdmin.api_path
|
{
"kind": "attribute",
"name": "api_path",
"path": "astrapy.admin.DataAPIDatabaseAdmin.api_path",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "api_path = api_path if api_path is not None else ''",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.DataAPIDatabaseAdmin.api_version
|
{
"kind": "attribute",
"name": "api_version",
"path": "astrapy.admin.DataAPIDatabaseAdmin.api_version",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "api_version = api_version if api_version is not None else ''",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.DataAPIDatabaseAdmin.spawner_database
|
{
"kind": "attribute",
"name": "spawner_database",
"path": "astrapy.admin.DataAPIDatabaseAdmin.spawner_database",
"parameters": null,
"returns": null,
"gathered_types": null,
"value": "spawner_database = spawner_database",
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": null,
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
|
astrapy.admin.DataAPIDatabaseAdmin.with_options
|
Create a clone of this DataAPIDatabaseAdmin with some changed attributes.
|
{
"kind": "function",
"name": "with_options",
"path": "astrapy.admin.DataAPIDatabaseAdmin.with_options",
"parameters": [
{
"name": "api_endpoint",
"type": "str | None",
"description": "the full URI to access the Data API,\ne.g. \"http://localhost:8181\".",
"default": "None",
"value": "None"
},
{
"name": "token",
"type": "str | TokenProvider | None",
"description": "an access token with enough permission to perform admin tasks.\nThis can be either a literal token string or a subclass of\n`astrapy.authentication.TokenProvider`.",
"default": "None",
"value": "None"
},
{
"name": "callers",
"type": "Sequence[CallerType]",
"description": "a list of caller identities, i.e. applications, or frameworks,\non behalf of which Data API calls are performed. These end up in the\nrequest user-agent.\nEach caller identity is a (\"caller_name\", \"caller_version\") pair.",
"default": "[]",
"value": "[]"
},
{
"name": "caller_name",
"type": "str | None",
"description": "*DEPRECATED*, use `callers`. Removal 2.0. Name of the\napplication, or framework, on behalf of which the Data API calls\nare performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller. *DEPRECATED*, use `callers`.\nRemoval 2.0.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "DataAPIDatabaseAdmin",
"description": "a new DataAPIDatabaseAdmin instance."
}
],
"gathered_types": [
"astrapy.authentication.TokenProvider",
"astrapy.constants.CallerType",
"astrapy.admin.DataAPIDatabaseAdmin"
],
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_other_db = admin_for_my_db.with_options(\n... api_endpoint=\"http://10.1.1.5:8181\",\n... )",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DataAPIDatabaseAdmin.set_caller
|
Set a new identity for the application/framework on behalf of which
the DevOps API calls will be performed (the "caller").
New objects spawned from this client afterwards will inherit the new settings.
|
{
"kind": "function",
"name": "set_caller",
"path": "astrapy.admin.DataAPIDatabaseAdmin.set_caller",
"parameters": [
{
"name": "caller_name",
"type": "str | None",
"description": "name of the application, or framework, on behalf of which\nthe DevOps API calls are performed. This ends up in the request user-agent.",
"default": "None",
"value": "None"
},
{
"name": "caller_version",
"type": "str | None",
"description": "version of the caller.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "None",
"description": null
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_db.set_caller(\n... caller_name=\"the_caller\",\n... caller_version=\"0.1.0\",\n... )",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DataAPIDatabaseAdmin.list_namespaces
|
Query the API for a list of the namespaces in the database.
*DEPRECATED* (removal in 2.0). Switch to the "list_keyspaces" method.**
|
{
"kind": "function",
"name": "list_namespaces",
"path": "astrapy.admin.DataAPIDatabaseAdmin.list_namespaces",
"parameters": [
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "list[str]",
"description": "A list of the namespaces, each a string, in no particular order."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_db.list_namespaces()\n['default_keyspace', 'staging_namespace']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DataAPIDatabaseAdmin.list_keyspaces
|
Query the API for a list of the keyspaces in the database.
|
{
"kind": "function",
"name": "list_keyspaces",
"path": "astrapy.admin.DataAPIDatabaseAdmin.list_keyspaces",
"parameters": [
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "list[str]",
"description": "A list of the keyspaces, each a string, in no particular order."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_db.list_keyspaces()\n['default_keyspace', 'staging_keyspace']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DataAPIDatabaseAdmin.create_namespace
|
Create a namespace in the database, returning {'ok': 1} if successful.
*DEPRECATED* (removal in 2.0). Switch to the "create_keyspace" method.**
|
{
"kind": "function",
"name": "create_namespace",
"path": "astrapy.admin.DataAPIDatabaseAdmin.create_namespace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the namespace name. If supplying a namespace that exists\nalready, the method call proceeds as usual, no errors are\nraised, and the whole invocation is a no-op.",
"default": null,
"value": null
},
{
"name": "replication_options",
"type": "dict[str, Any] | None",
"description": "this dictionary can specify the options about\nreplication of the namespace (across database nodes). If provided,\nit must have a structure similar to:\n`{\"class\": \"SimpleStrategy\", \"replication_factor\": 1}`.",
"default": "None",
"value": "None"
},
{
"name": "update_db_keyspace",
"type": "bool | None",
"description": "if True, the `Database` or `AsyncDatabase` class\nthat spawned this DatabaseAdmin, if any, gets updated to work on\nthe newly-created keyspace starting when this method returns.",
"default": "None",
"value": "None"
},
{
"name": "update_db_namespace",
"type": "bool | None",
"description": "an alias for update_db_keyspace.\n*DEPRECATED* as of v1.5.0, removal in v2.0.0.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the creation request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_db.list_namespaces()\n['default_keyspace']\n>>> admin_for_my_db.create_namespace(\"that_other_one\")\n{'ok': 1}\n>>> admin_for_my_db.list_namespaces()\n['default_keyspace', 'that_other_one']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DataAPIDatabaseAdmin.create_keyspace
|
Create a keyspace in the database, returning {'ok': 1} if successful.
|
{
"kind": "function",
"name": "create_keyspace",
"path": "astrapy.admin.DataAPIDatabaseAdmin.create_keyspace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the keyspace name. If supplying a keyspace that exists\nalready, the method call proceeds as usual, no errors are\nraised, and the whole invocation is a no-op.",
"default": null,
"value": null
},
{
"name": "replication_options",
"type": "dict[str, Any] | None",
"description": "this dictionary can specify the options about\nreplication of the keyspace (across database nodes). If provided,\nit must have a structure similar to:\n`{\"class\": \"SimpleStrategy\", \"replication_factor\": 1}`.",
"default": "None",
"value": "None"
},
{
"name": "update_db_keyspace",
"type": "bool | None",
"description": "if True, the `Database` or `AsyncDatabase` class\nthat spawned this DatabaseAdmin, if any, gets updated to work on\nthe newly-created keyspace starting when this method returns.",
"default": "None",
"value": "None"
},
{
"name": "update_db_namespace",
"type": "bool | None",
"description": "an alias for update_db_keyspace.\n*DEPRECATED* as of v1.5.0, removal in v2.0.0.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the creation request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_db.list_keyspaces()\n['default_keyspace']\n>>> admin_for_my_db.create_keyspace(\"that_other_one\")\n{'ok': 1}\n>>> admin_for_my_db.list_keyspaces()\n['default_keyspace', 'that_other_one']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DataAPIDatabaseAdmin.drop_namespace
|
Drop (delete) a namespace from the database.
*DEPRECATED* (removal in 2.0). Switch to the "drop_namespace" method.**
|
{
"kind": "function",
"name": "drop_namespace",
"path": "astrapy.admin.DataAPIDatabaseAdmin.drop_namespace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the namespace to delete. If it does not exist in this database,\nan error is raised.",
"default": null,
"value": null
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the deletion request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_db.list_namespaces()\n['default_keyspace', 'that_other_one']\n>>> admin_for_my_db.drop_namespace(\"that_other_one\")\n{'ok': 1}\n>>> admin_for_my_db.list_namespaces()\n['default_keyspace']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DataAPIDatabaseAdmin.drop_keyspace
|
Drop (delete) a keyspace from the database.
|
{
"kind": "function",
"name": "drop_keyspace",
"path": "astrapy.admin.DataAPIDatabaseAdmin.drop_keyspace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the keyspace to delete. If it does not exist in this database,\nan error is raised.",
"default": null,
"value": null
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the deletion request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_db.list_keyspaces()\n['default_keyspace', 'that_other_one']\n>>> admin_for_my_db.drop_keyspace(\"that_other_one\")\n{'ok': 1}\n>>> admin_for_my_db.list_keyspaces()\n['default_keyspace']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DataAPIDatabaseAdmin.async_list_namespaces
|
Query the API for a list of the namespaces in the database.
Async version of the method, for use in an asyncio context.
*DEPRECATED* (removal in 2.0). Switch to the "async_list_keyspaces" method.**
|
{
"kind": "function",
"name": "async_list_namespaces",
"path": "astrapy.admin.DataAPIDatabaseAdmin.async_list_namespaces",
"parameters": [
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "list[str]",
"description": "A list of the namespaces, each a string, in no particular order."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> asyncio.run(admin_for_my_db.async_list_namespaces())\n['default_keyspace', 'staging_namespace']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DataAPIDatabaseAdmin.async_list_keyspaces
|
Query the API for a list of the keyspaces in the database.
Async version of the method, for use in an asyncio context.
|
{
"kind": "function",
"name": "async_list_keyspaces",
"path": "astrapy.admin.DataAPIDatabaseAdmin.async_list_keyspaces",
"parameters": [
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the DevOps API request.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "list[str]",
"description": "A list of the keyspaces, each a string, in no particular order."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> asyncio.run(admin_for_my_db.async_list_keyspaces())\n['default_keyspace', 'staging_keyspace']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DataAPIDatabaseAdmin.async_create_namespace
|
Create a namespace in the database, returning {'ok': 1} if successful.
Async version of the method, for use in an asyncio context.
*DEPRECATED* (removal in 2.0). Switch to the "async_create_keyspace" method.**
|
{
"kind": "function",
"name": "async_create_namespace",
"path": "astrapy.admin.DataAPIDatabaseAdmin.async_create_namespace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the namespace name. If supplying a namespace that exists\nalready, the method call proceeds as usual, no errors are\nraised, and the whole invocation is a no-op.",
"default": null,
"value": null
},
{
"name": "replication_options",
"type": "dict[str, Any] | None",
"description": "this dictionary can specify the options about\nreplication of the namespace (across database nodes). If provided,\nit must have a structure similar to:\n`{\"class\": \"SimpleStrategy\", \"replication_factor\": 1}`.",
"default": "None",
"value": "None"
},
{
"name": "update_db_keyspace",
"type": "bool | None",
"description": "if True, the `Database` or `AsyncDatabase` class\nthat spawned this DatabaseAdmin, if any, gets updated to work on\nthe newly-created keyspace starting when this method returns.",
"default": "None",
"value": "None"
},
{
"name": "update_db_namespace",
"type": "bool | None",
"description": "an alias for update_db_keyspace.\n*DEPRECATED* as of v1.5.0, removal in v2.0.0.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the creation request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_db.list_namespaces()\n['default_keyspace']\n>>> asyncio.run(admin_for_my_db.async_create_namespace(\n... \"that_other_one\"\n... ))\n{'ok': 1}\n>>> admin_for_my_db.list_namespaces()\n['default_keyspace', 'that_other_one']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DataAPIDatabaseAdmin.async_create_keyspace
|
Create a keyspace in the database, returning {'ok': 1} if successful.
Async version of the method, for use in an asyncio context.
|
{
"kind": "function",
"name": "async_create_keyspace",
"path": "astrapy.admin.DataAPIDatabaseAdmin.async_create_keyspace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the keyspace name. If supplying a keyspace that exists\nalready, the method call proceeds as usual, no errors are\nraised, and the whole invocation is a no-op.",
"default": null,
"value": null
},
{
"name": "replication_options",
"type": "dict[str, Any] | None",
"description": "this dictionary can specify the options about\nreplication of the keyspace (across database nodes). If provided,\nit must have a structure similar to:\n`{\"class\": \"SimpleStrategy\", \"replication_factor\": 1}`.",
"default": "None",
"value": "None"
},
{
"name": "update_db_keyspace",
"type": "bool | None",
"description": "if True, the `Database` or `AsyncDatabase` class\nthat spawned this DatabaseAdmin, if any, gets updated to work on\nthe newly-created keyspace starting when this method returns.",
"default": "None",
"value": "None"
},
{
"name": "update_db_namespace",
"type": "bool | None",
"description": "an alias for update_db_keyspace.\n*DEPRECATED* as of v1.5.0, removal in v2.0.0.",
"default": "None",
"value": "None"
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the creation request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_db.list_keyspaces()\n['default_keyspace']\n>>> asyncio.run(admin_for_my_db.async_create_keyspace(\n... \"that_other_one\"\n... ))\n{'ok': 1}\n>>> admin_for_my_db.list_leyspaces()\n['default_keyspace', 'that_other_one']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
astrapy.admin.DataAPIDatabaseAdmin.async_drop_namespace
|
Drop (delete) a namespace from the database.
Async version of the method, for use in an asyncio context.
*DEPRECATED* (removal in 2.0). Switch to the "async_drop_keyspace" method.**
|
{
"kind": "function",
"name": "async_drop_namespace",
"path": "astrapy.admin.DataAPIDatabaseAdmin.async_drop_namespace",
"parameters": [
{
"name": "name",
"type": "str",
"description": "the namespace to delete. If it does not exist in this database,\nan error is raised.",
"default": null,
"value": null
},
{
"name": "max_time_ms",
"type": "int | None",
"description": "a timeout, in milliseconds, for the whole requested\noperation to complete.\nNote that a timeout is no guarantee that the deletion request\nhas not reached the API server.",
"default": "None",
"value": "None"
}
],
"returns": [
{
"name": null,
"type": "dict[str, Any]",
"description": "A dictionary of the form {\"ok\": 1} in case of success."
},
{
"name": null,
"type": "dict[str, Any]",
"description": "Otherwise, an exception is raised."
}
],
"gathered_types": null,
"value": null,
"yields": null,
"imports": null,
"properties": null,
"bases": null,
"exports": null,
"example": ">>> admin_for_my_db.list_namespaces()\n['that_other_one', 'default_keyspace']\n>>> asyncio.run(admin_for_my_db.async_drop_namespace(\n... \"that_other_one\"\n... ))\n{'ok': 1}\n>>> admin_for_my_db.list_namespaces()\n['default_keyspace']",
"references": null,
"note": null,
"implemented_by": null,
"attributes": null
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.