Idiomatic PHP client for Google Cloud IoT Core.
NOTE: This repository is part of Google Cloud PHP. Any support requests, bug reports, or development contributions should be directed to that project.
A fully managed service for securely connecting and managing IoT devices, from a few to millions. Ingest data from connected devices and build rich applications that integrate with the other big data services of Google Cloud Platform.
To begin, install the preferred dependency manager for PHP, Composer.
Now to install just this component:
$ composer require google/cloud-iotOr to install the entire suite of components at once:
$ composer require google/cloudPlease see our Authentication guide for more information on authenticating your client. Once authenticated, you'll be ready to start making requests.
require 'vendor/autoload.php';
use Google\Cloud\Iot\V1\DeviceManagerClient;
$deviceManager = new DeviceManagerClient();
$projectId = '[MY_PROJECT_ID]';
$location = 'us-central1';
$registryId = '[MY_REGISTRY_ID]';
$registryName = $deviceManager->registryName($projectId, $location, $registryId);
$devices = $deviceManager->listDevices($registryName);
foreach ($devices->iterateAllElements() as $device) {
printf('Device: %s : %s' . PHP_EOL,
$device->getNumId(),
$device->getId()
);
}This component is considered alpha. As such, it is still a work-in-progress and is more likely to get backwards-incompatible updates.
- Understand the official documentation.
- Take a look at in-depth usage samples.