다음을 통해 공유


DigitalTwinClient 클래스

자동 생성된 IotHub REST API를 기반으로 DigitalTwin 작업에 편리한 API를 제공하는 클래스입니다.

DigitalTwinClient에 대한 이니셜라이저입니다.

성공적으로 만든 후 클래스는 IoTHub로 인증되었으며 멤버 API를 호출하여 IoTHub와 통신할 준비가 되었습니다.

상속
builtins.object
DigitalTwinClient

생성자

DigitalTwinClient(connection_string=None, host=None, auth=None)

매개 변수

Name Description
connection_string
str

connection_str 인증을 사용하는 경우 IoTHub와의 연결을 인증하는 데 사용되는 IoTHub 연결 문자열입니다. 기본값: 없음

기본값: None
host
str

토큰 자격 증명 인증을 사용하는 경우 Azure 서비스 URL입니다. 기본값: 없음

기본값: None
auth
str

토큰 자격 증명 인증을 사용하는 경우 Azure 인증 개체입니다. 기본값: 없음

기본값: None

메서드

from_connection_string

DigitalTwinClient Service 클라이언트에 대한 Classmethod 이니셜라이저입니다. 연결 문자열에서 DigitalTwinClient 클래스를 만듭니다.

성공적으로 만든 후 클래스는 IoTHub로 인증되었으며 멤버 API를 호출하여 IoTHub와 통신할 준비가 되었습니다.

from_token_credential

DigitalTwinClient Service 클라이언트에 대한 Classmethod 이니셜라이저입니다. 호스트 이름 URL 및 Azure 토큰 자격 증명에서 DigitalTwinClient 클래스를 만듭니다.

성공적으로 만든 후 클래스는 IoTHub로 인증되었으며 멤버 API를 호출하여 IoTHub와 통신할 준비가 되었습니다.

get_digital_twin

지정된 디바이스의 디지털 트윈을 검색합니다. :p aram str digital_twin__id: 지정된 디바이스의 디지털 트윈 ID입니다.

invoke_command

특정 디바이스에서 명령을 호출하고 결과를 가져옵니다. :p aram str digital_twin__id: 지정된 디바이스의 디지털 트윈 ID입니다. :p aram str command_name: 명령의 이름입니다. :p aram str 페이로드: 명령의 인수입니다. :p connect_timeout_in_seconds: 디지털 트윈 명령이 답변을 기다리는 최대 시간 간격(초)입니다. :p response_timeout_in_seconds int: 디지털 트윈 명령이 응답을 기다리는 최대 시간 간격(초)입니다. 값은 5-300 이내여야 합니다.

invoke_component_command

특정 디바이스의 구성 요소에서 명령을 호출하고 결과를 가져옵니다. :p aram str digital_twin__id: 지정된 디바이스의 디지털 트윈 ID입니다. :p aram str component_path: 구성 요소의 이름입니다. :p aram str command_name: 명령의 이름입니다. :p aram str 페이로드: 명령의 인수입니다. :p connect_timeout_in_seconds: 디지털 트윈 명령이 답변을 기다리는 최대 시간 간격(초)입니다. :p response_timeout_in_seconds int: 디지털 트윈 명령이 응답을 기다리는 최대 시간 간격(초)입니다. 값은 5-300 이내여야 합니다. :type response_timeout_in_seconds: int

update_digital_twin

패치 개체를 사용하여 지정된 디바이스의 디지털 트윈 구성 요소를 업데이트합니다. :p aram str digital_twin__id: 지정된 디바이스의 디지털 트윈 ID입니다. :p aram list[object]: Digital Twin을 업데이트할 json-patch 개체입니다. :p aram str etag: 업데이트 작업에 사용할 etag(if_match) 값입니다.

from_connection_string

DigitalTwinClient Service 클라이언트에 대한 Classmethod 이니셜라이저입니다. 연결 문자열에서 DigitalTwinClient 클래스를 만듭니다.

성공적으로 만든 후 클래스는 IoTHub로 인증되었으며 멤버 API를 호출하여 IoTHub와 통신할 준비가 되었습니다.

from_connection_string(connection_string)

매개 변수

