Twins - DigitalTwins ListRelationships
從數位對應項擷取關聯性。 狀態碼:
- 200 確定
- 400 不正確的要求
- InvalidArgument - 數位對應項識別碼無效。
- 404 找不到
- DigitalTwinNotFound - 找不到數位對應項。
GET https://digitaltwins-hostname/digitaltwins/{id}/relationships?api-version=2023-10-31
GET https://digitaltwins-hostname/digitaltwins/{id}/relationships?relationshipName={relationshipName}&api-version=2023-10-31
URI 參數
名稱 | 位於 | 必要 | 類型 | Description |
---|---|---|---|---|
id
|
path | True |
string |
數位對應項的識別碼。 識別碼在服務內是唯一的,且區分大小寫。 |
api-version
|
query | True |
string |
要求的 API 版本。 |
relationship
|
query |
string |
關聯性的名稱。 |
要求標頭
名稱 | 必要 | 類型 | Description |
---|---|---|---|
traceparent |
string |
識別分散式追蹤系統中的要求。 |
|
tracestate |
string |
提供廠商特定的追蹤識別資訊,而且是追蹤親和的隨附專案。 |
回應
名稱 | 類型 | Description |
---|---|---|
200 OK |
Success |
|
Other Status Codes |
預設回應。 Headers x-ms-error-code: string |
安全性
oauth2
Type:
oauth2
Flow:
implicit
Authorization URL:
https://login.microsoftonline.com/common/oauth2/authorize?resource=0b07f429-9f4b-4714-9392-cc5e8e80c8b0
範例
List relationships |
List relationships by name |
List relationships
Sample Request
GET https://digitaltwins-hostname/digitaltwins/mySourceTwin/relationships?api-version=2023-10-31
Sample Response
{
"value": [
{
"$sourceId": "mySourceTwin",
"$relationshipId": "firstRelationshipId",
"$targetId": "targetTwinId",
"$relationshipName": "myRelationship",
"$etag": "W/\"1553dbf5-0052-4be8-bea8-46269075b503\"",
"property": "value"
},
{
"$sourceId": "mySourceTwin",
"$relationshipId": "secondRelationshipId",
"$targetId": "targetTwinId",
"$relationshipName": "myRelationship",
"$etag": "W/\"2552a0a7-0666-4d5e-a67f-ece5b9b81fe0\"",
"property": "value"
}
],
"nextLink": "url-to-next-page"
}
List relationships by name
Sample Request
GET https://digitaltwins-hostname/digitaltwins/mySourceTwin/relationships?relationshipName=myRelationship&api-version=2023-10-31
Sample Response
{
"value": [
{
"$sourceId": "mySourceTwin",
"$relationshipId": "firstRelationshipId",
"$targetId": "targetTwinId",
"$relationshipName": "myRelationship",
"$etag": "W/\"1553dbf5-0052-4be8-bea8-46269075b503\"",
"property": "value"
},
{
"$sourceId": "mySourceTwin",
"$relationshipId": "secondRelationshipId",
"$targetId": "targetTwinId",
"$relationshipName": "myRelationship",
"$etag": "W/\"2552a0a7-0666-4d5e-a67f-ece5b9b81fe0\"",
"property": "value"
}
],
"nextLink": "url-to-next-page"
}
定義
名稱 | Description |
---|---|
Error |
錯誤定義。 |
Error |
錯誤回應。 |
Inner |
比包含的錯誤所提供的更具體錯誤描述。 |
Relationship |
將數位對應項關聯在一起的關聯性集合。 |
Error
錯誤定義。
名稱 | 類型 | Description |
---|---|---|
code |
string |
服務特定的錯誤碼,可作為 HTTP 錯誤碼的子狀態。 |
details |
Error[] |
內部錯誤詳細資料。 |
innererror |
物件,包含比目前物件有關錯誤的更特定資訊。 |
|
message |
string |
人類看得懂的錯誤標記法。 |
ErrorResponse
錯誤回應。
名稱 | 類型 | Description |
---|---|---|
error |
錯誤詳細資料。 |
InnerError
比包含的錯誤所提供的更具體錯誤描述。
名稱 | 類型 | Description |
---|---|---|
code |
string |
比包含的錯誤所提供的更具體錯誤碼。 |
innererror |
物件,包含比目前物件有關錯誤的更特定資訊。 |
RelationshipCollection
將數位對應項關聯在一起的關聯性集合。
名稱 | 類型 | Description |
---|---|---|
nextLink |
string |
要擷取下一頁物件的 URI。 |
value |
object[] |
關聯性物件。 |
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應