This repository has been archived by the owner on Jul 14, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
44 changed files
with
10,387 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
## CLI | ||
|
||
These settings apply only when `--az` is specified on the command line. | ||
|
||
``` yaml $(az) | ||
az: | ||
extensions: testserver | ||
package-name: azure-mgmt-testserver | ||
namespace: azure.mgmt.testserver | ||
client-subscription-bound: false | ||
client-base-url-bound: false | ||
client-authentication-policy: SansIOHTTPPolicy | ||
az-output-folder: $(azure-cli-extension-folder)/src/testserver | ||
python-sdk-output-folder: "$(az-output-folder)/azext_testserver/vendored_sdks/testserver" | ||
|
||
#cli: | ||
# cli-directive: | ||
# directive on operationGroup | ||
# - select: 'operationGroup' | ||
# where: | ||
# operationGroup: 'operations' | ||
# hidden: true | ||
# - where: | ||
# parameter: location | ||
# required: true | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CLI | ||
|
||
These settings apply only when `--cli` is specified on the command line. | ||
|
||
``` yaml $(cli) | ||
#cli: | ||
# test-scenario: | ||
# - name: Factories_CreateOrUpdate | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Managed Network | ||
|
||
> see https://aka.ms/autorest | ||
This is the AutoRest configuration file for Managed Network. | ||
|
||
|
||
|
||
--- | ||
## Getting Started | ||
To build the SDK for Managed Network, simply [Install AutoRest](https://aka.ms/autorest/install) and in this folder, run: | ||
|
||
> `autorest` | ||
To see additional help and options, run: | ||
|
||
> `autorest --help` | ||
--- | ||
|
||
## Configuration | ||
|
||
|
||
|
||
### Basic Information | ||
These are the global settings for the Managed Network API. | ||
|
||
``` yaml | ||
openapi-type: arm | ||
tag: testserver-2-7-8 | ||
override-info: | ||
title: AutoRest Test Service | ||
description: Test Infrastructure for AutoRest. | ||
``` | ||
### Tag: testserver-2-7-8 | ||
These settings apply only when `--tag=testserver-2-7-8` is specified on the command line. | ||
|
||
``` yaml $(tag) == 'testserver-2-7-8' | ||
input-file: | ||
- ../../../../../node_modules/@microsoft.azure/autorest.testserver/swagger/body-array.json | ||
- ../../../../../node_modules/@microsoft.azure/autorest.testserver/swagger/body-boolean.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 | ||
``` | ||
|
||
|
||
## CLI | ||
|
||
See configuration in [readme.cli.md](./readme.cli.md) |
26 changes: 26 additions & 0 deletions
26
src/test/scenarios/testserver/configuration/readme.python.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
## 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: | ||
azure-arm: true | ||
license-header: MICROSOFT_MIT_NO_VERSION | ||
payload-flattening-threshold: 2 | ||
namespace: azure.mgmt.testserver | ||
package-name: azure-mgmt-testserver | ||
package-version: 0.1.0 | ||
clear-output-folder: true | ||
``` | ||
``` yaml $(python) && $(python-mode) == 'update' | ||
python: | ||
no-namespace-folders: true | ||
output-folder: $(python-sdks-folder)/testserver/azure-mgmt-testserver/azure/mgmt/testserver | ||
``` | ||
``` yaml $(python) && $(python-mode) == 'create' | ||
python: | ||
basic-setup-py: true | ||
output-folder: $(python-sdks-folder)/testserver/azure-mgmt-testserver | ||
``` |
8 changes: 8 additions & 0 deletions
8
src/test/scenarios/testserver/output/src/testserver/HISTORY.rst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. :changelog: | ||
Release History | ||
=============== | ||
|
||
0.1.0 | ||
++++++ | ||
* Initial release. |
5 changes: 5 additions & 0 deletions
5
src/test/scenarios/testserver/output/src/testserver/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Microsoft Azure CLI 'testserver' Extension | ||
========================================== | ||
|
||
This package is for the 'testserver' extension. | ||
i.e. 'az testserver' |
50 changes: 50 additions & 0 deletions
50
src/test/scenarios/testserver/output/src/testserver/azext_testserver/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
from azure.cli.core import AzCommandsLoader | ||
from azext_testserver.generated._help import helps # pylint: disable=unused-import | ||
try: | ||
from azext_testserver.manual._help import helps | ||
except ImportError: | ||
pass | ||
|
||
|
||
class AutoRestTestServiceCommandsLoader(AzCommandsLoader): | ||
|
||
def __init__(self, cli_ctx=None): | ||
from azure.cli.core.commands import CliCommandType | ||
from azext_testserver.generated._client_factory import cf_testserver_cl | ||
testserver_custom = CliCommandType( | ||
operations_tmpl='azext_testserver.custom#{}', | ||
client_factory=cf_testserver_cl) | ||
parent = super(AutoRestTestServiceCommandsLoader, self) | ||
parent.__init__(cli_ctx=cli_ctx, custom_command_type=testserver_custom) | ||
|
||
def load_command_table(self, args): | ||
from azext_testserver.generated.commands import load_command_table | ||
load_command_table(self, args) | ||
try: | ||
from azext_testserver.manual.commands import load_command_table as load_command_table_manual | ||
load_command_table_manual(self, args) | ||
except ImportError: | ||
pass | ||
return self.command_table | ||
|
||
def load_arguments(self, command): | ||
from azext_testserver.generated._params import load_arguments | ||
load_arguments(self, command) | ||
try: | ||
from azext_testserver.manual._params import load_arguments as load_arguments_manual | ||
load_arguments_manual(self, command) | ||
except ImportError: | ||
pass | ||
|
||
|
||
COMMAND_LOADER_CLS = AutoRestTestServiceCommandsLoader |
17 changes: 17 additions & 0 deletions
17
src/test/scenarios/testserver/output/src/testserver/azext_testserver/action.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
# pylint: disable=wildcard-import | ||
# pylint: disable=unused-wildcard-import | ||
|
||
from .generated.action import * # noqa: F403 | ||
try: | ||
from .manual.action import * # noqa: F403 | ||
except ImportError: | ||
pass |
4 changes: 4 additions & 0 deletions
4
src/test/scenarios/testserver/output/src/testserver/azext_testserver/azext_metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"azext.isExperimental": true, | ||
"azext.minCliCoreVersion": "2.3.1" | ||
} |
17 changes: 17 additions & 0 deletions
17
src/test/scenarios/testserver/output/src/testserver/azext_testserver/custom.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
# pylint: disable=wildcard-import | ||
# pylint: disable=unused-wildcard-import | ||
|
||
from .generated.custom import * # noqa: F403 | ||
try: | ||
from .manual.custom import * # noqa: F403 | ||
except ImportError: | ||
pass |
12 changes: 12 additions & 0 deletions
12
src/test/scenarios/testserver/output/src/testserver/azext_testserver/generated/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# coding=utf-8 | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
__path__ = __import__('pkgutil').extend_path(__path__, __name__) |
28 changes: 28 additions & 0 deletions
28
.../scenarios/testserver/output/src/testserver/azext_testserver/generated/_client_factory.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# -------------------------------------------------------------------------- | ||
# Copyright (c) Microsoft Corporation. All rights reserved. | ||
# Licensed under the MIT License. See License.txt in the project root for | ||
# license information. | ||
# | ||
# Code generated by Microsoft (R) AutoRest Code Generator. | ||
# Changes may cause incorrect behavior and will be lost if the code is | ||
# regenerated. | ||
# -------------------------------------------------------------------------- | ||
|
||
|
||
def cf_testserver_cl(cli_ctx, *_): | ||
from azure.cli.core.commands.client_factory import get_mgmt_service_client | ||
from ..vendored_sdks.testserver import AutoRestTestService | ||
from azure.core.pipeline.policies import SansIOHTTPPolicy | ||
return get_mgmt_service_client(cli_ctx, | ||
AutoRestTestService, | ||
subscription_bound=False, | ||
base_url_bound=False, | ||
authentication_policy=SansIOHTTPPolicy()) | ||
|
||
|
||
def cf_array(cli_ctx, *_): | ||
return cf_testserver_cl(cli_ctx).array | ||
|
||
|
||
def cf_bool(cli_ctx, *_): | ||
return cf_testserver_cl(cli_ctx).bool |
Oops, something went wrong.