Skip to content

Commit 98c0272

Browse files
authored
[RPaaS] Initial CLI Extensions (Azure#2853)
1 parent 7968fe0 commit 98c0272

Some content is hidden

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

59 files changed

+23329
-1
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,4 +170,6 @@
170170

171171
/src/confluent/ @fengzhou-msft
172172

173-
/src/cosmosdb-preview/ @wmengmsft @MehaKaushik @kavskalyan
173+
/src/providerhub/ @wwendyc @vikashj
174+
175+
/src/cosmosdb-preview/ @wmengmsft @MehaKaushik @kavskalyan

linter_exclusions.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1744,6 +1744,84 @@ powerbi embedded-capacity update:
17441744
administration_members:
17451745
rule_exclusions:
17461746
- option_length_too_long
1747+
providerhub manifest checkin:
1748+
parameters:
1749+
arm_manifest_location:
1750+
rule_exclusions:
1751+
- option_length_too_long
1752+
providerhub provider-registration create:
1753+
parameters:
1754+
incident_contact_email:
1755+
rule_exclusions:
1756+
- option_length_too_long
1757+
incident_routing_service:
1758+
rule_exclusions:
1759+
- option_length_too_long
1760+
incident_routing_team:
1761+
rule_exclusions:
1762+
- option_length_too_long
1763+
lighthouse_authorizations:
1764+
rule_exclusions:
1765+
- option_length_too_long
1766+
provider_authentication:
1767+
rule_exclusions:
1768+
- option_length_too_long
1769+
provider_authorizations:
1770+
rule_exclusions:
1771+
- option_length_too_long
1772+
providerhub_metadata_provider_authorizations:
1773+
rule_exclusions:
1774+
- option_length_too_long
1775+
providerhub_metadata_rp_authentication:
1776+
rule_exclusions:
1777+
- option_length_too_long
1778+
required_features_policy:
1779+
rule_exclusions:
1780+
- option_length_too_long
1781+
resource_access_policy:
1782+
rule_exclusions:
1783+
- option_length_too_long
1784+
template_deployment_options:
1785+
rule_exclusions:
1786+
- option_length_too_long
1787+
providerhub resource-type-registration create:
1788+
parameters:
1789+
allowed_unauthorized_actions:
1790+
rule_exclusions:
1791+
- option_length_too_long
1792+
authorization_action_mappings:
1793+
rule_exclusions:
1794+
- option_length_too_long
1795+
check_name_availability_specifications:
1796+
rule_exclusions:
1797+
- option_length_too_long
1798+
disallowed_action_verbs:
1799+
rule_exclusions:
1800+
- option_length_too_long
1801+
enable_async_operation:
1802+
rule_exclusions:
1803+
- option_length_too_long
1804+
enable_third_party_s2s:
1805+
rule_exclusions:
1806+
- option_length_too_long
1807+
required_features_policy:
1808+
rule_exclusions:
1809+
- option_length_too_long
1810+
resource_creation_begin:
1811+
rule_exclusions:
1812+
- option_length_too_long
1813+
resource_deletion_policy:
1814+
rule_exclusions:
1815+
- option_length_too_long
1816+
subscription_state_rules:
1817+
rule_exclusions:
1818+
- option_length_too_long
1819+
swagger_specifications:
1820+
rule_exclusions:
1821+
- option_length_too_long
1822+
template_deployment_options:
1823+
rule_exclusions:
1824+
- option_length_too_long
17471825
repos import create:
17481826
parameters:
17491827
git_service_endpoint_id:

src/providerhub/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/providerhub/README.md

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
# Azure CLI providerhub Extension #
2+
This is the extension for providerhub
3+
4+
### How to use ###
5+
Install this extension using the below CLI command
6+
```
7+
az extension add --name providerhub
8+
```
9+
10+
### Included Features ###
11+
#### providerhub custom-rollout ####
12+
##### Create #####
13+
```
14+
az providerhub custom-rollout create --provider-namespace "Microsoft.Contoso" --rollout-name "brazilUsShoeBoxTesting"
15+
```
16+
##### Show #####
17+
```
18+
az providerhub custom-rollout show --provider-namespace "Microsoft.Contoso" --rollout-name "canaryTesting99"
19+
```
20+
##### List #####
21+
```
22+
az providerhub custom-rollout list --provider-namespace "Microsoft.Contoso"
23+
```
24+
#### providerhub default-rollout ####
25+
##### Create #####
26+
```
27+
az providerhub default-rollout create --provider-namespace "Microsoft.Contoso" --rollout-name "2020week10"
28+
```
29+
##### Show #####
30+
```
31+
az providerhub default-rollout show --provider-namespace "Microsoft.Contoso" --rollout-name "2020week10"
32+
```
33+
##### List #####
34+
```
35+
az providerhub default-rollout list --provider-namespace "Microsoft.Contoso"
36+
```
37+
##### Stop #####
38+
```
39+
az providerhub default-rollout stop --provider-namespace "Microsoft.Contoso" --rollout-name "2020week10"
40+
```
41+
##### Delete #####
42+
```
43+
az providerhub default-rollout delete --provider-namespace "Microsoft.Contoso" --rollout-name "2020week10"
44+
```
45+
#### providerhub manifest ####
46+
##### Checkin #####
47+
```
48+
az providerhub manifest checkin --provider-namespace "Microsoft.Contoso"
49+
```
50+
##### Generate #####
51+
```
52+
az providerhub manifest generate --provider-namespace "Microsoft.Contoso"
53+
```
54+
#### providerhub provider-registration ####
55+
##### Create #####
56+
```
57+
az providerhub provider-registration create --capabilities effect="Allow" quota-id="CSP_2015-05-01" \
58+
--capabilities effect="Allow" quota-id="CSP_MG_2017-12-01" --incident-contact-email "[email protected]" \
59+
--incident-routing-service "Contoso Resource Provider" --incident-routing-team "Contoso Triage" \
60+
--provider-type "Internal" --provider-version "2.0" --provider-namespace "Microsoft.Contoso"
61+
```
62+
##### Show #####
63+
```
64+
az providerhub provider-registration show --provider-namespace "Microsoft.Contoso"
65+
```
66+
##### List #####
67+
```
68+
az providerhub provider-registration list --resource-group "sampleResourceGroup"
69+
```
70+
##### Generate-operation #####
71+
```
72+
az providerhub provider-registration generate-operation --provider-namespace "Microsoft.Contoso"
73+
```
74+
##### Delete #####
75+
```
76+
az providerhub provider-registration delete --provider-namespace "Microsoft.Contoso"
77+
```
78+
#### providerhub resource-type-registration ####
79+
##### List #####
80+
```
81+
az providerhub resource-type-registration list --provider-namespace "Microsoft.Contoso"
82+
```
83+
##### Show #####
84+
```
85+
az providerhub resource-type-registration show --provider-namespace "Microsoft.Contoso" --resource-type "employees"
86+
```
87+
#### providerhub resource-type-registration ####
88+
##### Create #####
89+
```
90+
az providerhub resource-type-registration create --provider-namespace "Microsoft.Contoso" --resource-type "employees"
91+
```
92+
##### Delete #####
93+
```
94+
az providerhub resource-type-registration delete --provider-namespace "Microsoft.Contoso" \
95+
--resource-type "testResourceType"
96+
```
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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=ungrouped-imports
11+
# pylint: disable=unused-import
12+
# pylint: disable=reimported
13+
# pylint: disable=import-outside-toplevel
14+
15+
from azure.cli.core import AzCommandsLoader
16+
from azure.cli.core.commands import CliCommandType
17+
from azext_providerhub.generated._help import helps
18+
from azext_providerhub.generated._client_factory import cf_providerhub_cl
19+
from azext_providerhub.generated.commands import load_command_table
20+
from azext_providerhub.generated._params import load_arguments
21+
22+
try:
23+
from azext_providerhub.manual._help import helps
24+
except ImportError:
25+
pass
26+
27+
28+
class ProviderhubCommandsLoader(AzCommandsLoader):
29+
30+
def __init__(self, cli_ctx=None):
31+
providerhub_custom = CliCommandType(
32+
operations_tmpl='azext_providerhub.custom#{}',
33+
client_factory=cf_providerhub_cl)
34+
parent = super()
35+
parent.__init__(cli_ctx=cli_ctx,
36+
custom_command_type=providerhub_custom)
37+
38+
def load_command_table(self, args):
39+
load_command_table(self, args)
40+
try:
41+
from azext_providerhub.manual.commands import load_command_table as load_command_table_manual
42+
load_command_table_manual(self, args)
43+
except ImportError:
44+
pass
45+
return self.command_table
46+
47+
def load_arguments(self, command):
48+
load_arguments(self, command)
49+
try:
50+
from azext_providerhub.manual._params import load_arguments as load_arguments_manual
51+
load_arguments_manual(self, command)
52+
except ImportError:
53+
pass
54+
55+
56+
COMMAND_LOADER_CLS = ProviderhubCommandsLoader
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: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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.commands.client_factory import get_mgmt_service_client
12+
from azext_providerhub.vendored_sdks.providerhub import Providerhub
13+
14+
15+
def cf_providerhub_cl(cli_ctx, *_):
16+
return get_mgmt_service_client(cli_ctx,
17+
Providerhub)
18+
19+
20+
def cf_providerhub(cli_ctx, *_):
21+
return cf_providerhub_cl(cli_ctx).providerhub_operations
22+
23+
24+
def cf_custom_rollout(cli_ctx, *_):
25+
return cf_providerhub_cl(cli_ctx).custom_rollouts
26+
27+
28+
def cf_default_rollout(cli_ctx, *_):
29+
return cf_providerhub_cl(cli_ctx).default_rollouts
30+
31+
32+
def cf_operation(cli_ctx, *_):
33+
return cf_providerhub_cl(cli_ctx).operations
34+
35+
36+
def cf_provider_registration(cli_ctx, *_):
37+
return cf_providerhub_cl(cli_ctx).provider_registrations
38+
39+
40+
def cf_resource_type_registration(cli_ctx, *_):
41+
return cf_providerhub_cl(cli_ctx).resource_type_registrations

0 commit comments

Comments
 (0)