exec.azurerm.redis.operations

Azure Resource Manager (ARM) Redis Operations Execution Module

New in version 2.0.0.

Changed in version 3.0.0,: 4.0.0

maintainer:

<devops@eitr.tech>

configuration:

This module requires Azure Resource Manager credentials to be passed as keyword arguments to every function or via acct in order to work properly.

Required provider parameters:

if using username and password:
  • subscription_id
  • username
  • password
if using a service principal:
  • subscription_id
  • tenant
  • client_id
  • secret

Optional provider parameters:

cloud_environment: Used to point the cloud driver to different API endpoints, such as Azure GovCloud. Possible values:

  • AZURE_PUBLIC_CLOUD (default)
  • AZURE_CHINA_CLOUD
  • AZURE_US_GOV_CLOUD
  • AZURE_GERMAN_CLOUD
idem_azurerm.exec.azurerm.redis.operations.check_name_availability(hub, ctx, name, **kwargs)

New in version 2.0.0.

Checks that the redis cache name is valid and is not already in use.

Parameters:name – The name of the Redis cache to check if it exists already.

CLI Example:

azurerm.redis.operations.check_name_availability test_name
idem_azurerm.exec.azurerm.redis.operations.create(hub, ctx, name, resource_group, location, sku, redis_configuration=None, enable_non_ssl_port=None, tenant_settings=None, shard_count=None, minimum_tls_version=None, subnet_id=None, static_ip=None, zones=None, polling=True, **kwargs)

New in version 2.0.0.

Changed in version 3.0.0.

Create or replace (overwrite/recreate, with potential downtime) an existing Redis cache.

Parameters:
  • name – The name of the Redis cache.
  • resource_group – The name of the resource group.
  • location – The geo-location where the resource lives.
  • sku

    A dictionary representing the SKU of the Redis cache to deploy. Required parameters include:

    • name: The type of Redis cache to deploy. Possible values include: ‘Basic’, ‘Standard’, and ‘Premium’.
    • family: The SKU family to use. Possible values include ‘C’ for Basic/Standard and ‘P’ for Premium.
    • capacity: The size of the Redis cache to deploy. Possible values include 0, 1, 2, 3, 4, 5, and 6 for the C (Basic/Standard) family and 1, 2, 3, and 4 for the P (Premium) family.
  • redis_configuration – A dictionary of string key-value pairs that represent all Redis Settings. Some possible keys include: rdb-backup-enabled, rdb-storage-connection-string, rdb-backup-frequency, maxmemory-delta, maxmemory-policy, notify-keyspace-events, maxmemory-samples, slowlog-log-slower-than, slowlog-max-len, list-max-ziplist-entries, list-max-ziplist-value, hash-max-ziplist-entries, hash-max-ziplist-value, set-max-intset-entries, zset-max-ziplist-entries, zset-max-ziplist-value, and more.
  • enable_non_ssl_port – Specifies whether the non-ssl Redis server port (6379) is enabled. Defaults to False.
  • tenant_settings – A dictionary of tenant settings.
  • shard_count – The number of shards to be created on a Premium Cluster Cache.
  • minimum_tls_version – The specified TLS version (or higher) that clients are required to use. Possible values include: ‘1.0’, ‘1.1’, and ‘1.2’.
  • subnet_id – The full resource ID of a subnet in a virtual network to deploy the Redis cache in. Example format: “/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/Microsoft.{Network|ClassicNetwork}/VirtualNetworks/vnet1/subnets/subnet1”.
  • static_ip – Static IP address. Required when deploying a Redis cache inside an existing Azure Virtual Network.
  • zones – A list of availability zones denoting where the resource needs to come from.
  • tags – A dictionary of strings can be passed as tag metadata to the Redis cache object.
  • polling – An optional boolean flag representing whether a Poller will be used during the creation of the Redis Cache. If set to True, a Poller will be used by this operation and the module will not return until the Redis Cache has completed its creation process and has been successfully provisioned. If set to False, the module will return once the Redis Cache has successfully begun its creation process. Defaults to True.

CLI Example:

azurerm.redis.operations.create test_name test_rg test_location test_sku
idem_azurerm.exec.azurerm.redis.operations.delete(hub, ctx, name, resource_group, **kwargs)

New in version 2.0.0.

Deletes a Redis cache.

Parameters:
  • name – The name of the Redis cache.
  • resource_group – The name of the resource group.

CLI Example:

azurerm.redis.operations.delete test_name test_rg
idem_azurerm.exec.azurerm.redis.operations.export_data(hub, ctx, name, resource_group, prefix, container, file_format=None, **kwargs)

New in version 2.0.0.

Export data from the redis cache to blobs in a container.

Parameters:
  • name – The name of the Redis cache.
  • resource_group – The name of the resource group.
  • prefix – The prefix to use for exported files.
  • container – The name of the container to export to.
  • file_format – An optional file format.

CLI Example:

azurerm.redis.operations.export_data test_name test_rg test_prefix test_container
idem_azurerm.exec.azurerm.redis.operations.force_reboot(hub, ctx, name, resource_group, reboot_type, shard_id=None, **kwargs)

