Generating the client API - NICE DCV Session Manager

Generating the client API

The Session Manager APIs are defined in a single YAML file. The APIs are based on the OpenAPI3.0 specification, which defines a standard, language-agnostic interface to RESTful APIs. For more information, see OpenAPI Specification.

Using the YAML file, you can generate API clients in one of the supported languages. To do this, you must use Swagger Codegen 3.0 or later. For more information about the supported languages, see the swagger-codegen repo.

To generate the API client

  1. Download the Session Manager API YAML file from the Session Manager Broker. The YAML file is available at the following URL.

  2. Install Swagger Codegen.

    • macOS

      $ brew install swagger-codegen
    • Other platforms

      $ git clone --branch 3.0.0
      $ cd swagger-codegen
  3. Generate the API client.

    • macOS

      $ swagger-codegen generate -i /path_to/yaml_file -l language -o $output_folder
    • Other platforms

      $ mvn clean package
      $ java -jar modules/swagger-codegen-cli/target/swagger-codegen-cli.jar generate -i /path_to/yaml_file -l language -o output_folder