forked from Azure/azure-docs-powershell-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathps-cassandra-list-get.ps1
35 lines (29 loc) · 1.43 KB
/
ps-cassandra-list-get.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# Reference: Az.CosmosDB | https://docs.microsoft.com/powershell/module/az.cosmosdb
# --------------------------------------------------
# Purpose
# Show list and get operations for accounts, keyspaces, and tables
# --------------------------------------------------
# Variables - ***** SUBSTITUTE YOUR VALUES *****
$resourceGroupName = "myResourceGroup" # Resource Group must already exist
$accountName = "myaccount" # Must be all lower case
$keyspaceName = "mykeyspace"
$tableName = "mytable"
# --------------------------------------------------
Write-Host "List all accounts in a resource group"
Get-AzCosmosDBAccount -ResourceGroupName $resourceGroupName
Write-Host "Get an account in a resource group"
Get-AzCosmosDBAccount -ResourceGroupName $resourceGroupName `
-Name $accountName
Write-Host "List all keyspaces in an account"
Get-AzCosmosDBCassandraKeyspace -ResourceGroupName $resourceGroupName `
-AccountName $accountName
Write-Host "Get a keyspace in an account"
Get-AzCosmosDBCassandraKeyspace -ResourceGroupName $resourceGroupName `
-AccountName $accountName -Name $keyspaceName
Write-Host "List all tables in a keyspace"
Get-AzCosmosDBCassandraTable -ResourceGroupName $resourceGroupName `
-AccountName $accountName -KeyspaceName $keyspaceName
Write-Host "Get a table in a keyspace"
Get-AzCosmosDBCassandraTable -ResourceGroupName $resourceGroupName `
-AccountName $accountName -KeyspaceName $keyspaceName `
-Name $tableName