@@ -28,47 +28,15 @@ IOT API from PHP. These samples are best seen in the context of the
28
28
4 . ** Install dependencies** via [ Composer] ( http://getcomposer.org/doc/00-intro.md ) .
29
29
Run ` php composer.phar install ` (if composer is installed locally) or ` composer install `
30
30
(if composer is installed globally).
31
- 5 . Run ` php iot.php ` . The following commands are available:
32
-
33
- ```
34
- bind-device-to-gateway (Beta feature) Bind a device to a gateway.
35
- create-es-device Create a new device with the given id, using ES256 for authentication.
36
- create-gateway (Beta feature) Create a new gateway with the given id.
37
- create-registry Creates a registry and returns the result.
38
- create-rsa-device Create a new device with the given id, using RS256 for authentication.
39
- create-unauth-device Create a new device without authentication.
40
- delete-device Delete the device with the given id.
41
- delete-gateway (Beta feature) Delete the gateway with the given id.
42
- delete-registry Deletes the specified registry.
43
- get-device Retrieve the device with the given id.
44
- get-device-configs Lists versions of a device config in descending order (newest first).
45
- get-device-state Retrieve a device's state blobs.
46
- get-iam-policy Retrieves IAM permissions for the given registry.
47
- get-registry Retrieves a device registry.
48
- help Displays help for a command
49
- list Lists commands
50
- list-devices List all devices in the registry.
51
- list-devices-for-gateway List devices for the given gateway.
52
- list-gateways List gateways for the given registry.
53
- list-registries List all registries in the project.
54
- patch-es-device Patch device with ES256 public key.
55
- patch-rsa-device Patch device with RSA256 certificate.
56
- send-command-to-device Sends a command to a device.
57
- set-device-config Set a device's configuration.
58
- set-device-state Sets the state of a device.
59
- set-iam-policy Sets IAM permissions for the given registry to a single role/member.
60
- unbind-device-from-gateway (Beta feature) Unbind a device from a gateway.
61
-
62
- Example:
63
-
64
- ```
65
- $ php iot.php create-registry my-registry my-pubsub-topic
66
- Creating Registry
67
- Id: my-registry, Name: projects/my-project/locations/us-central1/registries/my-registry
68
- ```
31
+ 5 . To run the IOT Samples, run any of the files in ` src/ ` on the CLI. Run them without arguments to print usage instructions:
32
+ ```
33
+ $ php src/list_registries.php
69
34
35
+ Usage: list_registries.php $projectId [$location='us-central1']
70
36
71
- 6. Run `php iot.php COMMAND --help` to print information about the usage of each command.
37
+ @param string $projectId Google Cloud project ID
38
+ @param string $location (Optional) Google Cloud region
39
+ ```
72
40
73
41
## Contributing changes
74
42
0 commit comments