Skip to content

Commit

Permalink
Prepare the api for ARM
Browse files Browse the repository at this point in the history
Move swagger to subfolder and create autorest
config readme files.

The folder structure is selected to match the
structure of the azure repository.
  • Loading branch information
petrkotas committed May 20, 2024
1 parent bd1dd0e commit 74be30e
Show file tree
Hide file tree
Showing 23 changed files with 203 additions and 65 deletions.
2 changes: 1 addition & 1 deletion api/autorest-config.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
input-file: redhatopenshift/resource-manager/Microsoft.RedHatOpenshift/preview/2024-06-10-preview/openapi.json
input-file: redhatopenshift/resource-manager/Microsoft.RedHatOpenshift/hcpclusters/preview/2024-06-10-preview/openapi.json
use:
# TODO: This is an old version. We should fix incompatibilities and remove this later
- "@autorest/[email protected]"
Expand Down
2 changes: 1 addition & 1 deletion api/redhatopenshift/HcpCluster/tspconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ options:
use-read-only-status-schema: true
emitter-output-dir: "{project-root}/.."
azure-resource-provider-folder: "resource-manager"
output-file: "{azure-resource-provider-folder}/{service-name}/{version-status}/{version}/openapi.json"
output-file: "{azure-resource-provider-folder}/{service-name}/hcpclusters/{version-status}/{version}/openapi.json"
examples-directory: "{project-root}/examples"
linter:
extends:
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Go

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

``` yaml $(go) && !$(track2)
go:
license-header: MICROSOFT_MIT_NO_VERSION
namespace: redhatopenshift
clear-output-folder: true
```
``` yaml $(go) && $(track2)
license-header: MICROSOFT_MIT_NO_VERSION
module-name: sdk/resourcemanager/redhatopenshifthcp/armredhatopenshifthcp
module: github.com/Azure/azure-sdk-for-go/$(module-name)
output-folder: $(go-sdk-folder)/$(module-name)
azure-arm: true
```
### Go multi-api
``` yaml $(go) && $(multiapi)
batch:
- tag: package-2024-06-10-preview
```
### Tag: 2024-06-10-preview and go
These settings apply only when `--tag=package-2020-04-30 --go` is specified on the command line.
Please also specify `--go-sdk-folder=<path to the root directory of your azure-sdk-for-go clone>`.

``` yaml $(tag) == '2024-06-10-preview' && $(go)
output-folder: $(go-sdk-folder)/services/preview/$(namespace)/mgmt/2024-06-10-preview/$(namespace)
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# RedHatOpenshift HCP Clusters

## This is the autorest configuration file for RedHatOpenshift HCP Clusters.

The service is hosted under Microsoft.RedHatOpenshift namespace but HCP is exposed
as a separarate set of resources, APIs and SDKs.

## Getting Started

To build the SDK for ContainerServices, [install Autorest](https://aka.ms/autorest/install). Then
in this folder, run this command:

> `autorest`
To see additional help and options, run:

> `autorest --help`
---

## Configuration

### Basic Information

These are the global settings for the ContainerServices API.

``` yaml
openapi-type: arm
tag: package-2024-06-10-preview
```
### Tag: package-2024-06-10-preview
These settings apply only when `--tag=package-2024-06-10-preview` is specified on the command line.

``` yaml $(tag) == 'package-2024-06-10-preview'
input-file:
- preview/2024-06-10-preview/openapi.json
```

# Code Generation

## Swagger to SDK

This section describes what SDK should be generated by the automatic system.
This is not used by Autorest itself.

``` yaml $(swagger-to-sdk)
swagger-to-sdk:
- repo: azure-sdk-for-python
- repo: azure-sdk-for-go
- repo: azure-resource-manager-schemas
- repo: azure-powershell
```


## Go

See configuration in [readme.go.md](./readme.go.md)

## Python

See configuration in [readme.python.md](./readme.python.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
## Python

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

```yaml $(python)
title: RedHatOpenShiftHcpMgmtClient
azure-arm: true
license-header: MICROSOFT_MIT_NO_VERSION
package-name: azure-mgmt-redhatopenshifthcp
package-version: 1.0.0b1
clear-output-folder: true
no-namespace-folders: true
```
### Python multi-api
Generate all API versions currently shipped for this package
```yaml $(python)
default-api-version: "2024-06-10-preview"
multiapi: true
batch:
- tag: package-2024-06-10-preview
- multiapiscript: true
```
``` yaml $(multiapiscript)
output-folder: $(python-sdks-folder)/redhatopenshift/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/
clear-output-folder: false
perform-load: false
```
### Tag: package-2024-06-10-preview and python
These settings apply only when `--tag=package-2024-06-10-preview --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-2024-06-10-preview' && $(python)
namespace: azure.mgmt.redhatopenshifthcp.v2024_06_10_preview
output-folder: $(python-sdks-folder)/redhatopenshift/azure-mgmt-redhatopenshifthcp/azure/mgmt/redhatopenshifthcp/v2024_06_10_preview
```

0 comments on commit 74be30e

Please sign in to comment.