Skip to content

Fixed Az.CosmosDB examples #16791

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions src/CosmosDB/CosmosDB/help/New-AzCosmosDBGremlinIndexingPolicy.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,13 @@ The **New-AzCosmosDBGremlinIndexingPolicy** cmdlet creates a new object of type
### Example 1
```powershell
PS C:\> $ipath1 = New-AzCosmosDBGremlinIncludedPathIndex -DataType String -Precision -1 -Kind Hash
PS C:\>> $ipath2 = New-AzCosmosDBGremlinIncludedPathIndex -DataType String -Precision -1 -Kind Hash
PS C:\>> $IncludedPath = New-AzCosmosDBGremlinIncludedPath -Path "/*" -Index $ipath1, $ipath2
PS C:\>> $SpatialSpec = New-AzCosmosDBGremlinSpatialSpec -Path "/mySpatialPath/*" -Type "Point", "LineString", "Polygon", "MultiPolygon"
PS C:\>> $cp1 = New-AzCosmosDBGremlinCompositePath -Path "/abc" -Order Ascending
PS C:\>> $cp2 = New-AzCosmosDBGremlinCompositePath -Path "/aberc" -Order Descending
PS C:\>> $compositePath = (($cp1, $cp2), ($cp2, $cp1))
PS C:\>> New-AzCosmosDBGremlinIndexingPolicy -IncludedPath $IncludedPath -SpatialSpec $SpatialSpec -CompositePath $compositePath -ExcludedPath "/myPathToNotIndex/*" -Automatic 1 -IndexingMode Consistent

PS C:\> $ipath2 = New-AzCosmosDBGremlinIncludedPathIndex -DataType String -Precision -1 -Kind Hash
PS C:\> $IncludedPath = New-AzCosmosDBGremlinIncludedPath -Path "/*" -Index $ipath1, $ipath2
PS C:\> $SpatialSpec = New-AzCosmosDBGremlinSpatialSpec -Path "/mySpatialPath/*" -Type "Point", "LineString", "Polygon", "MultiPolygon"
PS C:\> $cp1 = New-AzCosmosDBGremlinCompositePath -Path "/abc" -Order Ascending
PS C:\> $cp2 = New-AzCosmosDBGremlinCompositePath -Path "/aberc" -Order Descending
PS C:\> $compositePath = (($cp1, $cp2), ($cp2, $cp1))
PS C:\> New-AzCosmosDBGremlinIndexingPolicy -IncludedPath $IncludedPath -SpatialSpec $SpatialSpec -CompositePath $compositePath -ExcludedPath "/myPathToNotIndex/*" -Automatic 1 -IndexingMode Consistent

Automatic : True
IndexingMode : Consistent
Expand All @@ -44,8 +43,6 @@ CompositeIndexes : {Microsoft.Azure.Commands.CosmosDB.Models.PSCompositePath Mic
SpatialIndexes : {Microsoft.Azure.Commands.CosmosDB.Models.PSSpatialSpec}
```

{{ Add example description here }}

## PARAMETERS

### -Automatic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@ Mode ConflictResolutionPath ConflictResolutionProcedure
LastWriterWins /myPath
```

{{ Add example description here }}

## PARAMETERS

### -ConflictResolutionProcedure
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ schema: 2.0.0
# Update-AzCosmosDBAccountFailoverPriority

## SYNOPSIS
{{ Fill in the Synopsis }}
Update Failover Region Priority of a CosmosDB Account.

## SYNTAX

Expand All @@ -31,13 +31,34 @@ Update-AzCosmosDBAccountFailoverPriority -FailoverPolicy <String[]> -InputObject
```

## DESCRIPTION
{{ Fill in the Description }}
Update Failover Region Priority of a CosmosDB Account.

## EXAMPLES

### Example 1
```powershell
PS C:\> Update-AzCosmosDBAccountFailoverPriority -ResourceGroupName rg -Name dbname -FailoverPolicy "region1, region2, region3"
PS C:\> Update-AzCosmosDBAccountFailoverPriority -ResourceGroupName rg -Name dbname -FailoverPolicy "region1", "region2", "region3"

Id : /subscriptions/{subscriptionid}/resourceGroups/rg/providers/Microsoft.DocumentDB/databaseAccounts/dbname
Name : dbname
Location : region1
Tags : {}
EnableCassandraConnector :
EnableMultipleWriteLocations : True
VirtualNetworkRules : {}
FailoverPolicies : {dbname-region1, dbname-region2, dbname-region3}
Locations : {dbname-region1, dbname-region2, dbname-region3}
ReadLocations : {dbname-region1, dbname-region2, dbname-region3}
WriteLocations : {dbname-region1}
Capabilities : {}
ConsistencyPolicy : Microsoft.Azure.Management.CosmosDB.Fluent.Models.ConsistencyPolicy
EnableAutomaticFailover : False
IsVirtualNetworkFilterEnabled : False
IpRules : {}
DatabaseAccountOfferType : Standard
DocumentEndpoint : https://dbname.documents.azure.com:443/
ProvisioningState : Succeeded
Kind : GlobalDocumentDB
```

