Package com.google.cloud.iot.v1 (2.23.0)

A client to Cloud IoT API

The interfaces provided are listed below, along with usage samples.

DeviceManagerClient

Service Description: Internet of Things (IoT) service. Securely connect and manage IoT devices.

Sample for DeviceManagerClient:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   DeviceRegistry deviceRegistry = DeviceRegistry.newBuilder().build();
   DeviceRegistry response = deviceManagerClient.createDeviceRegistry(parent, deviceRegistry);
 }
 

Classes

BindDeviceToGatewayRequest

Request for BindDeviceToGateway.

Protobuf type google.cloud.iot.v1.BindDeviceToGatewayRequest

BindDeviceToGatewayRequest.Builder

Request for BindDeviceToGateway.

Protobuf type google.cloud.iot.v1.BindDeviceToGatewayRequest

BindDeviceToGatewayResponse

Response for BindDeviceToGateway.

Protobuf type google.cloud.iot.v1.BindDeviceToGatewayResponse

BindDeviceToGatewayResponse.Builder

Response for BindDeviceToGateway.

Protobuf type google.cloud.iot.v1.BindDeviceToGatewayResponse

CreateDeviceRegistryRequest

Request for CreateDeviceRegistry.

Protobuf type google.cloud.iot.v1.CreateDeviceRegistryRequest

CreateDeviceRegistryRequest.Builder

Request for CreateDeviceRegistry.

Protobuf type google.cloud.iot.v1.CreateDeviceRegistryRequest

CreateDeviceRequest

Request for CreateDevice.

Protobuf type google.cloud.iot.v1.CreateDeviceRequest

CreateDeviceRequest.Builder

Request for CreateDevice.

Protobuf type google.cloud.iot.v1.CreateDeviceRequest

DeleteDeviceRegistryRequest

Request for DeleteDeviceRegistry.

Protobuf type google.cloud.iot.v1.DeleteDeviceRegistryRequest

DeleteDeviceRegistryRequest.Builder

Request for DeleteDeviceRegistry.

Protobuf type google.cloud.iot.v1.DeleteDeviceRegistryRequest

DeleteDeviceRequest

Request for DeleteDevice.

Protobuf type google.cloud.iot.v1.DeleteDeviceRequest

DeleteDeviceRequest.Builder

Request for DeleteDevice.

Protobuf type google.cloud.iot.v1.DeleteDeviceRequest

Device

The device resource.

Protobuf type google.cloud.iot.v1.Device

Device.Builder

The device resource.

Protobuf type google.cloud.iot.v1.Device

DeviceConfig

The device configuration. Eventually delivered to devices.

Protobuf type google.cloud.iot.v1.DeviceConfig

DeviceConfig.Builder

The device configuration. Eventually delivered to devices.

Protobuf type google.cloud.iot.v1.DeviceConfig

DeviceCredential

A server-stored device credential used for authentication.

Protobuf type google.cloud.iot.v1.DeviceCredential

DeviceCredential.Builder

A server-stored device credential used for authentication.

Protobuf type google.cloud.iot.v1.DeviceCredential

DeviceManagerClient

Service Description: Internet of Things (IoT) service. Securely connect and manage IoT devices.

This class provides the ability to make remote calls to the backing service through method calls that map to API methods. Sample code to get started:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 try (DeviceManagerClient deviceManagerClient = DeviceManagerClient.create()) {
   LocationName parent = LocationName.of("[PROJECT]", "[LOCATION]");
   DeviceRegistry deviceRegistry = DeviceRegistry.newBuilder().build();
   DeviceRegistry response = deviceManagerClient.createDeviceRegistry(parent, deviceRegistry);
 }
 

Note: close() needs to be called on the DeviceManagerClient object to clean up resources such as threads. In the example above, try-with-resources is used, which automatically calls close().

The surface of this class includes several types of Java methods for each of the API's methods:

  1. A "flattened" method. With this type of method, the fields of the request type have been converted into function parameters. It may be the case that not all fields are available as parameters, and not every API method will have a flattened method entry point.
  2. A "request object" method. This type of method only takes one parameter, a request object, which must be constructed before the call. Not every API method will have a request object method.
  3. A "callable" method. This type of method takes no parameters and returns an immutable API callable object, which can be used to initiate calls to the service.

