2016-03-01 36 views
0

我正在嘗試使用C#中的AWS DeviceFarm sdk爲項目創建設備池。我用下面的命令:AWS Device Farm CreateDevicePool內部錯誤

var createDevicePoolResponse = client.CreateDevicePool (new CreateDevicePoolRequest { 
      Name = "CustomDevicePool", 
      ProjectArn = projectArn, 
      Rules = new List<Rule> { 
       new Rule { 
        Attribute = DeviceAttribute.ARN, 
        Operator = RuleOperator.EQUALS_TO, 
        Value = "arn:aws:devicefarm:us-west-2::device:577DC08D6B964346B86610CFF090CD59" 
       } 
      } 
     }); 

它認爲一分鐘左右,然後我收到以下異常:

與錯誤代碼InternalFailure和HTTP狀態代碼 InternalServerError

錯誤做出請求。 服務沒有返回錯誤信息。

ProjectArn有效。我也嘗試過不同的規則,每次都得到相同的錯誤。

回答

0

想通了。值需要用方括號包圍,如

var createDevicePoolResponse = client.CreateDevicePool (new CreateDevicePoolRequest { 
       Name = "CustomDevicePool", 
       ProjectArn = projectArn, 
       Rules = new List<Rule> { 
        new Rule { 
         Attribute = DeviceAttribute.ARN, 
         Operator = RuleOperator.IN, 
         Value = "[\"arn:aws:devicefarm:us-west-2::device:D45C750161314335924CE0B9B7D2558E\"]" 
        } 
       } 
      }); 
相關問題