Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
[assembly: System.Reflection.AssemblyCopyrightAttribute("Copyright © Microsoft")]
[assembly: System.Reflection.AssemblyProductAttribute("Microsoft Azure PowerShell")]
[assembly: System.Reflection.AssemblyTitleAttribute("Microsoft Azure PowerShell - RedisEnterpriseCache")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.4.1")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.4.1")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.5.0")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.5.0")]
[assembly: System.Runtime.InteropServices.ComVisibleAttribute(false)]
[assembly: System.CLSCompliantAttribute(false)]
65 changes: 36 additions & 29 deletions src/RedisEnterpriseCache/RedisEnterpriseCache.Autorest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,24 @@ module-version: 1.0.0
title: RedisEnterpriseCache
subject-prefix: 'RedisEnterpriseCache'

# This will remove the 'RedisEnterprise' prefix from the subject of every cmdlet
# beginning with 'RedisEnterprise', because we have already set the subject-prefix above
# For new modules, please avoid setting 3.x using the use-extension method and instead, use 4.x as the default option
use-extension:
"@autorest/powershell": "3.x"

directive:
- from: swagger-document
where: $.definitions.AccessPolicyAssignment
transform: $['required'] = ['properties']
- from: swagger-document
where: $.definitions.AccessPolicyAssignmentProperties.properties.user
transform: $['required'] = ['objectId']
- from: swagger-document
where: $.definitions.ForceLinkParameters.properties.geoReplication
transform: $['required'] = ['linkedDatabases','groupNickname']

- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}"].put
transform: $['operationId'] = 'AccessPolicyAssignment_CreateOrUpdate'
- from: swagger-document
where: $.paths["/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Cache/redisEnterprise/{clusterName}/databases/{databaseName}/accessPolicyAssignments/{accessPolicyAssignmentName}"].put
transform: $['description'] = 'Create a particular access policy assignment for a database'

# This will remove the 'RedisEnterprise' prefix from the subject of every cmdlet
# beginning with 'RedisEnterprise', because we have already set the subject-prefix above
- where:
Expand Down Expand Up @@ -80,11 +91,6 @@ directive:
alias:
- Get-AzRedisEnterpriseCacheDatabaseKey
- Get-AzRedisEnterpriseCacheAccessKey
- where:
verb: New
subject: AccessPolicyAssignmentUpdate
set:
subject: AccessPolicyAssignment
- where:
verb: Import|Export
subject: (^Database)(.*)
Expand Down Expand Up @@ -208,15 +214,24 @@ directive:
subject: Key
variant: ^Regenerate$|ViaIdentity
remove: true

# Remove unexpanded variant
- where:
verb: New
subject: ^$|Database
variant: ^Create$|ViaIdentity
verb: Invoke
variant: ^(Flush|Force)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
- where:
verb: Update
subject: ^$|Database
variant: ^Update$|ViaIdentity$
variant: ^(Create|Update)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
- where:
subject: AccessPolicyAssignment
variant: ^(Create)(?!.*?(Expanded|JsonFilePath|JsonString))
remove: true
# Remove because cannot update
- where:
verb: Set|Update
subject: AccessPolicyAssignment
remove: true

# Hide cmdlets
Expand Down Expand Up @@ -244,17 +259,6 @@ directive:
set:
default:
script: '"default"'

- from: swagger-document
where: $.definitions.AccessPolicyAssignment
transform: $['required'] = ['properties']
- from: swagger-document
where: $.definitions.AccessPolicyAssignmentProperties.properties.user
transform: $['required'] = ['objectId']
- from: swagger-document
where: $.definitions.ForceLinkParameters.properties.geoReplication
transform: $['required'] = ['linkedDatabases','groupNickname']

# DatabaseName parameter to have value 'default'
- where:
verb: Invoke
Expand All @@ -265,10 +269,13 @@ directive:
default:
script: '"default"'
# Fix bugs in generated code from namespace conflict
# - from: source-file-csharp
# where: $
# transform: $ = $.replace(/Origin\(System.Convert.ToString\(/g, 'Origin(global::System.Convert.ToString(');
- from: source-file-csharp
where: $
transform: $ = $.replace(/Origin\(System.Convert.ToString\(/g, 'Origin(global::System.Convert.ToString(');
transform: $ = $.replace(/Module.Instance.SetProxyConfiguration\(/g, 'Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Module.Instance.SetProxyConfiguration(');
- from: source-file-csharp
where: $
transform: $ = $.replace(/Module.Instance.SetProxyConfiguration\(/g, 'Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Module.Instance.SetProxyConfiguration(');
transform: $ = $.replace(/Forcibly reforce an existing database/g, 'Forcibly recreates an existing database');
```
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.

namespace Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250501Preview
namespace Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models
{
public partial class Cluster
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@ West US MyCache3 Microsoft.Cache/redisEnterprise {default}
Central US MyCache4 Microsoft.Cache/redisEnterprise {1, 2, 3} {default}

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250501Preview.ICluster
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.ICluster
.Link
https://learn.microsoft.com/powershell/module/az.redisenterprisecache/get-azredisenterprisecache
#>

function Get-AzRedisEnterpriseCache {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250501Preview.ICluster])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.ICluster])]
[CmdletBinding(DefaultParameterSetName='ListBySubscriptionId', PositionalBinding=$false)]
param(
[Parameter(ParameterSetName='Get', Mandatory)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ Name Type
default Microsoft.Cache/redisEnterprise/databases

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250501Preview.IDatabase
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.IDatabase
.Link
https://learn.microsoft.com/powershell/module/az.redisenterprisecache/get-azredisenterprisecachedatabase
#>
function Get-AzRedisEnterpriseCacheDatabase {
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250501Preview.IDatabase])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.IDatabase])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false)]
param(
[Parameter(Mandatory)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ PrimaryKey SecondaryKey
primary-key secondary-key

.Outputs
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250501Preview.IAccessKeys
Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.IAccessKeys
.Link
https://learn.microsoft.com/powershell/module/az.redisenterprisecache/get-azredisenterprisecachekey
#>
function Get-AzRedisEnterpriseCacheKey {
[Alias('Get-AzRedisEnterpriseCacheDatabaseKey', 'Get-AzRedisEnterpriseCacheAccessKey')]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.Api20250501Preview.IAccessKeys])]
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.RedisEnterpriseCache.Models.IAccessKeys])]
[CmdletBinding(DefaultParameterSetName='List', PositionalBinding=$false, SupportsShouldProcess, ConfirmImpact='Medium')]
param(
[Parameter(Mandatory)]
Expand Down
Loading