forked from Azure/azure-cli-extensions
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CodeGen from PR 13227 in Azure/azure-rest-api-specs
Merge 18823c21383323bcec69bc32d7adc394af69b049 into 717f252
- Loading branch information
SDKAuto
committed
Mar 2, 2021
1 parent
32ccfec
commit 2c5fde8
Showing
40 changed files
with
3,510 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.. :changelog: | ||
Release History | ||
=============== | ||
|
||
0.1.0 | ||
++++++ | ||
* Initial release. |
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,37 @@ | ||
# Azure CLI windowsiotservices Extension # | ||
This is the extension for windowsiotservices | ||
|
||
### How to use ### | ||
Install this extension using the below CLI command | ||
``` | ||
az extension add --name windowsiotservices | ||
``` | ||
|
||
### Included Features ### | ||
#### windowsiotservices service #### | ||
##### Create ##### | ||
``` | ||
az windowsiotservices service create --device-name "service4445" --location "East US" --admin-domain-name "d.e.f" \ | ||
--billing-domain-name "a.b.c" --notes "blah" --quantity 1000000 --resource-group "res9101" | ||
``` | ||
##### Show ##### | ||
``` | ||
az windowsiotservices service show --device-name "service8596" --resource-group "res9407" | ||
``` | ||
##### List ##### | ||
``` | ||
az windowsiotservices service list --resource-group "res6117" | ||
``` | ||
##### Update ##### | ||
``` | ||
az windowsiotservices service update --device-name "service8596" --location "East US" --admin-domain-name "d.e.f" \ | ||
--billing-domain-name "a.b.c" --notes "blah" --quantity 1000000 --resource-group "res9407" | ||
``` | ||
##### Check-device-service-name-availability ##### | ||
``` | ||
az windowsiotservices service check-device-service-name-availability --name "service3363" | ||
``` | ||
##### Delete ##### | ||
``` | ||
az windowsiotservices service delete --device-name "service2434" --resource-group "res4228" | ||
``` |
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_windowsiotservices.generated._help import helps # pylint: disable=unused-import | ||
try: | ||
from azext_windowsiotservices.manual._help import helps # pylint: disable=reimported | ||
except ImportError: | ||
pass | ||
|
||
|
||
class DeviceServicesCommandsLoader(AzCommandsLoader): | ||
|
||
def __init__(self, cli_ctx=None): | ||
from azure.cli.core.commands import CliCommandType | ||
from azext_windowsiotservices.generated._client_factory import cf_windowsiotservices_cl | ||
windowsiotservices_custom = CliCommandType( | ||
operations_tmpl='azext_windowsiotservices.custom#{}', | ||
client_factory=cf_windowsiotservices_cl) | ||
parent = super(DeviceServicesCommandsLoader, self) | ||
parent.__init__(cli_ctx=cli_ctx, custom_command_type=windowsiotservices_custom) | ||
|
||
def load_command_table(self, args): | ||
from azext_windowsiotservices.generated.commands import load_command_table | ||
load_command_table(self, args) | ||
try: | ||
from azext_windowsiotservices.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_windowsiotservices.generated._params import load_arguments | ||
load_arguments(self, command) | ||
try: | ||
from azext_windowsiotservices.manual._params import load_arguments as load_arguments_manual | ||
load_arguments_manual(self, command) | ||
except ImportError: | ||
pass | ||
|
||
|
||
COMMAND_LOADER_CLS = DeviceServicesCommandsLoader |
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 |
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.15.0" | ||
} |
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/windowsiot/azext_windowsiotservices/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__) |
20 changes: 20 additions & 0 deletions
20
src/windowsiot/azext_windowsiotservices/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,20 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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_windowsiotservices_cl(cli_ctx, *_): | ||
from azure.cli.core.commands.client_factory import get_mgmt_service_client | ||
from azext_windowsiotservices.vendored_sdks.windowsiot import DeviceServices | ||
return get_mgmt_service_client(cli_ctx, | ||
DeviceServices) | ||
|
||
|
||
def cf_service(cli_ctx, *_): | ||
return cf_windowsiotservices_cl(cli_ctx).services |
81 changes: 81 additions & 0 deletions
81
src/windowsiot/azext_windowsiotservices/generated/_help.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,81 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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['windowsiotservices service'] = """ | ||
type: group | ||
short-summary: Manage service with windowsiotservices | ||
""" | ||
|
||
helps['windowsiotservices service list'] = """ | ||
type: command | ||
short-summary: "Get all the IoT hubs in a resource group. And Get all the IoT hubs in a subscription." | ||
examples: | ||
- name: Service_ListByResourceGroup | ||
text: |- | ||
az windowsiotservices service list --resource-group "res6117" | ||
- name: Service_List | ||
text: |- | ||
az windowsiotservices service list | ||
""" | ||
|
||
helps['windowsiotservices service show'] = """ | ||
type: command | ||
short-summary: "Get the non-security related metadata of a Windows IoT Device Service." | ||
examples: | ||
- name: Services_GetProperties | ||
text: |- | ||
az windowsiotservices service show --device-name "service8596" --resource-group "res9407" | ||
""" | ||
|
||
helps['windowsiotservices service create'] = """ | ||
type: command | ||
short-summary: "Create the metadata of a Windows IoT Device Service. The usual pattern to modify a property is to \ | ||
retrieve the Windows IoT Device Service metadata and security metadata, and then combine them with the modified values \ | ||
in a new body to update the Windows IoT Device Service." | ||
examples: | ||
- name: Service_Create | ||
text: |- | ||
az windowsiotservices service create --device-name "service4445" --location "East US" \ | ||
--admin-domain-name "d.e.f" --billing-domain-name "a.b.c" --notes "blah" --quantity 1000000 --resource-group "res9101" | ||
""" | ||
|
||
helps['windowsiotservices service update'] = """ | ||
type: command | ||
short-summary: "Updates the metadata of a Windows IoT Device Service. The usual pattern to modify a property is to \ | ||
retrieve the Windows IoT Device Service metadata and security metadata, and then combine them with the modified values \ | ||
in a new body to update the Windows IoT Device Service." | ||
examples: | ||
- name: Service_Update | ||
text: |- | ||
az windowsiotservices service update --device-name "service8596" --location "East US" \ | ||
--admin-domain-name "d.e.f" --billing-domain-name "a.b.c" --notes "blah" --quantity 1000000 --resource-group "res9407" | ||
""" | ||
|
||
helps['windowsiotservices service delete'] = """ | ||
type: command | ||
short-summary: "Delete a Windows IoT Device Service." | ||
examples: | ||
- name: Service_Delete | ||
text: |- | ||
az windowsiotservices service delete --device-name "service2434" --resource-group "res4228" | ||
""" | ||
|
||
helps['windowsiotservices service check-device-service-name-availability'] = """ | ||
type: command | ||
short-summary: "Check if a Windows IoT Device Service name is available." | ||
examples: | ||
- name: Service_CheckNameAvailability | ||
text: |- | ||
az windowsiotservices service check-device-service-name-availability --name "service3363" | ||
""" |
65 changes: 65 additions & 0 deletions
65
src/windowsiot/azext_windowsiotservices/generated/_params.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,65 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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 | ||
# pylint: disable=too-many-statements | ||
|
||
from azure.cli.core.commands.parameters import ( | ||
tags_type, | ||
resource_group_name_type, | ||
get_location_type | ||
) | ||
from azure.cli.core.commands.validators import get_default_location_from_resource_group | ||
|
||
|
||
def load_arguments(self, _): | ||
|
||
with self.argument_context('windowsiotservices service list') as c: | ||
c.argument('resource_group_name', resource_group_name_type) | ||
|
||
with self.argument_context('windowsiotservices service show') as c: | ||
c.argument('resource_group_name', resource_group_name_type) | ||
c.argument('device_name', type=str, help='The name of the Windows IoT Device Service.', id_part='name') | ||
|
||
with self.argument_context('windowsiotservices service create') as c: | ||
c.argument('resource_group_name', resource_group_name_type) | ||
c.argument('device_name', type=str, help='The name of the Windows IoT Device Service.') | ||
c.argument('if_match', type=str, help='ETag of the Windows IoT Device Service. Do not specify for creating a ' | ||
'new Windows IoT Device Service. Required to update an existing Windows IoT Device Service.') | ||
c.argument('tags', tags_type) | ||
c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, | ||
validator=get_default_location_from_resource_group) | ||
c.argument('etag', type=str, help='The Etag field is *not* required. If it is provided in the response body, ' | ||
'it must also be provided as a header per the normal ETag convention.') | ||
c.argument('notes', type=str, help='Windows IoT Device Service notes.') | ||
c.argument('quantity', type=int, help='Windows IoT Device Service device allocation,') | ||
c.argument('billing_domain_name', type=str, help='Windows IoT Device Service ODM AAD domain') | ||
c.argument('admin_domain_name', type=str, help='Windows IoT Device Service OEM AAD domain') | ||
|
||
with self.argument_context('windowsiotservices service update') as c: | ||
c.argument('resource_group_name', resource_group_name_type) | ||
c.argument('device_name', type=str, help='The name of the Windows IoT Device Service.', id_part='name') | ||
c.argument('if_match', type=str, help='ETag of the Windows IoT Device Service. Do not specify for creating a ' | ||
'brand new Windows IoT Device Service. Required to update an existing Windows IoT Device Service.') | ||
c.argument('tags', tags_type) | ||
c.argument('location', arg_type=get_location_type(self.cli_ctx), required=False, | ||
validator=get_default_location_from_resource_group) | ||
c.argument('etag', type=str, help='The Etag field is *not* required. If it is provided in the response body, ' | ||
'it must also be provided as a header per the normal ETag convention.') | ||
c.argument('notes', type=str, help='Windows IoT Device Service notes.') | ||
c.argument('quantity', type=int, help='Windows IoT Device Service device allocation,') | ||
c.argument('billing_domain_name', type=str, help='Windows IoT Device Service ODM AAD domain') | ||
c.argument('admin_domain_name', type=str, help='Windows IoT Device Service OEM AAD domain') | ||
|
||
with self.argument_context('windowsiotservices service delete') as c: | ||
c.argument('resource_group_name', resource_group_name_type) | ||
c.argument('device_name', type=str, help='The name of the Windows IoT Device Service.', id_part='name') | ||
|
||
with self.argument_context('windowsiotservices service check-device-service-name-availability') as c: | ||
c.argument('name', type=str, help='The name of the Windows IoT Device Service to check.') |
9 changes: 9 additions & 0 deletions
9
src/windowsiot/azext_windowsiotservices/generated/_validators.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,9 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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. | ||
# -------------------------------------------------------------------------- |
10 changes: 10 additions & 0 deletions
10
src/windowsiot/azext_windowsiotservices/generated/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,10 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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=protected-access |
33 changes: 33 additions & 0 deletions
33
src/windowsiot/azext_windowsiotservices/generated/commands.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,33 @@ | ||
# -------------------------------------------------------------------------- | ||
# 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-statements | ||
# pylint: disable=too-many-locals | ||
|
||
from azure.cli.core.commands import CliCommandType | ||
|
||
|
||
def load_command_table(self, _): | ||
|
||
from azext_windowsiotservices.generated._client_factory import cf_service | ||
windowsiotservices_service = CliCommandType( | ||
operations_tmpl='azext_windowsiotservices.vendored_sdks.windowsiot.operations._services_operations#ServicesOper' | ||
'ations.{}', | ||
client_factory=cf_service) | ||
with self.command_group('windowsiotservices service', windowsiotservices_service, client_factory=cf_service) as g: | ||
g.custom_command('list', 'windowsiotservices_service_list') | ||
g.custom_show_command('show', 'windowsiotservices_service_show') | ||
g.custom_command('create', 'windowsiotservices_service_create') | ||
g.custom_command('update', 'windowsiotservices_service_update') | ||
g.custom_command('delete', 'windowsiotservices_service_delete', confirmation=True) | ||
g.custom_command('check-device-service-name-availability', 'windowsiotservices_service_check_device_service_nam' | ||
'e_availability') | ||
|
||
with self.command_group('windowsiotservices', is_experimental=True): | ||
pass |
Oops, something went wrong.