az_kusto: Kusto/Azure Data Explorer cluster resource class

az_kustoR Documentation

Kusto/Azure Data Explorer cluster resource class

Description

Class representing a Kusto cluster, exposing methods for working with it.

Methods

The following methods are available, in addition to those provided by the AzureRMR::az_resource class:

  • new(...): Initialize a new storage object. See 'Initialization'.

  • start(): Start the cluster.

  • stop(): Stop the cluster.

  • create_database(...): Create a new Kusto database. See Databases below.

  • ⁠get_database(database))⁠: Get an existing database.

  • delete_database(database, confirm=TRUE): Delete a database, by default asking for confirmation first.

  • list_databases(): List all databases in this cluster.

  • get_default_tenant(): Retrieve the default tenant to authenticate with this cluster.

  • get_query_token(tenant, ...): Obtain an authentication token from Azure Active Directory for this cluster's query endpoint. Accepts further arguments that will be passed to get_kusto_token.

  • get_ingestion_token(tenant, ...): Obtain an authentication token for this cluster's ingestion endpoint. Accepts further arguments that will be passed to get_kusto_token.

Initialization

Initializing a new object of this class can either retrieve an existing Kusto cluster, or create a new cluster on the host. Generally, the best way to initialize an object is via the get_kusto_cluster and create_kusto_cluster methods of the az_resource_group class, which handle the details automatically.

Databases

A Kusto cluster can have several databases, which are represented in AzureKusto via az_kusto_database R6 objects. The az_kusto class provides the create_database, get_database, delete_database and list_databases methods for creating, deleting and retrieving databases. It's recommended to use these methods rather than calling az_kusto_database$new() directly.

create_database takes the following arguments. It returns an object of class az_kusto_database

  • database: The name of the database to create.

  • retention_period: The retention period of the database, after which data will be soft-deleted.

  • cache_period: The cache period of the database, the length of time for which queries will be cached.

get_database takes a single argument database, the name of the database to retrieve, and returns an object of class az_kusto_database. delete_database takes the name of the database to delete and returns NULL on a successful deletion. list_databases takes no arguments and returns a list of az_kusto_database objects, one for each database in the cluster.

See Also

az_kusto_database, kusto_database_endpoint, create_kusto_cluster, get_kusto_cluster, delete_kusto_cluster, get_kusto_token

Kusto/Azure Data Explorer documentation,

Examples

## Not run: 

# recommended way of retrieving a resource: via a resource group object
kus <- resgroup$get_kusto_cluster("mykusto")

# list databases
kust$list_databases()

# create a new database with a retention period of 6 months
kust$create_database("newdb", retention_period=180)

# get the default authentication tenant
kus$get_default_tenant()

# generate an authentication token
kust$get_aad_token()


## End(Not run)

AzureKusto documentation built on Oct. 12, 2023, 5:11 p.m.