Documentation

Google_Service_CloudIot_Resource_ProjectsLocationsRegistriesDevices extends Google_Service_Resource
in package

The "devices" collection of methods.

Typical usage is: $cloudiotService = new Google_Service_CloudIot(...); $devices = $cloudiotService->devices;

Table of Contents

$client  : Google_Client
$methods  : array<string|int, mixed>
$resourceName  : string
$rootUrl  : string
$serviceName  : string
$servicePath  : string
$stackParameters  : mixed
__construct()  : mixed
call()  : Google_Http_Request|expectedClass
TODO: This function needs simplifying.
create()  : Google_Service_CloudIot_Device
Creates a device in a device registry. (devices.create)
createRequestUri()  : string
Parse/expand request parameters and create a fully qualified request uri.
delete()  : Google_Service_CloudIot_CloudiotEmpty
Deletes a device. (devices.delete)
get()  : Google_Service_CloudIot_Device
Gets details about a device. (devices.get)
listProjectsLocationsRegistriesDevices()  : Google_Service_CloudIot_ListDevicesResponse
List devices in a device registry.
modifyCloudToDeviceConfig()  : Google_Service_CloudIot_DeviceConfig
Modifies the configuration for the device, which is eventually sent from the Cloud IoT Core servers. Returns the modified configuration version and its metadata. (devices.modifyCloudToDeviceConfig)
patch()  : Google_Service_CloudIot_Device
Updates a device. (devices.patch)
sendCommandToDevice()  : Google_Service_CloudIot_SendCommandToDeviceResponse
Sends a command to the specified device. In order for a device to be able to receive commands, it must: 1) be connected to Cloud IoT Core using the MQTT protocol, and 2) be subscribed to the group of MQTT topics specified by /devices/{device-id}/commands/#. This subscription will receive commands at the top-level topic /devices/{device-id}/commands as well as commands for subfolders, like /devices/{device-id}/commands/subfolder. Note that subscribing to specific subfolders is not supported. If the command could not be delivered to the device, this method will return an error; in particular, if the device is not subscribed, this method will return FAILED_PRECONDITION.
convertToArrayAndStripNulls()  : mixed

Properties

$methods

private array<string|int, mixed> $methods

$resourceName

private string $resourceName

$serviceName

private string $serviceName

$servicePath

private string $servicePath

$stackParameters

private mixed $stackParameters = array('alt' => array('type' => 'string', 'location' => 'query'), 'fields' => array('type' => 'string', 'location' => 'query'), 'trace' => array('type' => 'string', 'location' => 'query'), 'userIp' => array('type' => 'string', 'location' => 'query'), 'quotaUser' => array('type' => 'string', 'location' => 'query'), 'data' => array('type' => 'string', 'location' => 'body'), 'mimeType' => array('type' => 'string', 'location' => 'header'), 'uploadType' => array('type' => 'string', 'location' => 'query'), 'mediaUpload' => array('type' => 'complex', 'location' => 'query'), 'prettyPrint' => array('type' => 'string', 'location' => 'query'))

Methods

__construct()

public __construct(mixed $service, mixed $serviceName, mixed $resourceName, mixed $resource) : mixed
Parameters
$service : mixed
$serviceName : mixed
$resourceName : mixed
$resource : mixed
Return values
mixed

call()

TODO: This function needs simplifying.

public call( $name,  $arguments[,  $expectedClass = null ]) : Google_Http_Request|expectedClass
Parameters
$name :
$arguments :
$expectedClass : = null
  • optional, the expected class name
Tags
throws
Google_Exception
Return values
Google_Http_Request|expectedClass

create()

Creates a device in a device registry. (devices.create)

