Skip to content

Commit d95e1e3

Browse files
author
SDK Automation
committed
Update from master
1 parent 5477901 commit d95e1e3

Some content is hidden

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

44 files changed

+4601
-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: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
Microsoft Azure CLI 'customproviders' Extension
2+
==========================================
3+
4+
This package is for the 'customproviders' extension.
5+
i.e. 'az customproviders'
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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+
14+
15+
class CustomprovidersCommandsLoader(AzCommandsLoader):
16+
17+
def __init__(self, cli_ctx=None):
18+
from azure.cli.core.commands import CliCommandType
19+
from azext_customproviders.generated._client_factory import cf_customproviders
20+
customproviders_custom = CliCommandType(
21+
operations_tmpl='azext_customproviders.custom#{}',
22+
client_factory=cf_customproviders)
23+
super(CustomprovidersCommandsLoader, self).__init__(cli_ctx=cli_ctx,
24+
custom_command_type=customproviders_custom)
25+
26+
def load_command_table(self, args):
27+
from azext_customproviders.generated.commands import load_command_table
28+
load_command_table(self, args)
29+
try:
30+
from azext_customproviders.manual.commands import load_command_table as load_command_table_manual
31+
load_command_table_manual(self, args)
32+
except ImportError:
33+
pass
34+
return self.command_table
35+
36+
def load_arguments(self, command):
37+
from azext_customproviders.generated._params import load_arguments
38+
load_arguments(self, command)
39+
try:
40+
from azext_customproviders.manual._params import load_arguments as load_arguments_manual
41+
load_arguments_manual(self, command)
42+
except ImportError:
43+
pass
44+
45+
46+
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.3.1"
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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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(cli_ctx, *_):
13+
from azure.cli.core.commands.client_factory import get_mgmt_service_client
14+
from ..vendored_sdks.customproviders import Customproviders
15+
return get_mgmt_service_client(cli_ctx, Customproviders)
16+
17+
18+
def cf_custom_resource_provider(cli_ctx, *_):
19+
return cf_customproviders(cli_ctx).custom_resource_provider
20+
21+
22+
def cf_association(cli_ctx, *_):
23+
return cf_customproviders(cli_ctx).association
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
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: customproviders custom-resource-provider
18+
"""
19+
20+
helps['customproviders custom-resource-provider list'] = """
21+
type: command
22+
short-summary: Gets all the custom resource providers within a subscription.
23+
examples:
24+
- name: List all custom resource providers on the resourceGroup
25+
text: |-
26+
az customproviders custom-resource-provider list --resource-group "testRG"
27+
"""
28+
29+
helps['customproviders custom-resource-provider show'] = """
30+
type: command
31+
short-summary: Gets the custom resource provider manifest.
32+
examples:
33+
- name: Get a custom resource provider
34+
text: |-
35+
az customproviders custom-resource-provider show --resource-group "testRG" --resource-provider-name "new\
36+
rp"
37+
"""
38+
39+
helps['customproviders custom-resource-provider create'] = """
40+
type: command
41+
short-summary: Creates or updates the custom resource provider.
42+
examples:
43+
- name: Create or update the custom resource provider
44+
text: |-
45+
az customproviders custom-resource-provider create --resource-group "testRG" --location "eastus" --actio\
46+
ns name="TestAction" endpoint="https://mytestendpoint/" routing-type="Proxy" --resource-types name="TestResource" endpo\
47+
int="https://mytestendpoint2/" routing-type="Proxy,Cache" --resource-provider-name "newrp"
48+
"""
49+
50+
helps['customproviders custom-resource-provider update'] = """
51+
type: command
52+
short-summary: Updates an existing custom resource provider. The only value that can be updated via PATCH currently\
53+
is the tags.
54+
examples:
55+
- name: Update a custom resource provider
56+
text: |-
57+
az customproviders custom-resource-provider update --resource-group "testRG" --resource-provider-name "n\
58+
ewrp"
59+
"""
60+
61+
helps['customproviders custom-resource-provider delete'] = """
62+
type: command
63+
short-summary: Deletes the custom resource provider.
64+
examples:
65+
- name: Delete a custom resource provider
66+
text: |-
67+
az customproviders custom-resource-provider delete --resource-group "testRG" --resource-provider-name "n\
68+
ewrp"
69+
"""
70+
71+
helps['customproviders association'] = """
72+
type: group
73+
short-summary: customproviders association
74+
"""
75+
76+
helps['customproviders association show'] = """
77+
type: command
78+
short-summary: Get an association.
79+
examples:
80+
- name: Get an association
81+
text: |-
82+
az customproviders association show --association-name "associationName" --scope "scope"
83+
"""
84+
85+
helps['customproviders association create'] = """
86+
type: command
87+
short-summary: Create or update an association.
88+
examples:
89+
- name: Create or update an association
90+
text: |-
91+
az customproviders association create --target-resource-id "/subscriptions/00000000-0000-0000-0000-00000\
92+
0000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName" --association-name "associatio\
93+
nName" --scope "scope"
94+
"""
95+
96+
helps['customproviders association update'] = """
97+
type: command
98+
short-summary: Create or update an association.
99+
examples:
100+
- name: Create or update an association
101+
text: |-
102+
az customproviders association update --target-resource-id "/subscriptions/00000000-0000-0000-0000-00000\
103+
0000000/resourceGroups/appRG/providers/Microsoft.Solutions/applications/applicationName" --association-name "associatio\
104+
nName" --scope "scope"
105+
"""
106+
107+
helps['customproviders association delete'] = """
108+
type: command
109+
short-summary: Delete an association.
110+
examples:
111+
- name: Delete an association
112+
text: |-
113+
az customproviders association delete --association-name "associationName" --scope "scope"
114+
"""
115+
116+
helps['customproviders association list-all'] = """
117+
type: command
118+
short-summary: Gets all association for the given scope.
119+
examples:
120+
- name: Get all associations
121+
text: |-
122+
az customproviders association list-all --scope "scope"
123+
"""
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
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+
# pylint: disable=too-many-statements
12+
13+
from knack.arguments import CLIArgumentType
14+
from azure.cli.core.commands.parameters import (
15+
tags_type,
16+
resource_group_name_type,
17+
get_location_type
18+
)
19+
from azure.cli.core.commands.validators import get_default_location_from_resource_group
20+
from azext_customproviders.action import (
21+
AddActions,
22+
AddResourceTypes,
23+
AddValidations
24+
)
25+
26+
27+
def load_arguments(self, _):
28+
29+
with self.argument_context('customproviders custom-resource-provider list') as c:
30+
c.argument('resource_group_name', resource_group_name_type)
31+
32+
with self.argument_context('customproviders custom-resource-provider show') as c:
33+
c.argument('resource_group_name', resource_group_name_type)
34+
c.argument('resource_provider_name', help='The name of the resource provider.')
35+
36+
with self.argument_context('customproviders custom-resource-provider create') as c:
37+
c.argument('resource_group_name', resource_group_name_type)
38+
c.argument('resource_provider_name', help='The name of the resource provider.')
39+
c.argument('location', arg_type=get_location_type(self.cli_ctx),
40+
validator=get_default_location_from_resource_group)
41+
c.argument('tags', tags_type)
42+
c.argument('actions', action=AddActions, nargs='+', help='A list of actions that the custom resource provider i'
43+
'mplements. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: name, endpoint.')
44+
c.argument('resource_types', action=AddResourceTypes, nargs='+', help='A list of resource types that the custom'
45+
' resource provider implements. Expect value: KEY1=VALUE1 KEY2=VALUE2 ... , available KEYs are: rout'
46+
'ing-type, name, endpoint.')
47+
c.argument('validations', action=AddValidations, nargs='+', help='A list of validations to run on the custom re'
48+
'source provider\'s requests. Expect value: specification=xx.')
49+
50+
with self.argument_context('customproviders custom-resource-provider update') as c:
51+
c.argument('resource_group_name', resource_group_name_type)
52+
c.argument('resource_provider_name', help='The name of the resource provider.')
53+
c.argument('tags', tags_type)
54+
55+
with self.argument_context('customproviders custom-resource-provider delete') as c:
56+
c.argument('resource_group_name', resource_group_name_type)
57+
c.argument('resource_provider_name', help='The name of the resource provider.')
58+
59+
with self.argument_context('customproviders association show') as c:
60+
c.argument('scope', help='The scope of the association.')
61+
c.argument('association_name', help='The name of the association.')
62+
63+
with self.argument_context('customproviders association create') as c:
64+
c.argument('scope', help='The scope of the association. The scope can be any valid REST resource instance. For '
65+
'example, use \'/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Micr'
66+
'osoft.Compute/virtualMachines/{vm-name}\' for a virtual machine resource.')
67+
c.argument('association_name', help='The name of the association.')
68+
c.argument('target_resource_id',
69+
help='The REST resource instance of the target resource for this association.')
70+
71+
with self.argument_context('customproviders association update') as c:
72+
c.argument('scope', help='The scope of the association. The scope can be any valid REST resource instance. For '
73+
'example, use \'/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/Micr'
74+
'osoft.Compute/virtualMachines/{vm-name}\' for a virtual machine resource.')
75+
c.argument('association_name', help='The name of the association.')
76+
c.argument('target_resource_id',
77+
help='The REST resource instance of the target resource for this association.')
78+
79+
with self.argument_context('customproviders association delete') as c:
80+
c.argument('scope', help='The scope of the association.')
81+
c.argument('association_name', help='The name of the association.')
82+
83+
with self.argument_context('customproviders association list-all') as c:
84+
c.argument('scope', help='The scope of the association.')

0 commit comments

Comments
 (0)