# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
# pylint: disable=unused-argument


from .. import try_manual


# EXAMPLE: /Databases/put/RedisEnterpriseDatabasesCreate
@try_manual
def step_database_create(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise database create '
             '--cluster-name "cache1" '
             '--client-protocol "Encrypted" '
             '--clustering-policy "EnterpriseCluster" '
             '--eviction-policy "AllKeysLRU" '
             '--modules name="RedisBloom" args="ERROR_RATE 0.00 INITIAL_SIZE 400" '
             '--modules name="RedisTimeSeries" args="RETENTION_POLICY 20" '
             '--modules name="RediSearch" '
             '--persistence aof-enabled=true aof-frequency="1s" '
             '--port 10000 '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /Databases/get/RedisEnterpriseDatabasesGet
@try_manual
def step_database_show(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise database show '
             '--cluster-name "cache1" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /Databases/get/RedisEnterpriseDatabasesListByCluster
@try_manual
def step_database_list(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise database list '
             '--cluster-name "cache1" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /Databases/patch/RedisEnterpriseDatabasesUpdate
@try_manual
def step_database_update(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise database update '
             '--cluster-name "cache1" '
             '--client-protocol "Encrypted" '
             '--eviction-policy "AllKeysLRU" '
             '--persistence rdb-enabled=true rdb-frequency="12h" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /Databases/post/RedisEnterpriseDatabasesExport
@try_manual
def step_database_export(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise database export '
             '--cluster-name "cache1" '
             '--sas-uri "https://contosostorage.blob.core.window.net/urlToBlobContainer?sasKeyParameters" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /Databases/post/RedisEnterpriseDatabasesImport
@try_manual
def step_database_import(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise database import '
             '--cluster-name "cache1" '
             '--sas-uri "https://contosostorage.blob.core.window.net/urltoBlobFile?sasKeyParameters" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /Databases/post/RedisEnterpriseDatabasesListKeys
@try_manual
def step_database_list_keys(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise database list-keys '
             '--cluster-name "cache1" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /Databases/post/RedisEnterpriseDatabasesRegenerateKey
@try_manual
def step_database_regenerate_key(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise database regenerate-key '
             '--cluster-name "cache1" '
             '--key-type "Primary" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /Databases/delete/RedisEnterpriseDatabasesDelete
@try_manual
def step_database_delete(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise database delete -y '
             '--cluster-name "cache1" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /OperationsStatus/get/OperationsStatusGet
@try_manual
def step_operation_status_show(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise operation-status show '
             '--operation-id "testoperationid" '
             '--location "West US"',
             checks=checks)


# EXAMPLE: /RedisEnterprise/put/RedisEnterpriseCreate
@try_manual
def step_create(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise create '
             '--cluster-name "cache1" '
             '--location "West US" '
             '--minimum-tls-version "1.2" '
             '--sku "EnterpriseFlash_F300" '
             '--capacity 3 '
             '--tags tag1="value1" '
             '--zones "1" "2" "3" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /RedisEnterprise/get/RedisEnterpriseGet
@try_manual
def step_show(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise show '
             '--cluster-name "cache1" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /RedisEnterprise/get/RedisEnterpriseList
@try_manual
def step_list(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise list '
             '-g ""',
             checks=checks)


# EXAMPLE: /RedisEnterprise/get/RedisEnterpriseListByResourceGroup
@try_manual
def step_list2(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise list '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /RedisEnterprise/patch/RedisEnterpriseUpdate
@try_manual
def step_update(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise update '
             '--cluster-name "cache1" '
             '--minimum-tls-version "1.2" '
             '--sku "EnterpriseFlash_F300" '
             '--capacity 9 '
             '--tags tag1="value1" '
             '--resource-group "{rg}"',
             checks=checks)


# EXAMPLE: /RedisEnterprise/delete/RedisEnterpriseDelete
@try_manual
def step_delete(test, rg, checks=None):
    if checks is None:
        checks = []
    test.cmd('az redisenterprise delete -y '
             '--cluster-name "cache1" '
             '--resource-group "{rg}"',
             checks=checks)
