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 windowsiot] Migrate Storage Swaggers to Master #1615

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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/windowsiot/HISTORY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. :changelog:
Release History
===============

0.1.0
++++++
* Initial release.
37 changes: 37 additions & 0 deletions src/windowsiot/README.md
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"
```
50 changes: 50 additions & 0 deletions src/windowsiot/azext_windowsiotservices/__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_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
17 changes: 17 additions & 0 deletions src/windowsiot/azext_windowsiotservices/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/windowsiot/azext_windowsiotservices/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/windowsiot/azext_windowsiotservices/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/windowsiot/azext_windowsiotservices/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,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 src/windowsiot/azext_windowsiotservices/generated/_help.py
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 src/windowsiot/azext_windowsiotservices/generated/_params.py
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.')
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 src/windowsiot/azext_windowsiotservices/generated/action.py
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 src/windowsiot/azext_windowsiotservices/generated/commands.py
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
Loading