See the individual methods for example code.

Many parameters require resource names to be formatted in a particular way. To assist with these names, this class includes a format method for each type of name, and additionally a parse method to extract the individual identifiers contained within names that are returned.

This class can be customized by passing in a custom instance of DeviceManagerSettings to create(). For example:

To customize credentials:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 DeviceManagerSettings deviceManagerSettings =
     DeviceManagerSettings.newBuilder()
         .setCredentialsProvider(FixedCredentialsProvider.create(myCredentials))
         .build();
 DeviceManagerClient deviceManagerClient = DeviceManagerClient.create(deviceManagerSettings);
 

To customize the endpoint:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 DeviceManagerSettings deviceManagerSettings =
     DeviceManagerSettings.newBuilder().setEndpoint(myEndpoint).build();
 DeviceManagerClient deviceManagerClient = DeviceManagerClient.create(deviceManagerSettings);
 

To use REST (HTTP1.1/JSON) transport (instead of gRPC) for sending and receiving requests over the wire:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 DeviceManagerSettings deviceManagerSettings =
     DeviceManagerSettings.newHttpJsonBuilder().build();
 DeviceManagerClient deviceManagerClient = DeviceManagerClient.create(deviceManagerSettings);
 

Please refer to the GitHub repository's samples for more quickstart code snippets.

DeviceManagerClient.ListDeviceRegistriesFixedSizeCollection

DeviceManagerClient.ListDeviceRegistriesPage

DeviceManagerClient.ListDeviceRegistriesPagedResponse

DeviceManagerClient.ListDevicesFixedSizeCollection

DeviceManagerClient.ListDevicesPage

DeviceManagerClient.ListDevicesPagedResponse

DeviceManagerGrpc

Internet of Things (IoT) service. Securely connect and manage IoT devices.

DeviceManagerGrpc.DeviceManagerBlockingStub

A stub to allow clients to do synchronous rpc calls to service DeviceManager.

Internet of Things (IoT) service. Securely connect and manage IoT devices.

DeviceManagerGrpc.DeviceManagerFutureStub

A stub to allow clients to do ListenableFuture-style rpc calls to service DeviceManager.

Internet of Things (IoT) service. Securely connect and manage IoT devices.

DeviceManagerGrpc.DeviceManagerImplBase

Base class for the server implementation of the service DeviceManager.

Internet of Things (IoT) service. Securely connect and manage IoT devices.

DeviceManagerGrpc.DeviceManagerStub

A stub to allow clients to do asynchronous rpc calls to service DeviceManager.

Internet of Things (IoT) service. Securely connect and manage IoT devices.

DeviceManagerProto

DeviceManagerSettings

Settings class to configure an instance of DeviceManagerClient.

The default instance has everything set to sensible defaults:

  • The default service address (cloudiot.googleapis.com) and default port (443) are used.
  • Credentials are acquired automatically through Application Default Credentials.
  • Retries are configured for idempotent methods but not for non-idempotent methods.

The builder of this class is recursive, so contained classes are themselves builders. When build() is called, the tree of builders is called to create the complete settings object.

For example, to set the total timeout of createDeviceRegistry to 30 seconds:


 // This snippet has been automatically generated and should be regarded as a code template only.
 // It will require modifications to work:
 // - It may require correct/in-range values for request initialization.
 // - It may require specifying regional endpoints when creating the service client as shown in
 // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
 DeviceManagerSettings.Builder deviceManagerSettingsBuilder = DeviceManagerSettings.newBuilder();
 deviceManagerSettingsBuilder
     .createDeviceRegistrySettings()
     .setRetrySettings(
         deviceManagerSettingsBuilder
             .createDeviceRegistrySettings()
             .getRetrySettings()
             .toBuilder()
             .setTotalTimeout(Duration.ofSeconds(30))
             .build());
 DeviceManagerSettings deviceManagerSettings = deviceManagerSettingsBuilder.build();
 

