我无法通过az cli为Traffic Manager配置文件设置预期的代码范围。
我得到一个错误:
Unable to build a model: Cannot deserialize as [MonitorConfigExpectedStatusCodeRangesItem] an object of type , DeserializationError: Cannot deserialize as [MonitorConfigExpectedStatusCodeRangesItem] an object of type
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 573, in body
data = deserializer._deserialize(data_type, data)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1260, in _deserialize
self._deserialize(local_type, value)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1260, in _deserialize
self._deserialize(local_type, value)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1269, in _deserialize
return self.deserialize_data(data, response)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1445, in deserialize_data
return self.deserialize_type[iter_type](data, data_type[1:-1])
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1474, in deserialize_iter
type(attr)
msrest.exceptions.DeserializationError: Cannot deserialize as [MonitorConfigExpectedStatusCodeRangesItem] an object of type
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/opt/az/lib/python3.6/site-packages/knack/cli.py", line 197, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 373, in execute
six.reraise(*sys.exc_info())
File "/opt/az/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 347, in execute
result = cmd(params)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/__init__.py", line 182, in __call__
return self.handler(*args, **kwargs)
File "/opt/az/lib/python3.6/site-packages/azure/cli/core/commands/arm.py", line 512, in handler
result = setter(**setterargs)
File "/opt/az/lib/python3.6/site-packages/azure/mgmt/trafficmanager/operations/profiles_operations.py", line 347, in create_or_update
body_content = self._serialize.body(parameters, 'Profile')
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 576, in body
SerializationError, "Unable to build a model: "+str(err), err)
File "/opt/az/lib/python3.6/site-packages/msrest/exceptions.py", line 54, in raise_with_traceback
raise error.with_traceback(exc_traceback)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 573, in body
data = deserializer._deserialize(data_type, data)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1260, in _deserialize
self._deserialize(local_type, value)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1260, in _deserialize
self._deserialize(local_type, value)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1269, in _deserialize
return self.deserialize_data(data, response)
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1445, in deserialize_data
return self.deserialize_type[iter_type](data, data_type[1:-1])
File "/opt/az/lib/python3.6/site-packages/msrest/serialization.py", line 1474, in deserialize_iter
type(attr)
msrest.exceptions.SerializationError: Unable to build a model: Cannot deserialize as [MonitorConfigExpectedStatusCodeRangesItem] an object of type , DeserializationError: Cannot deserialize as [MonitorConfigExpectedStatusCodeRangesItem] an object of type
我已经在Azure中设置了TrafficManager配置文件,现在我想用预期的状态代码范围更新该配置文件。在创建过程中无法设置此选项。
我使用的命令是:
az network traffic-manager profile update --resource-group RG20BRAM-DEV --name test --set monitorConfig.expectedStatusCodeRanges='200'
致以亲切的问候,
布拉姆