Loading...
Loading...
Compare original and translation side by side
aws iotgcloud iotimport boto3
iot_client = boto3.client('iot')
response = iot_client.create_thing(thingName='MySensor')
print(response['thingArn'])az iot hub device-identity create --hub-name MyHub --device-id MyDevice --edge-enabled
az iot hub device-identity show --hub-name MyHub --device-id MyDevicegcloud auth loginaws iotgcloud iotimport boto3
iot_client = boto3.client('iot')
response = iot_client.create_thing(thingName='MySensor')
print(response['thingArn'])az iot hub device-identity create --hub-name MyHub --device-id MyDevice --edge-enabled
az iot hub device-identity show --hub-name MyHub --device-id MyDevicegcloud auth loginaws iot create-thing --thing-name Device1 --thing-type Sensoraws iot create-thing --thing-name Device1 --attribute '{"location": "office"}'gcloud iot devices create Device1 --registry=MyRegistry --region=us-central1 --project=MyProjectaz iot hub device-identity create --hub-name MyHub --device-id Device1 --auth-method x509_caaws iot create-thing --thing-name Device1 --thing-type Sensorgcloud iot devices create Device1 --registry=MyRegistry --region=us-central1 --project=MyProjectaz iot hub device-identity create --hub-name MyHub --device-id Device1 --auth-method x509_caaws iot create-topic-rule --rule-name MyRule --sql-version '2016-03-23' --sql "SELECT * FROM 'iot/topic'" --actions '{"lambda":{"functionArn":"arn:aws:lambda:region:account-id:function:function-name"}}'gcloud pubsub topics create my-topicaz eventgrid event-subscription create --name sub1 --source-resource-id /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.Devices/IotHubs/{hub} --endpoint-type webhook --endpoint-url https://endpoint.com/api/updatesaws iot create-topic-rule --rule-name MyRule --sql-version '2016-03-23' --sql "SELECT * FROM 'iot/topic'" --actions '{"lambda":{"functionArn":"arn:aws:lambda:region:account-id:function:function-name"}}'gcloud pubsub topics create my-topicaz eventgrid event-subscription create --name sub1 --source-resource-id /subscriptions/{subId}/resourceGroups/{rg}/providers/Microsoft.Devices/IotHubs/{hub} --endpoint-type webhook --endpoint-url https://endpoint.com/api/updatestry:
iot_client.create_thing(thingName='Device1')
except iot_client.exceptions.ResourceAlreadyExistsException:
print("Thing already exists; update instead.")az iot hub device-identity createaz iot hub device-identity updatetry:
iot_client.create_thing(thingName='Device1')
except iot_client.exceptions.ResourceAlreadyExistsException:
print("Thing已存在;请改为更新操作。")az iot hub device-identity createaz iot hub device-identity update