

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# GetPropertyValue
<a name="API_GetPropertyValue"></a>

获取组件、组件类型、实体或工作区的属性值。

您必须指定 `componentName`、`componentTypeId`、`entityId` 或 `workspaceId` 的值，但不能同时指定两者。

## 请求语法
<a name="API_GetPropertyValue_RequestSyntax"></a>

```
POST /workspaces/workspaceId/entity-properties/value HTTP/1.1
Content-type: application/json

{
   "componentName": "string",
   "componentPath": "string",
   "componentTypeId": "string",
   "entityId": "string",
   "maxResults": number,
   "nextToken": "string",
   "propertyGroupName": "string",
   "selectedProperties": [ "string" ],
   "tabularConditions": { 
      "orderBy": [ 
         { 
            "order": "string",
            "propertyName": "string"
         }
      ],
      "propertyFilters": [ 
         { 
            "operator": "string",
            "propertyName": "string",
            "value": { 
               "booleanValue": boolean,
               "doubleValue": number,
               "expression": "string",
               "integerValue": number,
               "listValue": [ 
                  "DataValue"
               ],
               "longValue": number,
               "mapValue": { 
                  "string" : "DataValue"
               },
               "relationshipValue": { 
                  "targetComponentName": "string",
                  "targetEntityId": "string"
               },
               "stringValue": "string"
            }
         }
      ]
   }
}
```

## URI 请求参数
<a name="API_GetPropertyValue_RequestParameters"></a>

