Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.
Closed
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.
5 changes: 5 additions & 0 deletions src/windowsiot/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Microsoft Azure CLI 'windowsiotservices' Extension
==========================================

This package is for the 'windowsiotservices' extension.
i.e. 'az windowsiotservices'
46 changes: 46 additions & 0 deletions src/windowsiot/azext_windowsiotservices/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# --------------------------------------------------------------------------
# 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


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
windowsiotservices_custom = CliCommandType(
operations_tmpl='azext_windowsiotservices.custom#{}',
client_factory=cf_windowsiotservices)
super(DeviceServicesCommandsLoader, self).__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.3.1"
}
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,19 @@
# --------------------------------------------------------------------------
# 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(cli_ctx, *_):
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from ..vendored_sdks.windowsiot import DeviceServices
return get_mgmt_service_client(cli_ctx, DeviceServices)


def cf_service(cli_ctx, *_):
return cf_windowsiotservices(cli_ctx).service
78 changes: 78 additions & 0 deletions src/windowsiot/azext_windowsiotservices/generated/_help.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# --------------------------------------------------------------------------
# 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: windowsiotservices service
"""

helps['windowsiotservices service list'] = """
type: command
short-summary: Get all the IoT hubs in a subscription.
examples:
- name: Service_ListByResourceGroup
text: |-
az windowsiotservices service list --resource-group "res6117"
"""

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 or update the metadata of a Windows IoT Device Service. The usual pattern to modify a propert\
y 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" --admin-domain-name "d.e.f" --billing-d\
omain-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 r\
etrieve the Windows IoT Device Service metadata and security metadata, and then combine them with the modified values i\
n a new body to update the Windows IoT Device Service.
examples:
- name: Service_Update
text: |-
az windowsiotservices service update --device-name "service8596" --admin-domain-name "d.e.f" --billing-d\
omain-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"
"""
51 changes: 51 additions & 0 deletions src/windowsiot/azext_windowsiotservices/generated/_params.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# --------------------------------------------------------------------------
# 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 knack.arguments import CLIArgumentType
from azure.cli.core.commands.parameters import resource_group_name_type


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', help='The name of the Windows IoT Device Service.')

with self.argument_context('windowsiotservices service create') as c:
c.argument('resource_group_name', resource_group_name_type)
c.argument('device_name', help='The name of the Windows IoT Device Service.')
c.argument('if_match', 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('notes', help='Windows IoT Device Service notes.')
c.argument('quantity', help='Windows IoT Device Service device allocation,')
c.argument('billing_domain_name', help='Windows IoT Device Service ODM AAD domain')
c.argument('admin_domain_name', 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', help='The name of the Windows IoT Device Service.')
c.argument('if_match', help='ETag of the Windows IoT Device Service. Do not specify for creating a brand new Wi'
'ndows IoT Device Service. Required to update an existing Windows IoT Device Service.')
c.argument('notes', help='Windows IoT Device Service notes.')
c.argument('quantity', help='Windows IoT Device Service device allocation,')
c.argument('billing_domain_name', help='Windows IoT Device Service ODM AAD domain')
c.argument('admin_domain_name', 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', help='The name of the Windows IoT Device Service.')

with self.argument_context('windowsiotservices service check-device-service-name-availability') as c:
c.argument('name', help='The name of the Windows IoT Device Service to check.')
23 changes: 23 additions & 0 deletions src/windowsiot/azext_windowsiotservices/generated/_validators.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# --------------------------------------------------------------------------
# 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 example_name_or_id_validator(cmd, namespace):
from azure.cli.core.commands.client_factory import get_subscription_id
from msrestazure.tools import is_valid_resource_id, resource_id
if namespace.storage_account:
if not is_valid_resource_id(namespace.RESOURCE):
namespace.storage_account = resource_id(
subscription=get_subscription_id(cmd.cli_ctx),
resource_group=namespace.resource_group_name,
namespace='Microsoft.Storage',
type='storageAccounts',
name=namespace.storage_account
)
14 changes: 14 additions & 0 deletions src/windowsiot/azext_windowsiotservices/generated/action.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# --------------------------------------------------------------------------
# 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

import argparse
from knack.util import CLIError
from collections import defaultdict
29 changes: 29 additions & 0 deletions src/windowsiot/azext_windowsiotservices/generated/commands.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# --------------------------------------------------------------------------
# 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.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._service_operations#ServiceOperat'
'ions.{}',
client_factory=cf_service)
with self.command_group('windowsiotservices service', windowsiotservices_service, client_factory=cf_service,
is_experimental=True) 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')
g.custom_command('check-device-service-name-availability', 'windowsiotservices_service_check_device_service_nam'
'e_availability')
Loading