public create(string $parent, Google_Service_CloudIot_Device $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudIot_Device
Parameters
$parent : string

Required. The name of the device registry where this device should be created. For example, projects/example-project/locations /us-central1/registries/my-registry.

$postBody : Google_Service_CloudIot_Device
$optParams : array<string|int, mixed> = array()

Optional parameters.

Return values
Google_Service_CloudIot_Device

createRequestUri()

Parse/expand request parameters and create a fully qualified request uri.

public createRequestUri(string $restPath, array<string|int, mixed> $params) : string
Parameters
$restPath : string
$params : array<string|int, mixed>
Tags
static
Return values
string

$requestUrl

delete()

Deletes a device. (devices.delete)

public delete(string $name[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudIot_CloudiotEmpty
Parameters
$name : string

Required. The name of the device. For example, projects/p0/locations/us-central1/registries/registry0/devices/device0 or projects/p0/locations/us-central1/registries/registry0/devices/{num_id}.

$optParams : array<string|int, mixed> = array()

Optional parameters.

Return values
Google_Service_CloudIot_CloudiotEmpty

get()

Gets details about a device. (devices.get)

public get(string $name[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudIot_Device
Parameters
$name : string

Required. The name of the device. For example, projects/p0/locations/us-central1/registries/registry0/devices/device0 or projects/p0/locations/us-central1/registries/registry0/devices/{num_id}.

$optParams : array<string|int, mixed> = array()

Optional parameters.

Tags
opt_param

string fieldMask The fields of the Device resource to be returned in the response. If the field mask is unset or empty, all fields are returned.

Return values
Google_Service_CloudIot_Device

listProjectsLocationsRegistriesDevices()

List devices in a device registry.

public listProjectsLocationsRegistriesDevices(string $parent[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudIot_ListDevicesResponse

(devices.listProjectsLocationsRegistriesDevices)

Parameters
$parent : string

Required. The device registry path. Required. For example, projects/my-project/locations/us-central1/registries/my-registry.

$optParams : array<string|int, mixed> = array()

Optional parameters.

Tags
opt_param

string deviceIds A list of device string IDs. For example, ['device0', 'device12']. If empty, this field is ignored. Maximum IDs: 10,000

opt_param

string gatewayListOptions.associationsGatewayId If set, only devices associated with the specified gateway are returned. The gateway ID can be numeric (num_id) or the user-defined string (id). For example, if 123 is specified, only devices bound to the gateway with num_id 123 are returned.

opt_param

string pageToken The value returned by the last ListDevicesResponse; indicates that this is a continuation of a prior ListDevices call and the system should return the next page of data.

opt_param

string gatewayListOptions.gatewayType If GATEWAY is specified, only gateways are returned. If NON_GATEWAY is specified, only non-gateway devices are returned. If GATEWAY_TYPE_UNSPECIFIED is specified, all devices are returned.

opt_param

int pageSize The maximum number of devices to return in the response. If this value is zero, the service will select a default size. A call may return fewer objects than requested. A non-empty next_page_token in the response indicates that more data is available.

opt_param

string fieldMask The fields of the Device resource to be returned in the response. The fields id and num_id are always returned, along with any other fields specified.

opt_param

string deviceNumIds A list of device numeric IDs. If empty, this field is ignored. Maximum IDs: 10,000.

opt_param

string gatewayListOptions.associationsDeviceId If set, returns only the gateways with which the specified device is associated. The device ID can be numeric (num_id) or the user-defined string (id). For example, if 456 is specified, returns only the gateways to which the device with num_id 456 is bound.

Return values
Google_Service_CloudIot_ListDevicesResponse

modifyCloudToDeviceConfig()

Modifies the configuration for the device, which is eventually sent from the Cloud IoT Core servers. Returns the modified configuration version and its metadata. (devices.modifyCloudToDeviceConfig)

public modifyCloudToDeviceConfig(string $name, Google_Service_CloudIot_ModifyCloudToDeviceConfigRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudIot_DeviceConfig
Parameters
$name : string

Required. The name of the device. For example, projects/p0/locations/us-central1/registries/registry0/devices/device0 or projects/p0/locations/us-central1/registries/registry0/devices/{num_id}.

$postBody : Google_Service_CloudIot_ModifyCloudToDeviceConfigRequest
$optParams : array<string|int, mixed> = array()

Optional parameters.

Return values
Google_Service_CloudIot_DeviceConfig

patch()

Updates a device. (devices.patch)

public patch(string $name, Google_Service_CloudIot_Device $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudIot_Device
Parameters
$name : string

The resource path name. For example, projects/p1/locations/us-central1/registries/registry0/devices/dev0 or projects/p1/locations/us-central1/registries/registry0/devices/{num_id}. When name is populated as a response from the service, it always ends in the device numeric ID.

$postBody : Google_Service_CloudIot_Device
$optParams : array<string|int, mixed> = array()

Optional parameters.

Tags
opt_param

string updateMask Required. Only updates the device fields indicated by this mask. The field mask must not be empty, and it must not contain fields that are immutable or only set by the server. Mutable top- level fields: credentials, blocked, and metadata

Return values
Google_Service_CloudIot_Device

sendCommandToDevice()

Sends a command to the specified device. In order for a device to be able to receive commands, it must: 1) be connected to Cloud IoT Core using the MQTT protocol, and 2) be subscribed to the group of MQTT topics specified by /devices/{device-id}/commands/#. This subscription will receive commands at the top-level topic /devices/{device-id}/commands as well as commands for subfolders, like /devices/{device-id}/commands/subfolder. Note that subscribing to specific subfolders is not supported. If the command could not be delivered to the device, this method will return an error; in particular, if the device is not subscribed, this method will return FAILED_PRECONDITION.

public sendCommandToDevice(string $name, Google_Service_CloudIot_SendCommandToDeviceRequest $postBody[, array<string|int, mixed> $optParams = array() ]) : Google_Service_CloudIot_SendCommandToDeviceResponse

Otherwise, this method will return OK. If the subscription is QoS 1, at least once delivery will be guaranteed; for QoS 0, no acknowledgment will be expected from the device. (devices.sendCommandToDevice)

Parameters
$name : string

Required. The name of the device. For example, projects/p0/locations/us-central1/registries/registry0/devices/device0 or projects/p0/locations/us-central1/registries/registry0/devices/{num_id}.

$postBody : Google_Service_CloudIot_SendCommandToDeviceRequest
$optParams : array<string|int, mixed> = array()

Optional parameters.

Return values
Google_Service_CloudIot_SendCommandToDeviceResponse

convertToArrayAndStripNulls()

protected convertToArrayAndStripNulls(mixed $o) : mixed
Parameters
$o : mixed
Return values
mixed

Search results