DeviceManagerSettings.Builder

Builder for DeviceManagerSettings.

DeviceName

DeviceName.Builder

Builder for projects/{project}/locations/{location}/registries/{registry}/devices/{device}.

DeviceRegistry

A container for a group of devices.

Protobuf type google.cloud.iot.v1.DeviceRegistry

DeviceRegistry.Builder

A container for a group of devices.

Protobuf type google.cloud.iot.v1.DeviceRegistry

DeviceState

The device state, as reported by the device.

Protobuf type google.cloud.iot.v1.DeviceState

DeviceState.Builder

The device state, as reported by the device.

Protobuf type google.cloud.iot.v1.DeviceState

EventNotificationConfig

The configuration for forwarding telemetry events.

Protobuf type google.cloud.iot.v1.EventNotificationConfig

EventNotificationConfig.Builder

The configuration for forwarding telemetry events.

Protobuf type google.cloud.iot.v1.EventNotificationConfig

GatewayConfig

Gateway-related configuration and state.

Protobuf type google.cloud.iot.v1.GatewayConfig

GatewayConfig.Builder

Gateway-related configuration and state.

Protobuf type google.cloud.iot.v1.GatewayConfig

GatewayListOptions

Options for limiting the list based on gateway type and associations.

Protobuf type google.cloud.iot.v1.GatewayListOptions

GatewayListOptions.Builder

Options for limiting the list based on gateway type and associations.

Protobuf type google.cloud.iot.v1.GatewayListOptions

GetDeviceRegistryRequest

Request for GetDeviceRegistry.

Protobuf type google.cloud.iot.v1.GetDeviceRegistryRequest

GetDeviceRegistryRequest.Builder

Request for GetDeviceRegistry.

Protobuf type google.cloud.iot.v1.GetDeviceRegistryRequest

GetDeviceRequest

Request for GetDevice.

Protobuf type google.cloud.iot.v1.GetDeviceRequest

GetDeviceRequest.Builder

Request for GetDevice.

Protobuf type google.cloud.iot.v1.GetDeviceRequest

HttpConfig

The configuration of the HTTP bridge for a device registry.

Protobuf type google.cloud.iot.v1.HttpConfig

HttpConfig.Builder

The configuration of the HTTP bridge for a device registry.

Protobuf type google.cloud.iot.v1.HttpConfig

ListDeviceConfigVersionsRequest

Request for ListDeviceConfigVersions.

Protobuf type google.cloud.iot.v1.ListDeviceConfigVersionsRequest

ListDeviceConfigVersionsRequest.Builder

Request for ListDeviceConfigVersions.

Protobuf type google.cloud.iot.v1.ListDeviceConfigVersionsRequest

ListDeviceConfigVersionsResponse

Response for ListDeviceConfigVersions.

Protobuf type google.cloud.iot.v1.ListDeviceConfigVersionsResponse

ListDeviceConfigVersionsResponse.Builder

Response for ListDeviceConfigVersions.

Protobuf type google.cloud.iot.v1.ListDeviceConfigVersionsResponse

ListDeviceRegistriesRequest

Request for ListDeviceRegistries.

Protobuf type google.cloud.iot.v1.ListDeviceRegistriesRequest

ListDeviceRegistriesRequest.Builder

Request for ListDeviceRegistries.

Protobuf type google.cloud.iot.v1.ListDeviceRegistriesRequest

ListDeviceRegistriesResponse

Response for ListDeviceRegistries.

Protobuf type google.cloud.iot.v1.ListDeviceRegistriesResponse

ListDeviceRegistriesResponse.Builder

Response for ListDeviceRegistries.

Protobuf type google.cloud.iot.v1.ListDeviceRegistriesResponse

ListDeviceStatesRequest

Request for ListDeviceStates.

Protobuf type google.cloud.iot.v1.ListDeviceStatesRequest

ListDeviceStatesRequest.Builder

Request for ListDeviceStates.

Protobuf type google.cloud.iot.v1.ListDeviceStatesRequest

ListDeviceStatesResponse

