无法使用流量管理器配置文件添加流量管理器端点

时间:2019-09-30 11:54:09

标签: ruby azure-sdk-ruby

我正在尝试通过Traffic Manager Profile添加一个Traffic Manager Endpoint和一个azure-sdk-for-ruby

但是,SDK为TM概要文件创建的主体不包含创建TM端点所需的几个属性(名称,类型)。没有这些属性,SDK将失败并显示以下错误

"body": "{\"code\":\"BadRequest\",\"message\":\"Endpoint name '' is invalid. 
Endpoint names cannot be empty or all whitespace, and must be up to 260 alphanumeric characters long. 
The type '<null>' specified for endpoint '<null>' is invalid. Valid endpoint types are: 
'Microsoft.Network\\/trafficManagerProfiles\\/azureEndpoints', 
'Microsoft.Network\\/trafficManagerProfiles\\/externalEndpoints', 
'Microsoft.Network\\/trafficManagerProfiles\\/nestedEndpoints'.\"}"

如果分别创建TM端点和TM配置文件(不带TM端点),则两种情况均成功通过。但是使用TM端点创建或更新TM配置文件总是会导致上述错误。

这是我发送到SDK的请求正文

<Azure::TrafficManager::Mgmt::V2018_04_01::Models::Profile:0x0055c26806f678 
@traffic_routing_method="Performance", @location="global", @profile_status="Enabled", @dns_config=#<Azure::TrafficManager::Mgmt::V2018_04_01::Models::DnsConfig:0x0055c26806f650 
@relative_name="testapplication", @ttl="30">, @monitor_config=#<Azure::TrafficManager::Mgmt::V2018_04_01::Models::MonitorConfig:0x0055c26806f628 
@path="/monitorpage.aspx", @protocol="http", @port="80">, @endpoints=[#<Azure::TrafficManager::Mgmt::V2018_04_01::Models::Endpoint:0x0055c26806f538 
@min_child_endpoints=nil, @target_resource_id=nil, @endpoint_location="eastus", @priority=5, 
@target="test-app.com", @weight=10, @name="endpoint1", 
@type="Microsoft.Network/trafficManagerProfiles/externalEndpoints">], @tags={:key1=>"value1", :key2=>"value2"}>

如您所见,我同时包含TM端点的nametype属性。

这是SDK向前发送的正文

"body": "{\"tags\":{\"key1\":\"value1\",\"key2\":\"value2\"},\"location\":\"global\",\"properties\":
{\"profileStatus\":\"Enabled\",\"trafficRoutingMethod\":\"Performance\",\"dnsConfig\":
{\"relativeName\":\"testapplication\",\"ttl\":\"30\"},\"monitorConfig\":
{\"protocol\":\"http\",\"port\":\"80\",\"path\":\"/monitorpage.aspx\"},\"endpoints\":[{\"properties\":
{\"target\":\"test-app.com\",\"weight\":10,\"priority\":5,\"endpointLocation\":\"eastus\"}}]}}"

SDK发送的正文不包含nametype属性。

要指出的一点是,name模型中的typeread_only属性都已设置为Endpoint,这可能意味着用户不能自己设置它们/她自己。但是在那种情况下,我无法理解在单独创建端点时如何设置相同的属性,而在使用配置文件创建时无法设置。

请让我知道我在想什么。使用TM配置文件创建TM端点的示例将是最有帮助的!

Azure SDK版本: 0.17.2

0 个答案:

没有答案
相关问题