New in version 2.0.0.

Reboot specified Redis node(s). This operation requires write permission to the cache resource. There can be potential data loss.

Parameters:
  • name – The name of the redis cache.
  • resource_group – The name of the resource group.
  • reboot_type – Which Redis node(s) to reboot. Depending on this value data loss is possible. Possible values include: ‘PrimaryNode’, ‘SecondaryNode’, ‘AllNodes’.
  • shard_id – If clustering is enabled, the ID of the shard to be rebooted.

CLI Example:

azurerm.redis.operations.force_reboot test_name test_rg test_type test_id
idem_azurerm.exec.azurerm.redis.operations.get(hub, ctx, name, resource_group, **kwargs)

New in version 2.0.0.

Gets a Redis cache (resource description).

Parameters:
  • name – The name of the Redis cache.
  • resource_group – The name of the resource group.

CLI Example:

azurerm.redis.operations.get test_name test_rg
idem_azurerm.exec.azurerm.redis.operations.import_data(hub, ctx, name, resource_group, files, file_format=None, **kwargs)

New in version 2.0.0.

Import data into Redis cache.

Parameters:
  • name – The name of the Redis cache.
  • resource_group – The name of the resource group.
  • files – A list of strings that represent the names of files to import.
  • file_format – An optional file format.

CLI Example:

azurerm.redis.operations.import_data test_name test_rg test_files
idem_azurerm.exec.azurerm.redis.operations.list_(hub, ctx, resource_group=None, **kwargs)

New in version 2.0.0.

Changed in version 4.0.0.

Gets all Redis caches in the specified subscription.

Parameters:resource_group – The name of the resource group to limit the results.

CLI Example:

azurerm.redis.operations.list
idem_azurerm.exec.azurerm.redis.operations.list_keys(hub, ctx, name, resource_group, **kwargs)

New in version 2.0.0.

Retrieve a Redis cache’s access keys. This operation requires write permission to the cache resource.

Parameters:
  • name – The name of the Redis cache.
  • resource_group – The name of the resource group.

CLI Example:

azurerm.redis.operations.list_keys test_name test_rg
idem_azurerm.exec.azurerm.redis.operations.list_upgrade_notifications(hub, ctx, name, resource_group, history, **kwargs)

New in version 2.0.0.

Gets any upgrade notifications for a Redis cache.

Parameters:
  • name – The name of the Redis cache.
  • resource_group – The name of the resource group.
  • history – A float value representing how many minutes in past to look for upgrade notifications.

CLI Example:

azurerm.redis.operations.list_upgrade_notifications test_name test_rg test_history
idem_azurerm.exec.azurerm.redis.operations.regenerate_key(hub, ctx, name, resource_group, key_type, **kwargs)

New in version 2.0.0.

Regenerate Redis cache’s access keys. This operation requires write permission to the cache resource.

Parameters:
  • name – The name of the Redis cache.
  • resource_group – The name of the resource group.
  • key_type – The Redis access key to regenerate. Possible values include: ‘Primary’ and ‘Secondary’.

CLI Example:

azurerm.redis.operations.renegerate_key test_name test_rg test_type
idem_azurerm.exec.azurerm.redis.operations.update(hub, ctx, name, resource_group, sku=None, redis_configuration=None, enable_non_ssl_port=None, tenant_settings=None, shard_count=None, minimum_tls_version=None, **kwargs)

New in version 2.0.0.

Update an existing Redis cache.

Parameters:
  • name – The name of the Redis cache.
  • resource_group – The name of the resource group.
  • sku

    A dictionary representing the SKU of the Redis cache to deploy. Required parameters include:

    • name: The type of Redis cache to deploy. Possible values include: ‘Basic’, ‘Standard’, and ‘Premium’.
    • family: The SKU family to use. Possible values include ‘C’ for Basic/Standard and ‘P’ for Premium.
    • capacity: The size of the Redis cache to deploy. Possible values include 0, 1, 2, 3, 4, 5, and 6 for the C (Basic/Standard) family and 1, 2, 3, and 4 for the P (Premium) family.
  • redis_configuration – A dictionary of string key-value pairs that represent all Redis Settings. Some possible keys include: rdb-backup-enabled, rdb-storage-connection-string, rdb-backup-frequency, maxmemory-delta, maxmemory-policy, notify-keyspace-events, maxmemory-samples, slowlog-log-slower-than, slowlog-max-len, list-max-ziplist-entries, list-max-ziplist-value, hash-max-ziplist-entries, hash-max-ziplist-value, set-max-intset-entries, zset-max-ziplist-entries, zset-max-ziplist-value, and more.
  • enable_non_ssl_port – Specifies whether the non-ssl Redis server port (6379) is enabled. Defaults to False.
  • tenant_settings – A dictionary of tenant settings.
  • shard_count – The number of shards to be created on a Premium Cluster Cache.
  • minimum_tls_version – The specified TLS version (or higher) that clients are required to use. Possible values include: ‘1.0’, ‘1.1’, and ‘1.2’.

CLI Example:

azurerm.redis.operations.update test_name test_rg test_location test_sku