LoginSignup
1

More than 3 years have passed since last update.

AWS IoT CoreのShadowをPHPのSDKを用いて取得

Posted at

AWS IoT CoreのShadowはIotDataPlaneClientのGetThingShadow()で取得できます。

公式サイトには以下サンプルが記載されています。
https://docs.aws.amazon.com/ja_jp/aws-sdk-php/v3/api/api-data.iot-2015-05-28.html#getthingshadow

$result = $client->getThingShadow([
    'shadowName' => '<string>',
    'thingName'  => '<string>', // REQUIRED
]);

しかし、$clientのオブジェクトの生成方法が書いていない。。。

$clientのオブジェクト生成方法は以下です。

        $client = new IotDataPlaneClient(
            array(
                'version'  => 'latest',
                'region'   => 'ap-northeast-1',
                'endpoint' => 'https://xxxxxxxx-ats.iot.ap-northeast-1.amazonaws.com'
            )
        );

以上

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1