请求使用以下 URI 参数。

 ** [workspaceId](#API_GetPropertyValue_RequestSyntax) **   <a name="tm-GetPropertyValue-request-uri-workspaceId"></a>
操作返回其值的工作区的 ID。  
长度限制：最小长度为 1。最大长度为 128。  
模式：`[a-zA-Z_0-9][a-zA-Z_\-0-9]*[a-zA-Z0-9]+`  
必需：是

## 请求体
<a name="API_GetPropertyValue_RequestBody"></a>

请求接受采用 JSON 格式的以下数据。

 ** [componentName](#API_GetPropertyValue_RequestSyntax) **   <a name="tm-GetPropertyValue-request-componentName"></a>
操作返回其属性值的组件名称。  
类型：字符串  
长度限制：最小长度为 1。最大长度为 256。  
模式：`[a-zA-Z_\-0-9]+`  
必需：否

 ** [componentPath](#API_GetPropertyValue_RequestSyntax) **   <a name="tm-GetPropertyValue-request-componentPath"></a>
此字符串指定从顶层组件开始的复合组件路径。  
类型：字符串  
长度限制：最小长度为 1。最大长度为 2048。  
模式：`[a-zA-Z_\-0-9/]+`  
必需：否

 ** [componentTypeId](#API_GetPropertyValue_RequestSyntax) **   <a name="tm-GetPropertyValue-request-componentTypeId"></a>
操作返回其属性值的组件类型的 ID。  
类型：字符串  
长度限制：最小长度为 1。最大长度为 256。  
模式：`[a-zA-Z_\.\-0-9:]+`  
必需：否

 ** [entityId](#API_GetPropertyValue_RequestSyntax) **   <a name="tm-GetPropertyValue-request-entityId"></a>
操作返回其属性值的实体的 ID。  
类型：字符串  
长度限制：最小长度为 1。最大长度为 128。  
模式：`[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}|^[a-zA-Z0-9][a-zA-Z_\-0-9.:]*[a-zA-Z0-9]+`  
必需：否

 ** [maxResults](#API_GetPropertyValue_RequestSyntax) **   <a name="tm-GetPropertyValue-request-maxResults"></a>
一次性返回的最大结果数。默认值为 25。  
有效范围：最小值为 1。最大值为 250。  
类型：整数  
有效范围：最小值为 0。最大值为 200。  
必需：否

 ** [nextToken](#API_GetPropertyValue_RequestSyntax) **   <a name="tm-GetPropertyValue-request-nextToken"></a>
指定下一页结果的字符串。  
类型：字符串  
长度限制：最小长度为 0。最大长度为 17880。  
模式：`.*`  
必需：否

 ** [propertyGroupName](#API_GetPropertyValue_RequestSyntax) **   <a name="tm-GetPropertyValue-request-propertyGroupName"></a>
属性组名称。  
类型：字符串  
长度限制：最小长度为 1。最大长度为 256。  
模式：`[a-zA-Z_\-0-9]+`  
必需：否

 ** [selectedProperties](#API_GetPropertyValue_RequestSyntax) **   <a name="tm-GetPropertyValue-request-selectedProperties"></a>
操作返回其值的属性。  
类型：字符串数组  
数组成员：最少 1 个物品。最多 10 项。  
长度限制：最小长度为 1。最大长度为 256。  
模式：`.*`  
是否必需：是

 ** [tabularConditions](#API_GetPropertyValue_RequestSyntax) **   <a name="tm-GetPropertyValue-request-tabularConditions"></a>
表格条件。  
类型：[TabularConditions](API_TabularConditions.md) 对象  
必需：否

## 响应语法
<a name="API_GetPropertyValue_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "nextToken": "string",
   "propertyValues": { 
      "string" : { 
         "propertyReference": { 
            "componentName": "string",
            "componentPath": "string",
            "entityId": "string",
            "externalIdProperty": { 
               "string" : "string" 
            },
            "propertyName": "string"
         },
         "propertyValue": { 
            "booleanValue": boolean,
            "doubleValue": number,
            "expression": "string",
            "integerValue": number,
            "listValue": [ 
               "DataValue"
            ],
            "longValue": number,
            "mapValue": { 
               "string" : "DataValue"
            },
            "relationshipValue": { 
               "targetComponentName": "string",
               "targetEntityId": "string"
            },
            "stringValue": "string"
         }
      }
   },
   "tabularPropertyValues": [ 
      [ 
         { 
            "string" : { 
               "booleanValue": boolean,
               "doubleValue": number,
               "expression": "string",
               "integerValue": number,
               "listValue": [ 
                  "DataValue"
               ],
               "longValue": number,
               "mapValue": { 
                  "string" : "DataValue"
               },
               "relationshipValue": { 
                  "targetComponentName": "string",
                  "targetEntityId": "string"
               },
               "stringValue": "string"
            }
         }
      ]
   ]
}
```

## 响应元素
<a name="API_GetPropertyValue_ResponseElements"></a>

如果此操作成功，则该服务将会发送回 HTTP 200 响应。

服务以 JSON 格式返回以下数据。

 ** [nextToken](#API_GetPropertyValue_ResponseSyntax) **   <a name="tm-GetPropertyValue-response-nextToken"></a>
指定下一页结果的字符串。  
类型：字符串  
长度限制：最小长度为 0。最大长度为 17880。  
模式：`.*`

 ** [propertyValues](#API_GetPropertyValue_ResponseSyntax) **   <a name="tm-GetPropertyValue-response-propertyValues"></a>
将字符串映射到响应中的属性和最新属性值的对象。映射中的每个字符串对于该对象都必须是唯一的。  
类型：字符串到 [PropertyLatestValue](API_PropertyLatestValue.md) 对象的映射  
密钥长度限制：最小长度为 1。最大长度为 256。  
键模式：`[a-zA-Z_\-0-9]+`

 ** [tabularPropertyValues](#API_GetPropertyValue_ResponseSyntax) **   <a name="tm-GetPropertyValue-response-tabularPropertyValues"></a>
属性值表。  
类型：从字符串到 [DataValue](API_DataValue.md) 对象映射的由数组组成的数组。  
密钥长度限制：最小长度为 1。最大长度为 256。  
键模式：`[a-zA-Z_\-0-9]+`

## 错误
<a name="API_GetPropertyValue_Errors"></a>

有关所有操作的常见错误的信息，请参阅[常见错误类型](CommonErrors.md)。

 ** AccessDeniedException **   
访问被拒绝。  
HTTP 状态代码：403

 ** ConnectorFailureException **   
连接器发生故障。  
HTTP 状态代码：424

 ** ConnectorTimeoutException **   
连接器超时。  
HTTP 状态代码：424

 ** InternalServerException **   
出现意外错误。  
HTTP 状态代码：500

 ** ResourceNotFoundException **   
未找到资源。  
HTTP 状态代码：404

 ** ThrottlingException **   
速率超过限制。  
HTTP 状态代码：429

 ** ValidationException **   
失败  
HTTP 状态代码：400

## 另请参阅
<a name="API_GetPropertyValue_SeeAlso"></a>

有关以特定语言之一使用此 API 的更多信息 AWS SDKs，请参阅以下内容：
+  [AWS 命令行界面 V2](https://docs.aws.amazon.com/goto/cli2/iottwinmaker-2021-11-29/GetPropertyValue) 
+  [AWS 适用于.NET 的 SDK V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/iottwinmaker-2021-11-29/GetPropertyValue) 
+  [AWS 适用于 C\$1\$1 的 SDK](https://docs.aws.amazon.com/goto/SdkForCpp/iottwinmaker-2021-11-29/GetPropertyValue) 
+  [AWS 适用于 Go v2 的 SDK](https://docs.aws.amazon.com/goto/SdkForGoV2/iottwinmaker-2021-11-29/GetPropertyValue) 
+  [AWS 适用于 Java 的 SDK V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/iottwinmaker-2021-11-29/GetPropertyValue) 
+  [AWS JavaScript V3 版 SDK](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/iottwinmaker-2021-11-29/GetPropertyValue) 
+  [AWS 适用于 Kotlin 的 SDK](https://docs.aws.amazon.com/goto/SdkForKotlin/iottwinmaker-2021-11-29/GetPropertyValue) 
+  [AWS 适用于 PHP 的 SDK V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/iottwinmaker-2021-11-29/GetPropertyValue) 
+  [AWS Python 软件开发工具包](https://docs.aws.amazon.com/goto/boto3/iottwinmaker-2021-11-29/GetPropertyValue) 
+  [AWS 适用于 Ruby V3 的 SDK](https://docs.aws.amazon.com/goto/SdkForRubyV3/iottwinmaker-2021-11-29/GetPropertyValue) 