Name Description
connection_string
필수
str

IoTHub와의 연결을 인증하는 데 사용되는 IoTHub 연결 문자열입니다.

반환

형식 Description

from_token_credential

DigitalTwinClient Service 클라이언트에 대한 Classmethod 이니셜라이저입니다. 호스트 이름 URL 및 Azure 토큰 자격 증명에서 DigitalTwinClient 클래스를 만듭니다.

성공적으로 만든 후 클래스는 IoTHub로 인증되었으며 멤버 API를 호출하여 IoTHub와 통신할 준비가 되었습니다.

from_token_credential(url, token_credential)

매개 변수

Name Description
url
필수
str

Azure 서비스 URL(호스트 이름)입니다.

token_credential
필수
<xref:azure.core.TokenCredential>

Azure 토큰 자격 증명 개체

반환

형식 Description

get_digital_twin

지정된 디바이스의 디지털 트윈을 검색합니다. :p aram str digital_twin__id: 지정된 디바이스의 디지털 트윈 ID입니다.

get_digital_twin(digital_twin_id)

매개 변수

Name Description
digital_twin_id
필수

반환

형식 Description

Digital Twin을 포함하는 반환 개체입니다.

예외

형식 Description
<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

invoke_command

특정 디바이스에서 명령을 호출하고 결과를 가져옵니다. :p aram str digital_twin__id: 지정된 디바이스의 디지털 트윈 ID입니다. :p aram str command_name: 명령의 이름입니다. :p aram str 페이로드: 명령의 인수입니다. :p connect_timeout_in_seconds: 디지털 트윈 명령이 답변을 기다리는 최대 시간 간격(초)입니다. :p response_timeout_in_seconds int: 디지털 트윈 명령이 응답을 기다리는 최대 시간 간격(초)입니다. 값은 5-300 이내여야 합니다.

invoke_command(digital_twin_id, command_name, payload, connect_timeout_in_seconds=None, response_timeout_in_seconds=None)

매개 변수

Name Description
digital_twin_id
필수
command_name
필수
payload
필수
connect_timeout_in_seconds
기본값: None
response_timeout_in_seconds
기본값: None

반환

형식 Description

호출된 명령의 결과입니다.

예외

형식 Description
<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

invoke_component_command

특정 디바이스의 구성 요소에서 명령을 호출하고 결과를 가져옵니다. :p aram str digital_twin__id: 지정된 디바이스의 디지털 트윈 ID입니다. :p aram str component_path: 구성 요소의 이름입니다. :p aram str command_name: 명령의 이름입니다. :p aram str 페이로드: 명령의 인수입니다. :p connect_timeout_in_seconds: 디지털 트윈 명령이 답변을 기다리는 최대 시간 간격(초)입니다. :p response_timeout_in_seconds int: 디지털 트윈 명령이 응답을 기다리는 최대 시간 간격(초)입니다. 값은 5-300 이내여야 합니다. :type response_timeout_in_seconds: int

invoke_component_command(digital_twin_id, component_path, command_name, payload, connect_timeout_in_seconds=None, response_timeout_in_seconds=None)

매개 변수

Name Description
digital_twin_id
필수
component_path
필수
command_name
필수
payload
필수
connect_timeout_in_seconds
기본값: None
response_timeout_in_seconds
기본값: None

반환

형식 Description

호출된 명령의 결과입니다.

예외

형식 Description
<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>

update_digital_twin

패치 개체를 사용하여 지정된 디바이스의 디지털 트윈 구성 요소를 업데이트합니다. :p aram str digital_twin__id: 지정된 디바이스의 디지털 트윈 ID입니다. :p aram list[object]: Digital Twin을 업데이트할 json-patch 개체입니다. :p aram str etag: 업데이트 작업에 사용할 etag(if_match) 값입니다.

update_digital_twin(digital_twin_id, digital_twin_patch, etag=None)

매개 변수

Name Description
digital_twin_id
필수
digital_twin_patch
필수
etag
기본값: None

반환

형식 Description

업데이트된 Digital Twin을 포함하는 반환 개체입니다.

예외

형식 Description
<xref:if the HTTP response status is not in >[<xref:200>]<xref:.>