Skip to content

Commit fdccd69

Browse files
author
SDKAuto
committed
CodeGen from PR 13166 in Azure/azure-rest-api-specs
Merge b353336f78b47a9a9d83765d68a6b9b87ea76f95 into 89f00c2
1 parent 0d16cef commit fdccd69

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+5016
-0
lines changed

src/customproviders/HISTORY.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. :changelog:
2+
3+
Release History
4+
===============
5+
6+
0.1.0
7+
++++++
8+
* Initial release.

src/customproviders/README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Azure CLI customproviders Extension #
2+
This is the extension for customproviders
3+
4+
### How to use ###
5+
Install this extension using the below CLI command
6+
```
7+
az extension add --name customproviders
8+
```
9+
10+
### Included Features ###
11+
#### customproviders custom-resource-provider ####
12+
##### Create #####
13+
```
14+
az customproviders custom-resource-provider create --resource-group "testRG" --location "eastus" \
15+
--actions name="TestAction" endpoint="https://mytestendpoint/" routing-type="Proxy" \
16+
--resource-types name="TestResource" endpoint="https://mytestendpoint2/" routing-type="Proxy,Cache" \
17+
--resource-provider-name "newrp"
18+
```
19+
##### Show #####
20+
```
21+
az customproviders custom-resource-provider show --resource-group "testRG" --resource-provider-name "newrp"
22+
```
23+
##### List #####
24+
```
25+
az customproviders custom-resource-provider list --resource-group "testRG"
26+
```
27+
##### Update #####
28+
```
29+
az customproviders custom-resource-provider update --resource-group "testRG" --resource-provider-name "newrp"
30+
```
31+
##### Delete #####
32+
```
33+
az customproviders custom-resource-provider delete --resource-group "testRG" --resource-provider-name "newrp"
34+
```
35+
#### customproviders association ####
36+
##### Create #####
37+
```
38+
az customproviders association create \
39+
--target-resource-id "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName" \
40+
--name "associationName" --scope "scope"
41+
42+
az customproviders association wait --created --name "{myAssociation}"
43+
```
44+
##### Show #####
45+
```
46+
az customproviders association show --name "associationName" --scope "scope"
47+
```
48+
##### List-all #####
49+
```
50+
az customproviders association list-all --scope "scope"
51+
```
52+
##### Delete #####
53+
```
54+
az customproviders association delete --name "associationName" --scope "scope"
55+
```
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
11+
from azure.cli.core import AzCommandsLoader
12+
from azext_customproviders.generated._help import helps # pylint: disable=unused-import
13+
try:
14+
from azext_customproviders.manual._help import helps # pylint: disable=reimported
15+
except ImportError:
16+
pass
17+
18+
19+
class CustomprovidersCommandsLoader(AzCommandsLoader):
20+
21+
def __init__(self, cli_ctx=None):
22+
from azure.cli.core.commands import CliCommandType
23+
from azext_customproviders.generated._client_factory import cf_customproviders_cl
24+
customproviders_custom = CliCommandType(
25+
operations_tmpl='azext_customproviders.custom#{}',
26+
client_factory=cf_customproviders_cl)
27+
parent = super(CustomprovidersCommandsLoader, self)
28+
parent.__init__(cli_ctx=cli_ctx, custom_command_type=customproviders_custom)
29+
30+
def load_command_table(self, args):
31+
from azext_customproviders.generated.commands import load_command_table
32+
load_command_table(self, args)
33+
try:
34+
from azext_customproviders.manual.commands import load_command_table as load_command_table_manual
35+
load_command_table_manual(self, args)
36+
except ImportError:
37+
pass
38+
return self.command_table
39+
40+
def load_arguments(self, command):
41+
from azext_customproviders.generated._params import load_arguments
42+
load_arguments(self, command)
43+
try:
44+
from azext_customproviders.manual._params import load_arguments as load_arguments_manual
45+
load_arguments_manual(self, command)
46+
except ImportError:
47+
pass
48+
49+
50+
COMMAND_LOADER_CLS = CustomprovidersCommandsLoader
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
# pylint: disable=wildcard-import
11+
# pylint: disable=unused-wildcard-import
12+
13+
from .generated.action import * # noqa: F403
14+
try:
15+
from .manual.action import * # noqa: F403
16+
except ImportError:
17+
pass
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"azext.isExperimental": true,
3+
"azext.minCliCoreVersion": "2.15.0"
4+
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
# pylint: disable=wildcard-import
11+
# pylint: disable=unused-wildcard-import
12+
13+
from .generated.custom import * # noqa: F403
14+
try:
15+
from .manual.custom import * # noqa: F403
16+
except ImportError:
17+
pass
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# coding=utf-8
2+
# --------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See License.txt in the project root for
5+
# license information.
6+
#
7+
# Code generated by Microsoft (R) AutoRest Code Generator.
8+
# Changes may cause incorrect behavior and will be lost if the code is
9+
# regenerated.
10+
# --------------------------------------------------------------------------
11+
12+
__path__ = __import__('pkgutil').extend_path(__path__, __name__)
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
11+
12+
def cf_customproviders_cl(cli_ctx, *_):
13+
from azure.cli.core.commands.client_factory import get_mgmt_service_client
14+
from azext_customproviders.vendored_sdks.customproviders import Customproviders
15+
return get_mgmt_service_client(cli_ctx,
16+
Customproviders)
17+
18+
19+
def cf_custom_resource_provider(cli_ctx, *_):
20+
return cf_customproviders_cl(cli_ctx).custom_resource_provider
21+
22+
23+
def cf_association(cli_ctx, *_):
24+
return cf_customproviders_cl(cli_ctx).associations
Lines changed: 192 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,192 @@
1+
# --------------------------------------------------------------------------
2+
# Copyright (c) Microsoft Corporation. All rights reserved.
3+
# Licensed under the MIT License. See License.txt in the project root for
4+
# license information.
5+
#
6+
# Code generated by Microsoft (R) AutoRest Code Generator.
7+
# Changes may cause incorrect behavior and will be lost if the code is
8+
# regenerated.
9+
# --------------------------------------------------------------------------
10+
# pylint: disable=too-many-lines
11+
12+
from knack.help_files import helps
13+
14+
15+
helps['customproviders custom-resource-provider'] = """
16+
type: group
17+
short-summary: Manage custom resource provider with customproviders
18+
"""
19+
20+
helps['customproviders custom-resource-provider list'] = """
21+
type: command
22+
short-summary: "Gets all the custom resource providers within a resource group. And Gets all the custom resource \
23+
providers within a subscription."
24+
examples:
25+
- name: List all custom resource providers on the resourceGroup
26+
text: |-
27+
az customproviders custom-resource-provider list --resource-group "testRG"
28+
- name: List all custom resource providers on the subscription
29+
text: |-
30+
az customproviders custom-resource-provider list
31+
"""
32+
33+
helps['customproviders custom-resource-provider show'] = """
34+
type: command
35+
short-summary: "Gets the custom resource provider manifest."
36+
examples:
37+
- name: Get a custom resource provider
38+
text: |-
39+
az customproviders custom-resource-provider show --resource-group "testRG" --resource-provider-name \
40+
"newrp"
41+
"""
42+
43+
helps['customproviders custom-resource-provider create'] = """
44+
type: command
45+
short-summary: "Create the custom resource provider."
46+
parameters:
47+
- name: --actions
48+
short-summary: "A list of actions that the custom resource provider implements."
49+
long-summary: |
50+
Usage: --actions routing-type=XX name=XX endpoint=XX
51+
52+
routing-type: The routing types that are supported for action requests.
53+
name: Required. The name of the route definition. This becomes the name for the ARM extension (e.g. \
54+
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProvide\
55+
rs/{resourceProviderName}/{name}')
56+
endpoint: Required. The route definition endpoint URI that the custom resource provider will proxy \
57+
requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a path \
58+
(e.g. 'https://testendpoint/{requestPath}')
59+
60+
Multiple actions can be specified by using more than one --actions argument.
61+
- name: --resource-types
62+
short-summary: "A list of resource types that the custom resource provider implements."
63+
long-summary: |
64+
Usage: --resource-types routing-type=XX name=XX endpoint=XX
65+
66+
routing-type: The routing types that are supported for resource requests.
67+
name: Required. The name of the route definition. This becomes the name for the ARM extension (e.g. \
68+
'/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CustomProviders/resourceProvide\
69+
rs/{resourceProviderName}/{name}')
70+
endpoint: Required. The route definition endpoint URI that the custom resource provider will proxy \
71+
requests to. This can be in the form of a flat URI (e.g. 'https://testendpoint/') or can specify to route via a path \
72+
(e.g. 'https://testendpoint/{requestPath}')
73+
74+
Multiple actions can be specified by using more than one --resource-types argument.
75+
- name: --validations
76+
short-summary: "A list of validations to run on the custom resource provider's requests."
77+
long-summary: |
78+
Usage: --validations validation-type=XX specification=XX
79+
80+
validation-type: The type of validation to run against a matching request.
81+
specification: Required. A link to the validation specification. The specification must be hosted on \
82+
raw.githubusercontent.com.
83+
84+
Multiple actions can be specified by using more than one --validations argument.
85+
examples:
86+
- name: Create or update the custom resource provider
87+
text: |-
88+
az customproviders custom-resource-provider create --resource-group "testRG" --location "eastus" \
89+
--actions name="TestAction" endpoint="https://mytestendpoint/" routing-type="Proxy" --resource-types \
90+
name="TestResource" endpoint="https://mytestendpoint2/" routing-type="Proxy,Cache" --resource-provider-name "newrp"
91+
"""
92+
93+
helps['customproviders custom-resource-provider update'] = """
94+
type: command
95+
short-summary: "Updates an existing custom resource provider. The only value that can be updated via PATCH \
96+
currently is the tags."
97+
examples:
98+
- name: Update a custom resource provider
99+
text: |-
100+
az customproviders custom-resource-provider update --resource-group "testRG" --resource-provider-name \
101+
"newrp"
102+
"""
103+
104+
helps['customproviders custom-resource-provider delete'] = """
105+
type: command
106+
short-summary: "Deletes the custom resource provider."
107+
examples:
108+
- name: Delete a custom resource provider
109+
text: |-
110+
az customproviders custom-resource-provider delete --resource-group "testRG" --resource-provider-name \
111+
"newrp"
112+
"""
113+
114+
helps['customproviders custom-resource-provider wait'] = """
115+
type: command
116+
short-summary: Place the CLI in a waiting state until a condition of the customproviders custom-resource-provider \
117+
is met.
118+
examples:
119+
- name: Pause executing next line of CLI script until the customproviders custom-resource-provider is \
120+
successfully created.
121+
text: |-
122+
az customproviders custom-resource-provider wait --resource-group "testRG" --resource-provider-name \
123+
"newrp" --created
124+
- name: Pause executing next line of CLI script until the customproviders custom-resource-provider is \
125+
successfully deleted.
126+
text: |-
127+
az customproviders custom-resource-provider wait --resource-group "testRG" --resource-provider-name \
128+
"newrp" --deleted
129+
"""
130+
131+
helps['customproviders association'] = """
132+
type: group
133+
short-summary: Manage association with customproviders
134+
"""
135+
136+
helps['customproviders association show'] = """
137+
type: command
138+
short-summary: "Get an association."
139+
examples:
140+
- name: Get an association
141+
text: |-
142+
az customproviders association show --name "associationName" --scope "scope"
143+
"""
144+
145+
helps['customproviders association create'] = """
146+
type: command
147+
short-summary: "Create an association."
148+
examples:
149+
- name: Create or update an association
150+
text: |-
151+
az customproviders association create --target-resource-id "/subscriptions/00000000-0000-0000-0000-00000\
152+
0000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName" --name "associationName" \
153+
--scope "scope"
154+
"""
155+
156+
helps['customproviders association update'] = """
157+
type: command
158+
short-summary: "Update an association."
159+
"""
160+
161+
helps['customproviders association delete'] = """
162+
type: command
163+
short-summary: "Delete an association."
164+
examples:
165+
- name: Delete an association
166+
text: |-
167+
az customproviders association delete --name "associationName" --scope "scope"
168+
"""
169+
170+
helps['customproviders association list-all'] = """
171+
type: command
172+
short-summary: "Gets all association for the given scope."
173+
examples:
174+
- name: Get all associations
175+
text: |-
176+
az customproviders association list-all --scope "scope"
177+
"""
178+
179+
helps['customproviders association wait'] = """
180+
type: command
181+
short-summary: Place the CLI in a waiting state until a condition of the customproviders association is met.
182+
examples:
183+
- name: Pause executing next line of CLI script until the customproviders association is successfully created.
184+
text: |-
185+
az customproviders association wait --name "associationName" --scope "scope" --created
186+
- name: Pause executing next line of CLI script until the customproviders association is successfully updated.
187+
text: |-
188+
az customproviders association wait --name "associationName" --scope "scope" --updated
189+
- name: Pause executing next line of CLI script until the customproviders association is successfully deleted.
190+
text: |-
191+
az customproviders association wait --name "associationName" --scope "scope" --deleted
192+
"""

0 commit comments

Comments
 (0)