Skip to content

Commit

Permalink
Merge branch 'priyankarking-redisenterprise-Microsoft.cache-2024-09-0…
Browse files Browse the repository at this point in the history
…1-preview' of https://github.com/priyankarking/azure-cli-extensions into priyankarking-redisenterprise-Microsoft.cache-2024-09-01-preview
  • Loading branch information
Priyankar gupta committed Sep 27, 2024
2 parents b33968b + 490af63 commit 10be9da
Show file tree
Hide file tree
Showing 5 changed files with 6,549 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,32 @@ def step_create(test, checks=None, cache_num=1):
'--port 10000 '
'--resource-group "{rg32}"',
checks=checks)
elif test.kwargs.get('access-policy-assignment'):
test.cmd('az redisenterprise create '
'--cluster-name "{cluster}" '
'--sku "Balanced_B1" '
'--location "WEST US 3" '
'--tags tag1="value1" '
'--resource-group "{rg}" '
'--high-availability "Disabled" '
'--minimum-tls-version "1.2" '
'--client-protocol "Encrypted" '
'--clustering-policy "EnterpriseCluster" '
'--eviction-policy "NoEviction"',
checks=checks)
elif test.kwargs.get('access-key-authentication'):
test.cmd('az redisenterprise create '
'--cluster-name "{cluster}" '
'--sku "Balanced_B1" '
'--location "WEST US 3" '
'--tags tag1="value1" '
'--access-keys-auth Disabled '
'--resource-group "{rg}" '
'--minimum-tls-version "1.2" '
'--client-protocol "Encrypted" '
'--clustering-policy "EnterpriseCluster" '
'--eviction-policy "NoEviction"',
checks=checks)
else:
test.cmd('az redisenterprise create '
'--cluster-name "{cluster}" '
Expand Down Expand Up @@ -113,6 +139,15 @@ def step_delete(test, checks=None):
'--resource-group "{rg}"',
checks=checks)

def step_database_update(test, checks=None):
if checks is None:
checks = []
if test.kwargs.get('access-key-authentication'):
test.cmd('az redisenterprise database update '
'--cluster-name "{cluster}" '
'--access-keys-auth Enabled '
'--resource-group "{rg}"',
checks=checks)

# EXAMPLE: /Databases/put/RedisEnterpriseDatabasesCreate
def step_database_create(test, checks=None):
Expand All @@ -129,6 +164,16 @@ def step_database_create(test, checks=None):
'--port 10000 '
'--resource-group "{rg31}"',
checks=checks)
elif test.kwargs.get('access-key-authentication'):
test.cmd('az redisenterprise database create '
'--cluster-name "{cluster}" '
'--client-protocol "Plaintext" '
'--clustering-policy "OSSCluster" '
'--eviction-policy "AllKeysLRU" '
'--port 10000 '
'--access-keys-auth Disabled '
'--resource-group "{rg}"',
checks=checks)
else:
test.cmd('az redisenterprise database create '
'--cluster-name "{cluster}" '
Expand All @@ -138,6 +183,38 @@ def step_database_create(test, checks=None):
'--port 10000 '
'--resource-group "{rg}"',
checks=checks)

def step_database_access_policy_assignment_create(test, checks=None):
if checks is None:
checks = []
if test.kwargs.get('access-policy-assignment'):
test.cmd('az redisenterprise database access-policy-assignment create '
'--cluster-name "{cluster}" '
'--access-policy-assignment-name defaultTestEntraApp1 '
'--access-policy-name default '
'--object-id 6497c918-11ad-41e7-1b0f-7c518a87d0b0 '
'--database-name "default" '
'--resource-group "{rg}"',
checks=checks)

def step_database_access_policy_assignment_list(test, checks=None):
if checks is None:
checks = []
test.cmd('az redisenterprise database access-policy-assignment list '
'--cluster-name "{cluster}" '
'--database-name "default" '
'--resource-group "{rg}"',
checks=checks)

def step_database_access_policy_assignment_delete(test, checks=None):
if checks is None:
checks = []
test.cmd('az redisenterprise database access-policy-assignment delete -y '
'--cluster-name "{cluster}" '
'--database-name "default" '
'--resource-group "{rg}" '
'--access-policy-assignment-name defaultTestEntraApp1',
checks=checks)

def step_database_force_unlink(test, checks=None):
if checks is None:
Expand Down
Loading

0 comments on commit 10be9da

Please sign in to comment.