azure-sdk-for-js/sdk/iotoperations/arm-iotoperations/samples/v1-beta/javascript
Jeremy Meng a28e8f0795 [EngSys] move to vendored version of cross-env via dev-tool
***NO_CI***

- apply the transformation

- update samples' README
2024-11-02 00:48:06 +00:00
..
README.md
brokerAuthenticationCreateOrUpdateSample.js
brokerAuthenticationDeleteSample.js
brokerAuthenticationGetSample.js
brokerAuthenticationListByResourceGroupSample.js
brokerAuthorizationCreateOrUpdateSample.js
brokerAuthorizationDeleteSample.js
brokerAuthorizationGetSample.js
brokerAuthorizationListByResourceGroupSample.js
brokerCreateOrUpdateSample.js
brokerDeleteSample.js
brokerGetSample.js
brokerListByResourceGroupSample.js
brokerListenerCreateOrUpdateSample.js
brokerListenerDeleteSample.js
brokerListenerGetSample.js
brokerListenerListByResourceGroupSample.js
dataflowCreateOrUpdateSample.js
dataflowDeleteSample.js
dataflowEndpointCreateOrUpdateSample.js
dataflowEndpointDeleteSample.js
dataflowEndpointGetSample.js
dataflowEndpointListByResourceGroupSample.js
dataflowGetSample.js
dataflowListByResourceGroupSample.js
dataflowProfileCreateOrUpdateSample.js
dataflowProfileDeleteSample.js
dataflowProfileGetSample.js
dataflowProfileListByResourceGroupSample.js
instanceCreateOrUpdateSample.js
instanceDeleteSample.js
instanceGetSample.js
instanceListByResourceGroupSample.js
instanceListBySubscriptionSample.js
instanceUpdateSample.js
operationsListSample.js
package.json
sample.env

README.md

@azure/arm-iotoperations client library samples for JavaScript (Beta)

These sample programs show how to use the JavaScript client libraries for @azure/arm-iotoperations in some common scenarios.