FailoverPolicies updated with region1 as FailoverPriority 1, region2 as FailoverPriority 2 and region3 as FailoverPriority 3.
Expand Down
39 changes: 20 additions & 19 deletions src/CosmosDB/CosmosDB/help/Update-AzCosmosDBAccountRegion.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,35 +34,36 @@ Update-AzCosmosDBAccountRegion [-Location <String[]>] [-LocationObject <PSLocati

## DESCRIPTION
Update Regions of a CosmosDB Account. Location can be provided either as an object of type PSLocation or as strings of Location Name ordered by failover priority.
LocationObject parameter expects the list of current locations (failover prioritiies included) appended by the new LocationObjects corresponding to new locations to be added.
LocationObject parameter expects the list of current locations (failover priorities included) appended by the new LocationObjects corresponding to new locations to be added.
Location parameter expects the list of current location(ordered by failover priority) and the new locations.
Please note, we only support Addition of Regions. Please provide either Location or LocationObject.

## EXAMPLES

### Example 1
```powershell
PS C:\> Update-AzCosmosDBAccountRegion -ResourceGroupName rg1 -Name dbname -Location "location1, location2"
PS C:\> Update-AzCosmosDBAccountRegion -ResourceGroupName rg -Name dbname -Location "location1", "location2"

Kind : GlobalDocumentDB
ProvisioningState : Succeeded
DocumentEndpoint : https://dbname.documents.azure.com:443/
DatabaseAccountOfferType : Standard
IpRangeFilter :
IsVirtualNetworkFilterEnabled : False
EnableAutomaticFailover : False
ConsistencyPolicy : Microsoft.Azure.Management.CosmosDB.Fluent.Models.ConsistencyPolicy
Capabilities : {}
WriteLocations : {dbname-location1}
ReadLocations : {dbname-location2}
FailoverPolicies : {dbname-location1, dbname-location2}
VirtualNetworkRules : {}
EnableMultipleWriteLocations : False
Id : /subscriptions/{subscriptionid}/resourceGroups/rg/providers/Microsoft.DocumentDB/databaseAccounts/dbname
Name : dbname
Location : location1
Tags : {}
Id : /subscriptions/{subscriptionid}/resourceGroups/rg1/providers/Microsoft.DocumentDB/databaseAccounts/dbname
Name : dbname
Type : Microsoft.DocumentDB/databaseAccounts
EnableCassandraConnector :
EnableMultipleWriteLocations : True
VirtualNetworkRules : {}
FailoverPolicies : {dbname-location1, dbname-location2}
Locations : {dbname-location1, dbname-location2}
ReadLocations : {dbname-location1, dbname-location2}
WriteLocations : {dbname-location1}
Capabilities : {}
ConsistencyPolicy : Microsoft.Azure.Management.CosmosDB.Fluent.Models.ConsistencyPolicy
EnableAutomaticFailover : False
IsVirtualNetworkFilterEnabled : False
IpRules : {}
DatabaseAccountOfferType : Standard
DocumentEndpoint : https://dbname.documents.azure.com:443/
ProvisioningState : Succeeded
Kind : GlobalDocumentDB
```

## PARAMETERS
Expand Down
15 changes: 7 additions & 8 deletions src/CosmosDB/CosmosDB/help/Update-AzCosmosDBCassandraTable.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,14 @@ Updates the CosmosDB Cassandra Table. Performs a client side patch operation by
### Example 1
```powershell
PS C:\> Update-AzCosmosDBCassandraTable -AccountName myAccountName -ResourceGroupName myRgName -KeyspaceName myKeyspaceName -Name myTableName -Schema updatedSchema
Name : myTable
Id : /subscriptions/mySubId/resourceGroups/myRgName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/cassandraKeyspaces/myKeyspaceName/t
ables/myTableName
Location :
Tags :
Resource : Microsoft.Azure.Commands.CosmosDB.Models.PSCassandraTableGetPropertiesResource
```

{{ Add example description here }}
Name : myTable
Id : /subscriptions/mySubId/resourceGroups/myRgName/providers/Microsoft.DocumentDB/databaseAccounts/myAccountName/cassandraKeyspaces/myKeyspaceName/t
ables/myTableName
Location :
Tags :
Resource : Microsoft.Azure.Commands.CosmosDB.Models.PSCassandraTableGetPropertiesResource
```

## PARAMETERS

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,14 @@ Updates the throughput value of a CosmosDB MongoDB Collection.
### Example 1
```powershell
PS C:\> Update-AzCosmosDBMongoDBCollectionThroughput -AccountName {myAccountName} -ResourceGroupName {myResourceGroupName} -DatabaseName {mydatabaseName} -Name {myCollectionName} -Throughput {updatedThroughputValue}

Name : mxGp
Id : /subscriptions/{mySubscriptionId}/resourceGroups/{myResourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{myAccountName}/mongodbDatabase/{mydatabaseName}/collections/{myCollectionName}/throughputSettings/default
Throughput : {updatedThroughputValue}
MinimumThroughput : 400
OfferReplacePending :
```

{{ Add example description here }}

## PARAMETERS

### -AccountName
Expand Down
12 changes: 5 additions & 7 deletions src/CosmosDB/CosmosDB/help/Update-AzCosmosDBSqlRoleAssignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,20 +43,18 @@ RoleDefinitionId and Id can be either fully qualified or just the Guid.

### Example 1
```
PS C:\> Update-AzCosmosDBSqlRoleAssignment
-AccountName accountName
-ResourceGroupName resourceGroupName
-Id roleAssignmentId
-RoleDefinitionId "/subscriptions/subId/resourceGroups/resourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId"
PS C:\> Update-AzCosmosDBSqlRoleAssignment `
-AccountName accountName `
-ResourceGroupName resourceGroupName `
-Id roleAssignmentId `
-RoleDefinitionId "/subscriptions/subId/resourceGroups/resourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId"

Id : /subscriptions/subId/resourceGroups/resourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleAssignments/roleAssignmentId
Scope : /subscriptions/subId/resourceGroups/resourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/
RoleDefinitionId : /subscriptions/subId/resourceGroups/resourceGroupName/providers/Microsoft.DocumentDB/databaseAccounts/accountName/sqlRoleDefinitions/roleDefinitionId
PrincipalId : principalId
```

{{ Add example description here }}

## PARAMETERS

### -AccountName
Expand Down