Custom Data CLI Reference

This topic discusses the Custom Data Feeds (CDF) command line tool in more detail.

Summary

The CDF command line tool has five commands, which are described in the following table:

CommandDescription
cdf createapp <name>Create a new custom data app
cdf createprovider <name>Create a new custom data provider
cdf export <providername>Export a custom data provider into a package file
cdf deleteprovider <providername>Delete a provider from a custom data app
cdf listprovidersList all the providers registered in a custom data app

The syntax for the cdf command is cdf <command> [options].

Create a New Custom Data App

Use the command cdf createapp <name> to create a new custom data app. This command creates a Node.js project with the following directory structure in the current directory.

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
    - config/
        | default.json
    - framework/
    - node_modules/
    - src/
        - request-handlers/
            | welcome-page.js
        | index.js
        | plugins.js
        | routes.js
    - cdconfig.json
    - package-lock.json
    - package.json

Since the cdf createapp command generates several files, it may take several minutes to complete.

Create a New Custom Data Provider

Use the cdf createprovider <name> command to create a new custom data provider. You must run the command at the root of the custom data app directory. The command creates a Node.js project in the providers folder of the custom data app. If the providers folder is missing, the command will automatically create it. The providers directory will have the following structure:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
    -providername
        - config/
            | default.json
        - node_modules/
        - src/
            | index.js
            | model.js
        - test/
            | index.test.js
            | model.test.js
        - cdconfig.json
        - package-lock.json
        - package.json

This folder structure serves as a template for creating a custom provider. Each time you create a new provider, and a new project directory named for the new provider will be created in the providers folder.

Export Custom Data Provider

Use the cdf export <providername> command to export a data provider to a custom data package file (.cdpk) after you have written and tested your custom data provider code. You must run the command at the root of the custom data app directory. The resulting .cdpk file is used to register the custom data provider with ArcGIS Server. Any existing provider .cdpk with the same name will be overwritten.

Delete a Provider

Use the cdf deleteprovider <providername> command to delete a custom data provider. You must run the command at the root of the custom data app directory. This is the recommended method for removing a provider project from your provider directory. Do not simply delete the provider project manually.

List Registered Providers

Use the cdf listproviders command at the root of a custom app directory to list all providers registered with the app.

Options

The following table lists the available command line options.

OptionDescription
-h, --helpDisplay help text on the various commands and options
-v, --versionDisplay the current version number of cdf
;

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.