File Name Description
brokerAuthenticationCreateOrUpdateSample.js create a BrokerAuthenticationResource x-ms-original-file: 2024-09-15-preview/BrokerAuthentication_CreateOrUpdate_Complex.json
brokerAuthenticationDeleteSample.js delete a BrokerAuthenticationResource x-ms-original-file: 2024-09-15-preview/BrokerAuthentication_Delete_MaximumSet_Gen.json
brokerAuthenticationGetSample.js get a BrokerAuthenticationResource x-ms-original-file: 2024-09-15-preview/BrokerAuthentication_Get_MaximumSet_Gen.json
brokerAuthenticationListByResourceGroupSample.js list BrokerAuthenticationResource resources by BrokerResource x-ms-original-file: 2024-09-15-preview/BrokerAuthentication_ListByResourceGroup_MaximumSet_Gen.json
brokerAuthorizationCreateOrUpdateSample.js create a BrokerAuthorizationResource x-ms-original-file: 2024-09-15-preview/BrokerAuthorization_CreateOrUpdate_Complex.json
brokerAuthorizationDeleteSample.js delete a BrokerAuthorizationResource x-ms-original-file: 2024-09-15-preview/BrokerAuthorization_Delete_MaximumSet_Gen.json
brokerAuthorizationGetSample.js get a BrokerAuthorizationResource x-ms-original-file: 2024-09-15-preview/BrokerAuthorization_Get_MaximumSet_Gen.json
brokerAuthorizationListByResourceGroupSample.js list BrokerAuthorizationResource resources by BrokerResource x-ms-original-file: 2024-09-15-preview/BrokerAuthorization_ListByResourceGroup_MaximumSet_Gen.json
brokerCreateOrUpdateSample.js create a BrokerResource x-ms-original-file: 2024-09-15-preview/Broker_CreateOrUpdate_Complex.json
brokerDeleteSample.js delete a BrokerResource x-ms-original-file: 2024-09-15-preview/Broker_Delete_MaximumSet_Gen.json
brokerGetSample.js get a BrokerResource x-ms-original-file: 2024-09-15-preview/Broker_Get_MaximumSet_Gen.json
brokerListByResourceGroupSample.js list BrokerResource resources by InstanceResource x-ms-original-file: 2024-09-15-preview/Broker_ListByResourceGroup_MaximumSet_Gen.json
brokerListenerCreateOrUpdateSample.js create a BrokerListenerResource x-ms-original-file: 2024-09-15-preview/BrokerListener_CreateOrUpdate_Complex.json
brokerListenerDeleteSample.js delete a BrokerListenerResource x-ms-original-file: 2024-09-15-preview/BrokerListener_Delete_MaximumSet_Gen.json
brokerListenerGetSample.js get a BrokerListenerResource x-ms-original-file: 2024-09-15-preview/BrokerListener_Get_MaximumSet_Gen.json
brokerListenerListByResourceGroupSample.js list BrokerListenerResource resources by BrokerResource x-ms-original-file: 2024-09-15-preview/BrokerListener_ListByResourceGroup_MaximumSet_Gen.json
dataflowCreateOrUpdateSample.js create a DataflowResource x-ms-original-file: 2024-09-15-preview/Dataflow_CreateOrUpdate_ComplexContextualization.json
dataflowDeleteSample.js delete a DataflowResource x-ms-original-file: 2024-09-15-preview/Dataflow_Delete_MaximumSet_Gen.json
dataflowEndpointCreateOrUpdateSample.js create a DataflowEndpointResource x-ms-original-file: 2024-09-15-preview/DataflowEndpoint_CreateOrUpdate_ADLSv2.json
dataflowEndpointDeleteSample.js delete a DataflowEndpointResource x-ms-original-file: 2024-09-15-preview/DataflowEndpoint_Delete_MaximumSet_Gen.json
dataflowEndpointGetSample.js get a DataflowEndpointResource x-ms-original-file: 2024-09-15-preview/DataflowEndpoint_Get_MaximumSet_Gen.json
dataflowEndpointListByResourceGroupSample.js list DataflowEndpointResource resources by InstanceResource x-ms-original-file: 2024-09-15-preview/DataflowEndpoint_ListByResourceGroup_MaximumSet_Gen.json
dataflowGetSample.js get a DataflowResource x-ms-original-file: 2024-09-15-preview/Dataflow_Get_MaximumSet_Gen.json
dataflowListByResourceGroupSample.js list DataflowResource resources by DataflowProfileResource x-ms-original-file: 2024-09-15-preview/Dataflow_ListByProfileResource_MaximumSet_Gen.json
dataflowProfileCreateOrUpdateSample.js create a DataflowProfileResource x-ms-original-file: 2024-09-15-preview/DataflowProfile_CreateOrUpdate_MaximumSet_Gen.json
dataflowProfileDeleteSample.js delete a DataflowProfileResource x-ms-original-file: 2024-09-15-preview/DataflowProfile_Delete_MaximumSet_Gen.json
dataflowProfileGetSample.js get a DataflowProfileResource x-ms-original-file: 2024-09-15-preview/DataflowProfile_Get_MaximumSet_Gen.json
dataflowProfileListByResourceGroupSample.js list DataflowProfileResource resources by InstanceResource x-ms-original-file: 2024-09-15-preview/DataflowProfile_ListByResourceGroup_MaximumSet_Gen.json
instanceCreateOrUpdateSample.js create a InstanceResource x-ms-original-file: 2024-09-15-preview/Instance_CreateOrUpdate_MaximumSet_Gen.json
instanceDeleteSample.js delete a InstanceResource x-ms-original-file: 2024-09-15-preview/Instance_Delete_MaximumSet_Gen.json
instanceGetSample.js get a InstanceResource x-ms-original-file: 2024-09-15-preview/Instance_Get_MaximumSet_Gen.json
instanceListByResourceGroupSample.js list InstanceResource resources by resource group x-ms-original-file: 2024-09-15-preview/Instance_ListByResourceGroup_MaximumSet_Gen.json
instanceListBySubscriptionSample.js list InstanceResource resources by subscription ID x-ms-original-file: 2024-09-15-preview/Instance_ListBySubscription_MaximumSet_Gen.json
instanceUpdateSample.js update a InstanceResource x-ms-original-file: 2024-09-15-preview/Instance_Update_MaximumSet_Gen.json
operationsListSample.js list the operations for the provider x-ms-original-file: 2024-09-15-preview/Operations_List_MaximumSet_Gen.json

Prerequisites

The sample programs are compatible with LTS versions of Node.js.

You need an Azure subscription to run these sample programs.

Samples retrieve credentials to access the service endpoint from environment variables. Alternatively, edit the source code to include the appropriate credentials. See each individual sample for details on which environment variables/credentials it requires to function.

Adapting the samples to run in the browser may require some additional consideration. For details, please see the package README.

Setup

To run the samples using the published version of the package:

  1. Install the dependencies using npm:
npm install
  1. Edit the file sample.env, adding the correct credentials to access the Azure service and run the samples. Then rename the file from sample.env to just .env. The sample programs will read this file automatically.

  2. Run whichever samples you like (note that some samples may require additional setup, see the table above):

node brokerAuthenticationCreateOrUpdateSample.js

Alternatively, run a single sample with the correct environment variables set (setting up the .env file is not required if you do this), for example (cross-platform):

npx dev-tool run vendored cross-env  node brokerAuthenticationCreateOrUpdateSample.js

Next Steps

Take a look at our API Documentation for more information about the APIs that are available in the clients.