Ejemplo n.º 1
0
    def Run(self, args):
        """Run the list command."""
        client = devices.DeviceStatesClient()

        device_ref = util.ParseDevice(args.device,
                                      registry=args.registry,
                                      region=args.region)
        return client.List(device_ref, args.limit)
Ejemplo n.º 2
0
 def SetUp(self):
     self.device_states_client = devices_api.DeviceStatesClient(
         self.client, self.messages)
     self.device_name = (
         'projects/{}/locations/us-central1/registries/my-registry/'
         'devices/my-device').format(self.Project())
     self.device_ref = util.GetRegistry().Create(
         'cloudiot.projects.locations.registries.devices',
         locationsId='us-central1',
         projectsId=self.Project(),
         registriesId='my-registry',
         devicesId='my-device')
     self.request_type = getattr(
         self.messages, 'CloudiotProjectsLocationsRegistries'
         'DevicesStatesListRequest')
     self.service = self.client.projects_locations_registries_devices_states
Ejemplo n.º 3
0
    def Run(self, args):
        """Run the list command."""
        client = devices.DeviceStatesClient()

        device_ref = args.CONCEPTS.device.Parse()
        return client.List(device_ref, args.limit)