Skip to content

Commit c176259

Browse files
MECHANDRJuliehzl
authored andcommitted
Support ReplicasPerMaster property for Redis Cache creation (#11504)
* Add preview param --replicas-per-master to "az redis create" command. Update azure-mgmt-redis from 6.0.0 to 7.0.0rc1. * Excluding zonal-configuration from being updated * Updating redis version in setup.py
1 parent 3aee4f8 commit c176259

17 files changed

+1146
-1009
lines changed

src/azure-cli/HISTORY.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ Release History
140140

141141
**Redis**
142142

143+
* Add preview param `--replicas-per-master` to `az redis create` command
144+
* Update azure-mgmt-redis from 6.0.0 to 7.0.0rc1
143145
* Fix #2902: Avoid setting memory configs while updating Basic SKU cache
144146

145147
**Reservations**

src/azure-cli/azure/cli/command_modules/redis/_params.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ def load_arguments(self, _):
4141
c.argument('minimum_tls_version', help='Specifies the TLS version required by clients to connect to cache', arg_type=get_enum_type(TlsVersion))
4242
c.argument('vm_size', arg_type=get_enum_type(allowed_c_family_sizes + allowed_p_family_sizes), help='Size of Redis cache to deploy. Basic and Standard Cache sizes start with C. Premium Cache sizes start with P')
4343
c.argument('enable_non_ssl_port', action='store_true', help='If the value is true, then the non-ssl redis server port (6379) will be enabled.')
44+
c.argument('replicas_per_master', help='The number of replicas to be created per master.', is_preview=True)
4445

4546
with self.argument_context('redis firewall-rules list') as c:
4647
c.argument('cache_name', arg_type=cache_name, id_part=None)

src/azure-cli/azure/cli/command_modules/redis/custom.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ def cli_redis_update(cmd, instance, sku=None, vm_size=None):
4444
if 'maxmemory-delta' in instance.redis_configuration:
4545
instance.redis_configuration.pop('maxmemory-delta')
4646

47+
# Trim zonal-configuration
48+
if 'zonal-configuration' in instance.redis_configuration:
49+
instance.redis_configuration.pop('zonal-configuration')
50+
4751
# pylint: disable=too-many-function-args
4852
update_params = RedisUpdateParameters(
4953
redis_configuration=instance.redis_configuration,
@@ -61,7 +65,8 @@ def cli_redis_update(cmd, instance, sku=None, vm_size=None):
6165
def cli_redis_create(cmd, client,
6266
resource_group_name, name, location, sku, vm_size, tags=None,
6367
redis_configuration=None, enable_non_ssl_port=None, tenant_settings=None,
64-
shard_count=None, minimum_tls_version=None, subnet_id=None, static_ip=None, zones=None):
68+
shard_count=None, minimum_tls_version=None, subnet_id=None, static_ip=None,
69+
zones=None, replicas_per_master=None):
6570
# pylint:disable=line-too-long
6671
if ((sku.lower() in ['standard', 'basic'] and vm_size.lower() not in allowed_c_family_sizes) or (sku.lower() in ['premium'] and vm_size.lower() not in allowed_p_family_sizes)):
6772
raise wrong_vmsize_error
@@ -76,6 +81,7 @@ def cli_redis_create(cmd, client,
7681
location=location,
7782
redis_configuration=redis_configuration,
7883
enable_non_ssl_port=enable_non_ssl_port,
84+
replicas_per_master=replicas_per_master,
7985
tenant_settings=tenant_settings_in_json,
8086
shard_count=shard_count,
8187
minimum_tls_version=minimum_tls_version,

src/azure-cli/azure/cli/command_modules/redis/tests/latest/recordings/test_redis_cache_list_firewall_and_server_link_works.yaml

Lines changed: 184 additions & 152 deletions
Large diffs are not rendered by default.
Lines changed: 143 additions & 131 deletions
Original file line numberDiff line numberDiff line change
@@ -1,152 +1,164 @@
11
interactions:
2-
- request:
3-
body: '{"location": "westus", "tags": {"product": "azurecli", "cause": "automation",
4-
"date": "2019-02-05T23:29:36Z"}}'
5-
headers:
6-
Accept: [application/json]
7-
Accept-Encoding: ['gzip, deflate']
8-
CommandName: [group create]
9-
Connection: [keep-alive]
10-
Content-Length: ['110']
11-
Content-Type: [application/json; charset=utf-8]
12-
ParameterSetName: [--location --name --tag]
13-
User-Agent: [python/3.6.5 (Windows-10-10.0.17763-SP0) msrest/0.6.4 msrest_azure/0.4.34
14-
resourcemanagementclient/2.0.0 Azure-SDK-For-Python AZURECLI/2.0.58]
15-
accept-language: [en-US]
16-
method: PUT
17-
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_redis000001?api-version=2019-07-01
18-
response:
19-
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_redis000001","name":"cli_test_redis000001","location":"westus","tags":{"product":"azurecli","cause":"automation","date":"2019-02-05T23:29:36Z"},"properties":{"provisioningState":"Succeeded"}}'}
20-
headers:
21-
cache-control: [no-cache]
22-
content-length: ['384']
23-
content-type: [application/json; charset=utf-8]
24-
date: ['Tue, 05 Feb 2019 23:27:24 GMT']
25-
expires: ['-1']
26-
pragma: [no-cache]
27-
strict-transport-security: [max-age=31536000; includeSubDomains]
28-
x-content-type-options: [nosniff]
29-
x-ms-ratelimit-remaining-subscription-writes: ['1199']
30-
status: {code: 201, message: Created}
312
- request:
323
body: '{"properties": {"tenantSettings": {}, "sku": {"name": "Basic", "family":
334
"c", "capacity": 0}}, "location": "WestUS2"}'
345
headers:
35-
Accept: [application/json]
36-
Accept-Encoding: ['gzip, deflate']
37-
CommandName: [redis create]
38-
Connection: [keep-alive]
39-
Content-Length: ['117']
40-
Content-Type: [application/json; charset=utf-8]
41-
ParameterSetName: [-n -g -l --sku --vm-size]
42-
User-Agent: [python/3.6.5 (Windows-10-10.0.17763-SP0) msrest/0.6.4 msrest_azure/0.4.34
43-
azure-mgmt-redis/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.58]
44-
accept-language: [en-US]
6+
Accept:
7+
- application/json
8+
Accept-Encoding:
9+
- gzip, deflate
10+
CommandName:
11+
- redis create
12+
Connection:
13+
- keep-alive
14+
Content-Length:
15+
- '117'
16+
Content-Type:
17+
- application/json; charset=utf-8
18+
ParameterSetName:
19+
- -n -g -l --sku --vm-size
20+
User-Agent:
21+
- python/3.7.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2
22+
azure-mgmt-redis/7.0.0rc1 Azure-SDK-For-Python AZURECLI/2.0.77
23+
accept-language:
24+
- en-US
4525
method: PUT
46-
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_redis000001/providers/Microsoft.Cache/Redis/cliredis000002?api-version=2018-03-01
26+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_redis000001/providers/Microsoft.Cache/Redis/cliredis000002?api-version=2019-07-01
4727
response:
48-
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_redis000001/providers/Microsoft.Cache/Redis/cliredis000002","location":"West
49-
US 2","name":"cliredis000002","type":"Microsoft.Cache/Redis","tags":{},"properties":{"provisioningState":"Creating","redisVersion":"3.2.7","sku":{"name":"Basic","family":"C","capacity":0},"enableNonSslPort":false,"tenantSettings":{},"redisConfiguration":{"maxclients":"256","maxmemory-reserved":"2","maxfragmentationmemory-reserved":"12","maxmemory-delta":"2"},"accessKeys":{"primaryKey":"2fNwHK15DyZFfhwXEHNUOMnyznC6tDeRZZRZgOhL3kA=","secondaryKey":"0ViXQAVLO2E5sIGw27dfK38XjFC9nJSx9AfvE9PF3JE="},"hostName":"cliredis000002.redis.cache.windows.net","port":6379,"sslPort":6380,"linkedServers":[]}}'}
28+
body:
29+
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_redis000001/providers/Microsoft.Cache/Redis/cliredis000002","location":"West
30+
US 2","name":"cliredis000002","type":"Microsoft.Cache/Redis","tags":{},"properties":{"provisioningState":"Creating","redisVersion":"4.0.14","sku":{"name":"Basic","family":"C","capacity":0},"enableNonSslPort":false,"instances":[{"sslPort":15000}],"tenantSettings":{},"redisConfiguration":{"maxclients":"256","maxmemory-reserved":"2","maxfragmentationmemory-reserved":"12","maxmemory-delta":"2"},"accessKeys":{"primaryKey":"bAfdBk2P9pxmcvFhSlpcQfr7L9q8PlWCWRmzpLiNuAQ=","secondaryKey":"kMHshoE8hK21tCtPvZXXe7TJfHLcRR0QtfYsi16odiQ="},"hostName":"cliredis000002.redis.cache.windows.net","port":6379,"sslPort":6380,"linkedServers":[]}}'
5031
headers:
51-
cache-control: [no-cache]
52-
content-length: ['842']
53-
content-type: [application/json; charset=utf-8]
54-
date: ['Tue, 05 Feb 2019 23:27:26 GMT']
55-
expires: ['-1']
56-
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_redis000001/providers/Microsoft.Cache/redis/cliredis000002?api-version=2018-03-01']
57-
pragma: [no-cache]
58-
server: [Microsoft-HTTPAPI/2.0]
59-
strict-transport-security: [max-age=31536000; includeSubDomains]
60-
x-content-type-options: [nosniff]
61-
x-ms-ratelimit-remaining-subscription-writes: ['1199']
62-
x-rp-server-mvid: [742524e0-4536-4de4-8449-006b73714404]
63-
status: {code: 201, message: Created}
32+
cache-control:
33+
- no-cache
34+
content-length:
35+
- '875'
36+
content-type:
37+
- application/json; charset=utf-8
38+
date:
39+
- Fri, 06 Dec 2019 23:50:41 GMT
40+
expires:
41+
- '-1'
42+
location:
43+
- https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_redis000001/providers/Microsoft.Cache/redis/cliredis000002?api-version=2019-07-01
44+
pragma:
45+
- no-cache
46+
server:
47+
- Microsoft-HTTPAPI/2.0
48+
strict-transport-security:
49+
- max-age=31536000; includeSubDomains
50+
x-content-type-options:
51+
- nosniff
52+
x-ms-ratelimit-remaining-subscription-writes:
53+
- '1199'
54+
x-rp-server-mvid:
55+
- d4a16663-d537-49d1-8ba4-e2fdb635702d
56+
status:
57+
code: 201
58+
message: Created
6459
- request:
6560
body: null
6661
headers:
67-
Accept: [application/json]
68-
Accept-Encoding: ['gzip, deflate']
69-
CommandName: [redis create]
70-
Connection: [keep-alive]
71-
ParameterSetName: [-n -g -l --sku --vm-size]
72-
User-Agent: [python/3.6.5 (Windows-10-10.0.17763-SP0) msrest/0.6.4 msrest_azure/0.4.34
73-
azure-mgmt-redis/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.58]
62+
Accept:
63+
- application/json
64+
Accept-Encoding:
65+
- gzip, deflate
66+
CommandName:
67+
- redis create
68+
Connection:
69+
- keep-alive
70+
ParameterSetName:
71+
- -n -g -l --sku --vm-size
72+
User-Agent:
73+
- python/3.7.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2
74+
azure-mgmt-redis/7.0.0rc1 Azure-SDK-For-Python AZURECLI/2.0.77
7475
method: GET
75-
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_redis000001/providers/Microsoft.Cache/redis/cliredis000002?api-version=2018-03-01
76+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_redis000001/providers/Microsoft.Cache/redis/cliredis000002?api-version=2019-07-01
7677
response:
77-
body: {string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_redis000001/providers/Microsoft.Cache/Redis/cliredis000002","location":"West
78-
US 2","name":"cliredis000002","type":"Microsoft.Cache/Redis","tags":{},"properties":{"provisioningState":"Creating","redisVersion":"3.2.7","sku":{"name":"Basic","family":"C","capacity":0},"enableNonSslPort":false,"tenantSettings":{},"redisConfiguration":{"maxclients":"256","maxmemory-reserved":"2","maxfragmentationmemory-reserved":"12","maxmemory-delta":"2"},"accessKeys":null,"hostName":"cliredis000002.redis.cache.windows.net","port":6379,"sslPort":6380,"linkedServers":[]}}'}
78+
body:
79+
string: '{"id":"/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_redis000001/providers/Microsoft.Cache/Redis/cliredis000002","location":"West
80+
US 2","name":"cliredis000002","type":"Microsoft.Cache/Redis","tags":{},"properties":{"provisioningState":"Creating","redisVersion":"4.0.14","sku":{"name":"Basic","family":"C","capacity":0},"enableNonSslPort":false,"instances":[{"sslPort":15000}],"tenantSettings":{},"redisConfiguration":{"maxclients":"256","maxmemory-reserved":"2","maxfragmentationmemory-reserved":"12","maxmemory-delta":"2"},"accessKeys":null,"hostName":"cliredis000002.redis.cache.windows.net","port":6379,"sslPort":6380,"linkedServers":[]}}'
7981
headers:
80-
cache-control: [no-cache]
81-
content-length: ['723']
82-
content-type: [application/json; charset=utf-8]
83-
date: ['Tue, 05 Feb 2019 23:27:56 GMT']
84-
expires: ['-1']
85-
pragma: [no-cache]
86-
server: [Microsoft-HTTPAPI/2.0]
87-
strict-transport-security: [max-age=31536000; includeSubDomains]
88-
transfer-encoding: [chunked]
89-
vary: [Accept-Encoding]
90-
x-content-type-options: [nosniff]
91-
x-rp-server-mvid: [742524e0-4536-4de4-8449-006b73714404]
92-
status: {code: 200, message: OK}
82+
cache-control:
83+
- no-cache
84+
content-length:
85+
- '756'
86+
content-type:
87+
- application/json; charset=utf-8
88+
date:
89+
- Fri, 06 Dec 2019 23:51:11 GMT
90+
expires:
91+
- '-1'
92+
pragma:
93+
- no-cache
94+
server:
95+
- Microsoft-HTTPAPI/2.0
96+
strict-transport-security:
97+
- max-age=31536000; includeSubDomains
98+
transfer-encoding:
99+
- chunked
100+
vary:
101+
- Accept-Encoding
102+
x-content-type-options:
103+
- nosniff
104+
x-rp-server-mvid:
105+
- d4a16663-d537-49d1-8ba4-e2fdb635702d
106+
status:
107+
code: 200
108+
message: OK
93109
- request:
94110
body: null
95111
headers:
96-
Accept: [application/json]
97-
Accept-Encoding: ['gzip, deflate']
98-
CommandName: [redis list-keys]
99-
Connection: [keep-alive]
100-
Content-Length: ['0']
101-
ParameterSetName: [-n -g]
102-
User-Agent: [python/3.6.5 (Windows-10-10.0.17763-SP0) msrest/0.6.4 msrest_azure/0.4.34
103-
azure-mgmt-redis/6.0.0 Azure-SDK-For-Python AZURECLI/2.0.58]
104-
accept-language: [en-US]
112+
Accept:
113+
- application/json
114+
Accept-Encoding:
115+
- gzip, deflate
116+
CommandName:
117+
- redis list-keys
118+
Connection:
119+
- keep-alive
120+
Content-Length:
121+
- '0'
122+
ParameterSetName:
123+
- -n -g
124+
User-Agent:
125+
- python/3.7.1 (Windows-10-10.0.18362-SP0) msrest/0.6.10 msrest_azure/0.6.2
126+
azure-mgmt-redis/7.0.0rc1 Azure-SDK-For-Python AZURECLI/2.0.77
127+
accept-language:
128+
- en-US
105129
method: POST
106-
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_redis000001/providers/Microsoft.Cache/Redis/cliredis000002/listKeys?api-version=2018-03-01
107-
response:
108-
body: {string: '{"primaryKey":"2fNwHK15DyZFfhwXEHNUOMnyznC6tDeRZZRZgOhL3kA=","secondaryKey":"0ViXQAVLO2E5sIGw27dfK38XjFC9nJSx9AfvE9PF3JE="}'}
109-
headers:
110-
cache-control: [no-cache]
111-
content-length: ['123']
112-
content-type: [application/json; charset=utf-8]
113-
date: ['Tue, 05 Feb 2019 23:27:58 GMT']
114-
expires: ['-1']
115-
pragma: [no-cache]
116-
server: [Microsoft-HTTPAPI/2.0]
117-
strict-transport-security: [max-age=31536000; includeSubDomains]
118-
transfer-encoding: [chunked]
119-
vary: [Accept-Encoding]
120-
x-content-type-options: [nosniff]
121-
x-ms-ratelimit-remaining-subscription-writes: ['1199']
122-
x-rp-server-mvid: [742524e0-4536-4de4-8449-006b73714404]
123-
status: {code: 200, message: OK}
124-
- request:
125-
body: null
126-
headers:
127-
Accept: [application/json]
128-
Accept-Encoding: ['gzip, deflate']
129-
CommandName: [group delete]
130-
Connection: [keep-alive]
131-
Content-Length: ['0']
132-
Content-Type: [application/json; charset=utf-8]
133-
ParameterSetName: [--name --yes --no-wait]
134-
User-Agent: [python/3.6.5 (Windows-10-10.0.17763-SP0) msrest/0.6.4 msrest_azure/0.4.34
135-
resourcemanagementclient/2.0.0 Azure-SDK-For-Python AZURECLI/2.0.58]
136-
accept-language: [en-US]
137-
method: DELETE
138-
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourcegroups/cli_test_redis000001?api-version=2019-07-01
130+
uri: https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/cli_test_redis000001/providers/Microsoft.Cache/Redis/cliredis000002/listKeys?api-version=2019-07-01
139131
response:
140-
body: {string: ''}
132+
body:
133+
string: '{"primaryKey":"bAfdBk2P9pxmcvFhSlpcQfr7L9q8PlWCWRmzpLiNuAQ=","secondaryKey":"kMHshoE8hK21tCtPvZXXe7TJfHLcRR0QtfYsi16odiQ="}'
141134
headers:
142-
cache-control: [no-cache]
143-
content-length: ['0']
144-
date: ['Tue, 05 Feb 2019 23:27:58 GMT']
145-
expires: ['-1']
146-
location: ['https://management.azure.com/subscriptions/00000000-0000-0000-0000-000000000000/operationresults/eyJqb2JJZCI6IlJFU09VUkNFR1JPVVBERUxFVElPTkpPQi1DTEk6NUZURVNUOjVGUkVESVNOWlJGNzREWUFEVkpOSU9IWkhQUEVQM1RWSFY1QnwzNjIwOEZFNDY3MkFFNTlELVdFU1RVUyIsImpvYkxvY2F0aW9uIjoid2VzdHVzIn0?api-version=2019-07-01']
147-
pragma: [no-cache]
148-
strict-transport-security: [max-age=31536000; includeSubDomains]
149-
x-content-type-options: [nosniff]
150-
x-ms-ratelimit-remaining-subscription-deletes: ['14998']
151-
status: {code: 202, message: Accepted}
135+
cache-control:
136+
- no-cache
137+
content-length:
138+
- '123'
139+
content-type:
140+
- application/json; charset=utf-8
141+
date:
142+
- Fri, 06 Dec 2019 23:51:12 GMT
143+
expires:
144+
- '-1'
145+
pragma:
146+
- no-cache
147+
server:
148+
- Microsoft-HTTPAPI/2.0
149+
strict-transport-security:
150+
- max-age=31536000; includeSubDomains
151+
transfer-encoding:
152+
- chunked
153+
vary:
154+
- Accept-Encoding
155+
x-content-type-options:
156+
- nosniff
157+
x-ms-ratelimit-remaining-subscription-writes:
158+
- '1199'
159+
x-rp-server-mvid:
160+
- d4a16663-d537-49d1-8ba4-e2fdb635702d
161+
status:
162+
code: 200
163+
message: OK
152164
version: 1

0 commit comments

Comments
 (0)