-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Generate Python Mgmt SDK
Yuchao Yan edited this page Aug 21, 2023
·
3 revisions
Assume you have swagger PR for azure-rest-api-specs or azure-rest-api-specs-pr, this doc shows how to generate Python Mgmt SDK. Please make sure readme.md
(here is sample readme.md) of your PR has added - repo: azure-sdk-for-python
to swagger-to-sdk
yaml section. And your PR must have readme.python.md
(here is sample readme.python.md).
There are 2 ways to generate Mgmt SDK: online and local.
With https://github.com/Azure/azure-sdk-for-python/blob/main/doc/dev/private_package/get_private_package.md, you can get private package without any local work.
If you want to generate SDK locally, follow the steps:
- install autorest with npm
- install Python 3.7 or later
- clone OpenApi repo azure-rest-api-specs locally (make sure it contains your swagger content)
- clone SDK repo azure-sdk-for-python locally
Assume OpenApi repo and SDK repo are in folder D:\
and your service name is myservice
, run:
D:\> autorest azure-rest-api-specs\specification\myservice\resource-manager\readme.md --python --python-sdks-folder=D:\dev\azure-sdk-for-python\sdk --use=@autorest/python@6.7.1 --use=@autorest/modelerfour@4.26.2 --version=3.9.7 --version-tolerant=False