Skip to content

[Management] OpenAPI specs

Weidong Xu edited this page Dec 22, 2021 · 11 revisions

Use Python script

A Python script in Azure SDK for Java can help generate a management SDK from OpenAPI specs.

Please see Working with AutoRest for the installation of autorest CLI. It also requires the installation of Node.js 10 or above, Java 11 or above, and Python 3.

Python package PyYAML and requests is required to be installed, e.g. via pip3 install --upgrade PyYAML requests.

As an example, if the spec is resourcegraph, one can call below command line to generate Java management SDK for it.

python eng/mgmt/automation/generate.py --readme=resourcegraph

This will generate or update the SDK under sdk/resourcegraph/azure-resourcemanager-resourcegraph.

--tag option can be used if one wish to use a specific tag in spec readme.

Use pipeline

There is an internal pipeline java - lite generation - mgmt, which calls the above Python script and create pull request of the generated SDK.

It takes similar input parameters as the script, e.g. README variable for readme option, TAG variable for tag option.

Clone this wiki locally