Response for ListDeviceStates.

Protobuf type google.cloud.iot.v1.ListDeviceStatesResponse

ListDeviceStatesResponse.Builder

Response for ListDeviceStates.

Protobuf type google.cloud.iot.v1.ListDeviceStatesResponse

ListDevicesRequest

Request for ListDevices.

Protobuf type google.cloud.iot.v1.ListDevicesRequest

ListDevicesRequest.Builder

Request for ListDevices.

Protobuf type google.cloud.iot.v1.ListDevicesRequest

ListDevicesResponse

Response for ListDevices.

Protobuf type google.cloud.iot.v1.ListDevicesResponse

ListDevicesResponse.Builder

Response for ListDevices.

Protobuf type google.cloud.iot.v1.ListDevicesResponse

LocationName

LocationName.Builder

Builder for projects/{project}/locations/{location}.

ModifyCloudToDeviceConfigRequest

Request for ModifyCloudToDeviceConfig.

Protobuf type google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest

ModifyCloudToDeviceConfigRequest.Builder

Request for ModifyCloudToDeviceConfig.

Protobuf type google.cloud.iot.v1.ModifyCloudToDeviceConfigRequest

MqttConfig

The configuration of MQTT for a device registry.

Protobuf type google.cloud.iot.v1.MqttConfig

MqttConfig.Builder

The configuration of MQTT for a device registry.

Protobuf type google.cloud.iot.v1.MqttConfig

PublicKeyCertificate

A public key certificate format and data.

Protobuf type google.cloud.iot.v1.PublicKeyCertificate

PublicKeyCertificate.Builder

A public key certificate format and data.

Protobuf type google.cloud.iot.v1.PublicKeyCertificate

PublicKeyCredential

A public key format and data.

Protobuf type google.cloud.iot.v1.PublicKeyCredential

PublicKeyCredential.Builder

A public key format and data.

Protobuf type google.cloud.iot.v1.PublicKeyCredential

RegistryCredential

A server-stored registry credential used to validate device credentials.

Protobuf type google.cloud.iot.v1.RegistryCredential

RegistryCredential.Builder

A server-stored registry credential used to validate device credentials.

Protobuf type google.cloud.iot.v1.RegistryCredential

RegistryName

RegistryName.Builder

Builder for projects/{project}/locations/{location}/registries/{registry}.

ResourcesProto

SendCommandToDeviceRequest

Request for SendCommandToDevice.

Protobuf type google.cloud.iot.v1.SendCommandToDeviceRequest

SendCommandToDeviceRequest.Builder

Request for SendCommandToDevice.

Protobuf type google.cloud.iot.v1.SendCommandToDeviceRequest

SendCommandToDeviceResponse

Response for SendCommandToDevice.

Protobuf type google.cloud.iot.v1.SendCommandToDeviceResponse

SendCommandToDeviceResponse.Builder

Response for SendCommandToDevice.

Protobuf type google.cloud.iot.v1.SendCommandToDeviceResponse

StateNotificationConfig

The configuration for notification of new states received from the device.

Protobuf type google.cloud.iot.v1.StateNotificationConfig

StateNotificationConfig.Builder

The configuration for notification of new states received from the device.

Protobuf type google.cloud.iot.v1.StateNotificationConfig

UnbindDeviceFromGatewayRequest

Request for UnbindDeviceFromGateway.

Protobuf type google.cloud.iot.v1.UnbindDeviceFromGatewayRequest

UnbindDeviceFromGatewayRequest.Builder

Request for UnbindDeviceFromGateway.

Protobuf type google.cloud.iot.v1.UnbindDeviceFromGatewayRequest

UnbindDeviceFromGatewayResponse

Response for UnbindDeviceFromGateway.

Protobuf type google.cloud.iot.v1.UnbindDeviceFromGatewayResponse

UnbindDeviceFromGatewayResponse.Builder

Response for UnbindDeviceFromGateway.

Protobuf type google.cloud.iot.v1.UnbindDeviceFromGatewayResponse

UpdateDeviceRegistryRequest

Request for UpdateDeviceRegistry.

