Configurations: 'specification/networkfunction/resource-manager/Microsoft.NetworkFunction/TrafficCollector/tspconfig.yaml', API Version: 2022-11-01, SDK Release Type: beta, and CommitSHA: '3e0c16b4e69111860b9cb246f0eb64bd67ae6db1' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6485336 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release. --------- Co-authored-by: Jiao Di (MSFT) <[email protected]>
@azure/arm-networkfunction client library samples for JavaScript (Beta)
These sample programs show how to use the JavaScript client libraries for @azure/arm-networkfunction in some common scenarios.
| File Name | Description |
|---|---|
| azureTrafficCollectorsByResourceGroupListSample.js | return list of Azure Traffic Collectors in a Resource Group x-ms-original-file: 2022-11-01/AzureTrafficCollectorsByResourceGroupList.json |
| azureTrafficCollectorsBySubscriptionListSample.js | return list of Azure Traffic Collectors in a subscription x-ms-original-file: 2022-11-01/AzureTrafficCollectorsBySubscriptionList.json |
| azureTrafficCollectorsCreateOrUpdateSample.js | creates or updates a Azure Traffic Collector resource x-ms-original-file: 2022-11-01/AzureTrafficCollectorCreate.json |
| azureTrafficCollectorsDeleteSample.js | deletes a specified Azure Traffic Collector resource. x-ms-original-file: 2022-11-01/AzureTrafficCollectorDelete.json |
| azureTrafficCollectorsGetSample.js | gets the specified Azure Traffic Collector in a specified resource group x-ms-original-file: 2022-11-01/AzureTrafficCollectorGet.json |
| azureTrafficCollectorsUpdateTagsSample.js | updates the specified Azure Traffic Collector tags. x-ms-original-file: 2022-11-01/AzureTrafficCollectorUpdateTags.json |
| collectorPoliciesCreateOrUpdateSample.js | creates or updates a Collector Policy resource x-ms-original-file: 2022-11-01/CollectorPolicyCreate.json |
| collectorPoliciesDeleteSample.js | deletes a specified Collector Policy resource. x-ms-original-file: 2022-11-01/CollectorPolicyDelete.json |
| collectorPoliciesGetSample.js | gets the collector policy in a specified Traffic Collector x-ms-original-file: 2022-11-01/CollectorPolicyGet.json |
| collectorPoliciesListSample.js | return list of Collector policies in a Azure Traffic Collector x-ms-original-file: 2022-11-01/CollectorPoliciesList.json |
| collectorPoliciesUpdateTagsSample.js | updates the specified Collector Policy tags. x-ms-original-file: 2022-11-01/CollectorPolicyUpdateTags.json |
| networkFunctionListOperationsSample.js | lists all of the available NetworkFunction Rest API operations. x-ms-original-file: 2022-11-01/OperationsList.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:
- Install the dependencies using
npm:
npm install
-
Edit the file
sample.env, adding the correct credentials to access the Azure service and run the samples. Then rename the file fromsample.envto just.env. The sample programs will read this file automatically. -
Run whichever samples you like (note that some samples may require additional setup, see the table above):
node azureTrafficCollectorsByResourceGroupListSample.js
Alternatively, run a single sample with the required environment variables set (setting up the .env file is not required if you do this), for example (cross-platform):
node azureTrafficCollectorsByResourceGroupListSample.js
Next Steps
Take a look at our API Documentation for more information about the APIs that are available in the clients.