Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AutoPR customproviders] Enable swagger ci for azure-powershell #684

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/customproviders/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:

Release History
===============

0.1.0
++++++
* Initial release.
55 changes: 55 additions & 0 deletions src/customproviders/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Azure CLI customproviders Extension #
This is the extension for customproviders

### How to use ###
Install this extension using the below CLI command
```
az extension add --name customproviders
```

### Included Features ###
#### customproviders custom-resource-provider ####
##### Create #####
```
az customproviders custom-resource-provider create --resource-group "testRG" --location "eastus" \
--actions name="TestAction" endpoint="https://mytestendpoint/" routing-type="Proxy" \
--resource-types name="TestResource" endpoint="https://mytestendpoint2/" routing-type="Proxy,Cache" \
--resource-provider-name "newrp"
```
##### Show #####
```
az customproviders custom-resource-provider show --resource-group "testRG" --resource-provider-name "newrp"
```
##### List #####
```
az customproviders custom-resource-provider list --resource-group "testRG"
```
##### Update #####
```
az customproviders custom-resource-provider update --resource-group "testRG" --resource-provider-name "newrp"
```
##### Delete #####
```
az customproviders custom-resource-provider delete --resource-group "testRG" --resource-provider-name "newrp"
```
#### customproviders association ####
##### Create #####
```
az customproviders association create \
--target-resource-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName" \
--name "associationName" --scope "scope"

az customproviders association wait --created --name "{myAssociation}"
```
##### Show #####
```
az customproviders association show --name "associationName" --scope "scope"
```
##### List-all #####
```
az customproviders association list-all --scope "scope"
```
##### Delete #####
```
az customproviders association delete --name "associationName" --scope "scope"
```
50 changes: 50 additions & 0 deletions src/customproviders/azext_customproviders/__init__.py
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_customproviders.generated._help import helps # pylint: disable=unused-import
try:
from azext_customproviders.manual._help import helps # pylint: disable=reimported
except ImportError:
pass


class CustomprovidersCommandsLoader(AzCommandsLoader):

def __init__(self, cli_ctx=None):
from azure.cli.core.commands import CliCommandType
from azext_customproviders.generated._client_factory import cf_customproviders_cl
customproviders_custom = CliCommandType(
operations_tmpl='azext_customproviders.custom#{}',
client_factory=cf_customproviders_cl)
parent = super(CustomprovidersCommandsLoader, self)
parent.__init__(cli_ctx=cli_ctx, custom_command_type=customproviders_custom)

def load_command_table(self, args):
from azext_customproviders.generated.commands import load_command_table
load_command_table(self, args)
try:
from azext_customproviders.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_customproviders.generated._params import load_arguments
load_arguments(self, command)
try:
from azext_customproviders.manual._params import load_arguments as load_arguments_manual
load_arguments_manual(self, command)
except ImportError:
pass


COMMAND_LOADER_CLS = CustomprovidersCommandsLoader
17 changes: 17 additions & 0 deletions src/customproviders/azext_customproviders/action.py
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 src/customproviders/azext_customproviders/azext_metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"azext.isExperimental": true,
"azext.minCliCoreVersion": "2.15.0"
}
17 changes: 17 additions & 0 deletions src/customproviders/azext_customproviders/custom.py
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 src/customproviders/azext_customproviders/generated/__init__.py
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__)
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# --------------------------------------------------------------------------
# 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_customproviders_cl(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azext_customproviders.vendored_sdks.customproviders import Customproviders
return get_mgmt_service_client(cli_ctx,
Customproviders)


def cf_custom_resource_provider(cli_ctx, *_):
return cf_customproviders_cl(cli_ctx).custom_resource_provider


def cf_association(cli_ctx, *_):
return cf_customproviders_cl(cli_ctx).associations
192 changes: 192 additions & 0 deletions src/customproviders/azext_customproviders/generated/_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
# --------------------------------------------------------------------------
# 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=too-many-lines

from knack.help_files import helps


helps['customproviders custom-resource-provider'] = """
type: group
short-summary: Manage custom resource provider with customproviders
"""

helps['customproviders custom-resource-provider list'] = """
type: command
short-summary: "Gets all the custom resource providers within a resource group. And Gets all the custom resource \
providers within a subscription."
examples:
- name: List all custom resource providers on the resourceGroup
text: |-
az customproviders custom-resource-provider list --resource-group "testRG"
- name: List all custom resource providers on the subscription
text: |-
az customproviders custom-resource-provider list
"""

helps['customproviders custom-resource-provider show'] = """
type: command
short-summary: "Gets the custom resource provider manifest."
examples:
- name: Get a custom resource provider
text: |-
az customproviders custom-resource-provider show --resource-group "testRG" --resource-provider-name \
"newrp"
"""

