# Cloud IoT API . projects . locations . registries . devices . states

## Instance Methods

Close httplib2 connections.

Lists the last few versions of the device state in descending order (i.e.: newest first).

### Method Details

`close()`

    Close httplib2 connections.

`list(name, numStates=None, x__xgafv=None)`

    Lists the last few versions of the device state in descending order (i.e.: newest first).

    Args:
      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}`. (required)
      numStates: integer, The number of states to list. States are listed in descending order of update time. The maximum number of states retained is 10. If this value is zero, it will return all the states available.
      x__xgafv: string, V1 error format.
        Allowed values
          1 - v1 error format
          2 - v2 error format

    Returns:
      An object of the form:

        { # Response for `ListDeviceStates`.
        "deviceStates": [ # The last few device states. States are listed in descending order of server update time, starting from the most recent one.
          { # The device state, as reported by the device.
            "updateTime": "A String", # [Output only] The time at which this state version was updated in Cloud IoT Core.
            "binaryData": "A String", # The device state data.
          },
        ],
      }