Cookie の設定を選択する

当社は、当社のサイトおよびサービスを提供するために必要な必須 Cookie および類似のツールを使用しています。当社は、パフォーマンス Cookie を使用して匿名の統計情報を収集することで、お客様が当社のサイトをどのように利用しているかを把握し、改善に役立てています。必須 Cookie は無効化できませんが、[カスタマイズ] または [拒否] をクリックしてパフォーマンス Cookie を拒否することはできます。

お客様が同意した場合、AWS および承認された第三者は、Cookie を使用して便利なサイト機能を提供したり、お客様の選択を記憶したり、関連する広告を含む関連コンテンツを表示したりします。すべての必須ではない Cookie を受け入れるか拒否するには、[受け入れる] または [拒否] をクリックしてください。より詳細な選択を行うには、[カスタマイズ] をクリックしてください。

または DescribeThingで を使用する AWS SDK CLI

フォーカスモード
または DescribeThingで を使用する AWS SDK CLI - AWS IoT Core

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

以下のコード例は、DescribeThing の使用方法を示しています。

C++
SDK C++ 用
注記

詳細については、「」を参照してください GitHub。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。

//! Describe an AWS IoT thing. /*! \param thingName: The name for the thing. \param clientConfiguration: AWS client configuration. \return bool: Function succeeded. */ bool AwsDoc::IoT::describeThing(const Aws::String &thingName, const Aws::Client::ClientConfiguration &clientConfiguration) { Aws::IoT::IoTClient iotClient(clientConfiguration); Aws::IoT::Model::DescribeThingRequest request; request.SetThingName(thingName); Aws::IoT::Model::DescribeThingOutcome outcome = iotClient.DescribeThing(request); if (outcome.IsSuccess()) { const Aws::IoT::Model::DescribeThingResult &result = outcome.GetResult(); std::cout << "Retrieved thing '" << result.GetThingName() << "'" << std::endl; std::cout << "thingArn: " << result.GetThingArn() << std::endl; std::cout << result.GetAttributes().size() << " attribute(s) retrieved" << std::endl; for (const auto &attribute: result.GetAttributes()) { std::cout << " attribute: " << attribute.first << "=" << attribute.second << std::endl; } } else { std::cerr << "Error describing thing " << thingName << ": " << outcome.GetError().GetMessage() << std::endl; } return outcome.IsSuccess(); }
  • API 詳細については、「 AWS SDK for C++ APIリファレンスDescribeThing」の「」を参照してください。

CLI
AWS CLI

モノに関する詳細情報を表示するには

次のdescribe-thing例では、 AWS アカウントの AWS IoT レジストリで定義されているモノ (デバイス) に関する情報を表示します。

aws iot describe-thing --thing-name "MyLightBulb"

出力:

{ "defaultClientId": "MyLightBulb", "thingName": "MyLightBulb", "thingId": "40da2e73-c6af-406e-b415-15acae538797", "thingArn": "arn:aws:iot:us-west-2:123456789012:thing/MyLightBulb", "thingTypeName": "LightBulb", "attributes": { "model": "123", "wattage": "75" }, "version": 1 }

詳細については、「AWS IoT ディベロッパーガイド」の「レジストリによるモノの管理方法」を参照してください。

  • API 詳細については、AWS CLI 「 コマンドリファレンスDescribeThing」の「」を参照してください。

Java
SDK for Java 2.x
注記

詳細については、「」を参照してください GitHub。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。

/** * Describes an IoT Thing asynchronously. * * @param thingName The name of the IoT Thing. * * This method initiates an asynchronous request to describe an IoT Thing. * If the request is successful, it prints the Thing details. * If an exception occurs, it prints the error message. */ private void describeThing(String thingName) { DescribeThingRequest thingRequest = DescribeThingRequest.builder() .thingName(thingName) .build(); CompletableFuture<DescribeThingResponse> future = getAsyncClient().describeThing(thingRequest); future.whenComplete((describeResponse, ex) -> { if (describeResponse != null) { System.out.println("Thing Details:"); System.out.println("Thing Name: " + describeResponse.thingName()); System.out.println("Thing ARN: " + describeResponse.thingArn()); } else { Throwable cause = ex != null ? ex.getCause() : null; if (cause instanceof IotException) { System.err.println(((IotException) cause).awsErrorDetails().errorMessage()); } else if (cause != null) { System.err.println("Unexpected error: " + cause.getMessage()); } else { System.err.println("Failed to describe Thing."); } } }); future.join(); }
  • API 詳細については、「 AWS SDK for Java 2.x APIリファレンスDescribeThing」の「」を参照してください。

Kotlin
SDK Kotlin 用の
注記

詳細については、「」を参照してください GitHub。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。

suspend fun describeThing(thingNameVal: String) { val thingRequest = DescribeThingRequest { thingName = thingNameVal } // Print Thing details. IotClient { region = "us-east-1" }.use { iotClient -> val describeResponse = iotClient.describeThing(thingRequest) println("Thing details:") println("Thing name: ${describeResponse.thingName}") println("Thing ARN: ${describeResponse.thingArn}") } }
  • API 詳細については、Kotlin リファレンスのDescribeThing「」の「」を参照してください。 AWS SDK API

SDK C++ 用
注記

詳細については、「」を参照してください GitHub。用例一覧を検索し、AWS コード例リポジトリでの設定と実行の方法を確認してください。

//! Describe an AWS IoT thing. /*! \param thingName: The name for the thing. \param clientConfiguration: AWS client configuration. \return bool: Function succeeded. */ bool AwsDoc::IoT::describeThing(const Aws::String &thingName, const Aws::Client::ClientConfiguration &clientConfiguration) { Aws::IoT::IoTClient iotClient(clientConfiguration); Aws::IoT::Model::DescribeThingRequest request; request.SetThingName(thingName); Aws::IoT::Model::DescribeThingOutcome outcome = iotClient.DescribeThing(request); if (outcome.IsSuccess()) { const Aws::IoT::Model::DescribeThingResult &result = outcome.GetResult(); std::cout << "Retrieved thing '" << result.GetThingName() << "'" << std::endl; std::cout << "thingArn: " << result.GetThingArn() << std::endl; std::cout << result.GetAttributes().size() << " attribute(s) retrieved" << std::endl; for (const auto &attribute: result.GetAttributes()) { std::cout << " attribute: " << attribute.first << "=" << attribute.second << std::endl; } } else { std::cerr << "Error describing thing " << thingName << ": " << outcome.GetError().GetMessage() << std::endl; } return outcome.IsSuccess(); }
  • API 詳細については、「 AWS SDK for C++ APIリファレンスDescribeThing」の「」を参照してください。

開発者ガイドとコード例の完全なリスト AWS SDKについては、「」を参照してくださいAWS IoT で を使用する AWS SDK。このトピックには、開始方法に関する情報と以前のSDKバージョンに関する詳細も含まれています。

プライバシーサイト規約Cookie の設定
© 2025, Amazon Web Services, Inc. or its affiliates.All rights reserved.