helps['customproviders custom-resource-provider create'] = """
type: command
short-summary: "Create the custom resource provider."
parameters:
- name: --actions
short-summary: "A list of actions that the custom resource provider implements."
long-summary: |
Usage: --actions routing-type=XX name=XX endpoint=XX

routing-type: The routing types that are supported for action requests.
name: Required. The name of the route definition. This becomes the name for the ARM extension (e.g. \
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProvide\
rs/{resourceProviderName}/{name}')
endpoint: Required. The route definition endpoint URI that the custom resource provider will proxy \
requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a path \
(e.g. 'https://testendpoint/{requestPath}')

Multiple actions can be specified by using more than one --actions argument.
- name: --resource-types
short-summary: "A list of resource types that the custom resource provider implements."
long-summary: |
Usage: --resource-types routing-type=XX name=XX endpoint=XX

routing-type: The routing types that are supported for resource requests.
name: Required. The name of the route definition. This becomes the name for the ARM extension (e.g. \
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProvide\
rs/{resourceProviderName}/{name}')
endpoint: Required. The route definition endpoint URI that the custom resource provider will proxy \
requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a path \
(e.g. 'https://testendpoint/{requestPath}')

Multiple actions can be specified by using more than one --resource-types argument.
- name: --validations
short-summary: "A list of validations to run on the custom resource provider's requests."
long-summary: |
Usage: --validations validation-type=XX specification=XX

validation-type: The type of validation to run against a matching request.
specification: Required. A link to the validation specification. The specification must be hosted on \
raw.githubusercontent.com.

Multiple actions can be specified by using more than one --validations argument.
examples:
- name: Create or update the custom resource provider
text: |-
az customproviders custom-resource-provider create --resource-group "testRG" --location "eastus" \
--actions name="TestAction" endpoint="https://mytestendpoint/" routing-type="Proxy" --resource-types \
name="TestResource" endpoint="https://mytestendpoint2/" routing-type="Proxy,Cache" --resource-provider-name "newrp"
"""

helps['customproviders custom-resource-provider update'] = """
type: command
short-summary: "Updates an existing custom resource provider. The only value that can be updated via PATCH \
currently is the tags."
examples:
- name: Update a custom resource provider
text: |-
az customproviders custom-resource-provider update --resource-group "testRG" --resource-provider-name \
"newrp"
"""

helps['customproviders custom-resource-provider delete'] = """
type: command
short-summary: "Deletes the custom resource provider."
examples:
- name: Delete a custom resource provider
text: |-
az customproviders custom-resource-provider delete --resource-group "testRG" --resource-provider-name \
"newrp"
"""

helps['customproviders custom-resource-provider wait'] = """
type: command
short-summary: Place the CLI in a waiting state until a condition of the customproviders custom-resource-provider \
is met.
examples:
- name: Pause executing next line of CLI script until the customproviders custom-resource-provider is \
successfully created.
text: |-
az customproviders custom-resource-provider wait --resource-group "testRG" --resource-provider-name \
"newrp" --created
- name: Pause executing next line of CLI script until the customproviders custom-resource-provider is \
successfully deleted.
text: |-
az customproviders custom-resource-provider wait --resource-group "testRG" --resource-provider-name \
"newrp" --deleted
"""

helps['customproviders association'] = """
type: group
short-summary: Manage association with customproviders
"""

helps['customproviders association show'] = """
type: command
short-summary: "Get an association."
examples:
- name: Get an association
text: |-
az customproviders association show --name "associationName" --scope "scope"
"""

helps['customproviders association create'] = """
type: command
short-summary: "Create an association."
examples:
- name: Create or update an association
text: |-
az customproviders association create --target-resource-id "/subscriptions/00000000-0000-0000-0000-00000\
0000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName" --name "associationName" \
--scope "scope"
"""

helps['customproviders association update'] = """
type: command
short-summary: "Update an association."
"""

helps['customproviders association delete'] = """
type: command
short-summary: "Delete an association."
examples:
- name: Delete an association
text: |-
az customproviders association delete --name "associationName" --scope "scope"
"""

helps['customproviders association list-all'] = """
type: command
short-summary: "Gets all association for the given scope."
examples:
- name: Get all associations
text: |-
az customproviders association list-all --scope "scope"
"""

helps['customproviders association wait'] = """
type: command
short-summary: Place the CLI in a waiting state until a condition of the customproviders association is met.
examples:
- name: Pause executing next line of CLI script until the customproviders association is successfully created.
text: |-
az customproviders association wait --name "associationName" --scope "scope" --created
- name: Pause executing next line of CLI script until the customproviders association is successfully updated.
text: |-
az customproviders association wait --name "associationName" --scope "scope" --updated
- name: Pause executing next line of CLI script until the customproviders association is successfully deleted.
text: |-
az customproviders association wait --name "associationName" --scope "scope" --deleted
"""
Loading