def test_device_connect_transport_type_put(self): """Test case for device_connect_transport_type_put Connect to the azure IoT Hub as a device """ caCertificate = Certificate() query_string = [('connectionString', 'connectionString_example')] response = self.client.open('/device/connect/{transportType}'.format( transportType='transportType_example'), method='PUT', data=json.dumps(caCertificate), content_type='application/json', query_string=query_string) self.assert200(response, 'Response body is : ' + response.data.decode('utf-8'))
def device_connect(transportType, connectionString, caCertificate=None): # noqa: E501 """Connect to the azure IoT Hub as a device # noqa: E501 :param transportType: Transport to use :type transportType: str :param connectionString: connection string :type connectionString: str :param caCertificate: :type caCertificate: dict | bytes :rtype: ConnectResponse """ if connexion.request.is_json: caCertificate = Certificate.from_dict(connexion.request.get_json()) # noqa: E501 return device_glue.connect(transportType, connectionString, caCertificate)
def device_create_from_connection_string(transportType, connectionString, caCertificate=None): # noqa: E501 """Create a device client from a connection string # noqa: E501 :param transportType: Transport to use :type transportType: str :param connectionString: connection string :type connectionString: str :param caCertificate: :type caCertificate: dict | bytes :rtype: ConnectResponse """ if connexion.request.is_json: caCertificate = Certificate.from_dict(connexion.request.get_json()) # noqa: E501 # changed from return 'do some magic!' return device_glue.create_from_connection_string(transportType, connectionString, caCertificate)
def module_connect(transportType, connectionString, caCertificate=None): # noqa: E501 """Connect to the azure IoT Hub as a module # noqa: E501 :param transportType: Transport to use :type transportType: str :param connectionString: connection string :type connectionString: str :param caCertificate: :type caCertificate: dict | bytes :rtype: ConnectResponse """ if connexion.request.is_json: caCertificate = Certificate.from_dict(connexion.request.get_json()) # noqa: E501 # changed from return 'do some magic!' return module_glue.connect_sync(transportType, connectionString, caCertificate)