Protobuf type google.cloud.iot.v1.UpdateDeviceRegistryRequest

UpdateDeviceRegistryRequest.Builder

Request for UpdateDeviceRegistry.

Protobuf type google.cloud.iot.v1.UpdateDeviceRegistryRequest

UpdateDeviceRequest

Request for UpdateDevice.

Protobuf type google.cloud.iot.v1.UpdateDeviceRequest

UpdateDeviceRequest.Builder

Request for UpdateDevice.

Protobuf type google.cloud.iot.v1.UpdateDeviceRequest

X509CertificateDetails

Details of an X.509 certificate. For informational purposes only.

Protobuf type google.cloud.iot.v1.X509CertificateDetails

X509CertificateDetails.Builder

Details of an X.509 certificate. For informational purposes only.

Protobuf type google.cloud.iot.v1.X509CertificateDetails

Interfaces

BindDeviceToGatewayRequestOrBuilder

BindDeviceToGatewayResponseOrBuilder

CreateDeviceRegistryRequestOrBuilder

CreateDeviceRequestOrBuilder

DeleteDeviceRegistryRequestOrBuilder

DeleteDeviceRequestOrBuilder

DeviceConfigOrBuilder

DeviceCredentialOrBuilder

DeviceManagerGrpc.AsyncService

Internet of Things (IoT) service. Securely connect and manage IoT devices.

DeviceOrBuilder

DeviceRegistryOrBuilder

DeviceStateOrBuilder

EventNotificationConfigOrBuilder

GatewayConfigOrBuilder

GatewayListOptionsOrBuilder

GetDeviceRegistryRequestOrBuilder

GetDeviceRequestOrBuilder

HttpConfigOrBuilder

ListDeviceConfigVersionsRequestOrBuilder

ListDeviceConfigVersionsResponseOrBuilder

ListDeviceRegistriesRequestOrBuilder

ListDeviceRegistriesResponseOrBuilder

ListDeviceStatesRequestOrBuilder

ListDeviceStatesResponseOrBuilder

ListDevicesRequestOrBuilder

ListDevicesResponseOrBuilder

ModifyCloudToDeviceConfigRequestOrBuilder

MqttConfigOrBuilder

PublicKeyCertificateOrBuilder

PublicKeyCredentialOrBuilder

RegistryCredentialOrBuilder

SendCommandToDeviceRequestOrBuilder

SendCommandToDeviceResponseOrBuilder

StateNotificationConfigOrBuilder

UnbindDeviceFromGatewayRequestOrBuilder

UnbindDeviceFromGatewayResponseOrBuilder

UpdateDeviceRegistryRequestOrBuilder

UpdateDeviceRequestOrBuilder

X509CertificateDetailsOrBuilder

Enums

DeviceCredential.CredentialCase

GatewayAuthMethod

The gateway authorization/authentication method. This setting determines how Cloud IoT Core authorizes/authenticate devices to access the gateway.

Protobuf enum google.cloud.iot.v1.GatewayAuthMethod

GatewayListOptions.FilterCase

GatewayType

Gateway type.

Protobuf enum google.cloud.iot.v1.GatewayType

HttpState

Indicates whether DeviceService (HTTP) is enabled or disabled for the registry. See the field description for details.

Protobuf enum google.cloud.iot.v1.HttpState

LogLevel

Beta Feature

The logging verbosity for device activity. Specifies which events should be written to logs. For example, if the LogLevel is ERROR, only events that terminate in errors will be logged. LogLevel is inclusive; enabling INFO logging will also enable ERROR logging.

Protobuf enum google.cloud.iot.v1.LogLevel

MqttState

Indicates whether an MQTT connection is enabled or disabled. See the field description for details.

Protobuf enum google.cloud.iot.v1.MqttState

PublicKeyCertificateFormat

The supported formats for the public key.

Protobuf enum google.cloud.iot.v1.PublicKeyCertificateFormat

PublicKeyFormat

The supported formats for the public key.

Protobuf enum google.cloud.iot.v1.PublicKeyFormat

RegistryCredential.CredentialCase