@@ -13,6 +13,7 @@ type Client interface {
13
13
DeviceCreate (fqbn , name , serial , devType string ) (string , error )
14
14
DeviceDelete (id string ) error
15
15
DeviceList () ([]iotclient.ArduinoDevicev2 , error )
16
+ DeviceShow (id string ) (* iotclient.ArduinoDevicev2 , error )
16
17
CertificateCreate (id , csr string ) (* iotclient.ArduinoCompressedv2 , error )
17
18
ThingCreate (thing * iotclient.Thing , force bool ) (string , error )
18
19
ThingUpdate (id string , thing * iotclient.Thing , force bool ) error
@@ -77,6 +78,17 @@ func (cl *client) DeviceList() ([]iotclient.ArduinoDevicev2, error) {
77
78
return devices , nil
78
79
}
79
80
81
+ // DeviceShow allows to retrieve a specific device, given its id,
82
+ // from Arduino IoT Cloud.
83
+ func (cl * client ) DeviceShow (id string ) (* iotclient.ArduinoDevicev2 , error ) {
84
+ dev , _ , err := cl .api .DevicesV2Api .DevicesV2Show (cl .ctx , id )
85
+ if err != nil {
86
+ err = fmt .Errorf ("retrieving device, %w" , errorDetail (err ))
87
+ return nil , err
88
+ }
89
+ return & dev , nil
90
+ }
91
+
80
92
// CertificateCreate allows to upload a certificate on Arduino IoT Cloud.
81
93
// It returns the certificate parameters populated by the cloud.
82
94
func (cl * client ) CertificateCreate (id , csr string ) (* iotclient.ArduinoCompressedv2 , error ) {
0 commit comments