Skip to content

Commit

Permalink
ACS multiapi for Python (#4322)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmazuel authored Oct 24, 2018
1 parent a0adc09 commit cdf0d9e
Show file tree
Hide file tree
Showing 2 changed files with 112 additions and 30 deletions.
73 changes: 43 additions & 30 deletions specification/containerservices/resource-manager/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,47 @@ input-file:
- Microsoft.ContainerService/stable/2017-07-01/containerService.json
```

### Tag: package-2018-08-preview-only

These settings apply only when `--tag=package-2018-08-preview-only` is specified on the command line.

``` yaml $(tag) == 'package-2018-08-preview-only'
input-file:
- Microsoft.ContainerService/preview/2018-08-01-preview/managedClusters.json
```

### Tag: package-2018-09-preview-only

These settings apply only when `--tag=package-2018-09-preview-only` is specified on the command line.

``` yaml $(tag) == 'package-2018-09-preview-only'
input-file:
- Microsoft.ContainerService/preview/2018-09-30-preview/openShiftManagedClusters.json
```

### Tag: package-2018-03-only

These settings apply only when `--tag=package-2018-03-only` is specified on the command line.

``` yaml $(tag) == 'package-2018-03-only'
input-file:
- Microsoft.ContainerService/stable/2018-03-31/managedClusters.json
```

### Tag: package-2017-07-only-extended

These settings apply only when `--tag=package-2017-07-only-extended` is specified on the command line.

This tag is special, since it brings together two API version that belongs
to the same operation group, since Python does not know how to handle
multi-api operation group for now.

``` yaml $(tag) == 'package-2017-07-only-extended'
input-file:
- Microsoft.ContainerService/stable/2017-07-01/containerService.json
- Microsoft.ContainerService/stable/2017-09-30/location.json
```

### Tag: package-2017-08-only

These settings apply only when `--tag=package-2017-08-only` is specified on the command line.
Expand Down Expand Up @@ -160,6 +201,8 @@ This is not used by Autorest itself.
``` yaml $(swagger-to-sdk)
swagger-to-sdk:
- repo: azure-sdk-for-python
after_scripts:
- python ./scripts/multiapi_init_gen.py azure-mgmt-containerservice
- repo: azure-sdk-for-java
- repo: azure-sdk-for-go
- repo: azure-sdk-for-js
Expand All @@ -169,36 +212,6 @@ swagger-to-sdk:
- bundle install && rake arm:regen_all_profiles['azure_mgmt_container_service']
```

## Python

These settings apply only when `--python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.
Use `--python-mode=update` if you already have a setup.py and just want to update the code itself.

``` yaml $(python)
python-mode: create
python:
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
payload-flattening-threshold: 2
namespace: azure.mgmt.containerservice
package-name: azure-mgmt-containerservice
package-version: 4.3.1
clear-output-folder: true
```

``` yaml $(python) && $(python-mode) == 'update'
python:
no-namespace-folders: true
output-folder: $(python-sdks-folder)/azure-mgmt-containerservice/azure/mgmt/containerservice
```

``` yaml $(python) && $(python-mode) == 'create'
python:
basic-setup-py: true
output-folder: $(python-sdks-folder)/azure-mgmt-containerservice
```

## Go

See configuration in [readme.go.md](./readme.go.md)
Expand Down
69 changes: 69 additions & 0 deletions specification/containerservices/resource-manager/readme.python.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
## Python

These settings apply only when `--python` is specified on the command line.

```yaml $(python)
python:
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
payload-flattening-threshold: 2
package-name: azure-mgmt-containerservice
clear-output-folder: true
no-namespace-folders: true
```
### Python multi-api
Generate all API versions currently shipped for this package
```yaml $(python) && $(multiapi)
batch:
- tag: package-2018-09-preview-only
- tag: package-2018-08-preview-only
- tag: package-2018-03-only
- tag: package-2017-07-only-extended
```
### Tag: package-2018-09-preview-only and python
These settings apply only when `--tag=package-2018-09-preview-only --python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.

``` yaml $(tag) == 'package-2018-09-preview-only' && $(python)
python:
namespace: azure.mgmt.containerservice.v2018_09_30_preview
output-folder: $(python-sdks-folder)/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_09_30_preview
```

### Tag: package-2018-08-preview-only and python

These settings apply only when `--tag=package-2018-08-preview-only --python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.

``` yaml $(tag) == 'package-2018-08-preview-only' && $(python)
python:
namespace: azure.mgmt.containerservice.v2018_08_01_preview
output-folder: $(python-sdks-folder)/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_08_01_preview
```

### Tag: package-2018-03-only and python

These settings apply only when `--tag=package-2018-03-only --python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.

``` yaml $(tag) == 'package-2018-03-only' && $(python)
python:
namespace: azure.mgmt.containerservice.v2018_03_31
output-folder: $(python-sdks-folder)/azure-mgmt-containerservice/azure/mgmt/containerservice/v2018_03_31
```

### Tag: package-2017-07-only-extended and python

These settings apply only when `--tag=package-2017-07-only-extended --python` is specified on the command line.
Please also specify `--python-sdks-folder=<path to the root directory of your azure-sdk-for-python clone>`.

``` yaml $(tag) == 'package-2017-07-only-extended' && $(python)
python:
namespace: azure.mgmt.containerservice.v2017_07_01
output-folder: $(python-sdks-folder)/azure-mgmt-containerservice/azure/mgmt/containerservice/v2017_07_01
```

0 comments on commit cdf0d9e

Please sign in to comment.