Skip to content

Commit 5b621d4

Browse files
committed
Remove deprecated Job commands
1 parent 6448a34 commit 5b621d4

24 files changed

+9510
-6326
lines changed

src/azure-cli/azure/cli/command_modules/iot/_help.py

Lines changed: 0 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -428,38 +428,6 @@
428428
az iot hub devicestream show -n MyIotHub
429429
"""
430430

431-
helps['iot hub job'] = """
432-
type: group
433-
short-summary: Manage jobs in an IoT hub.
434-
"""
435-
436-
helps['iot hub job cancel'] = """
437-
type: command
438-
short-summary: Cancel a job in an IoT hub.
439-
examples:
440-
- name: Cancel a job in an IoT hub. (autogenerated)
441-
text: az iot hub job cancel --hub-name MyHub --job-id JobId
442-
crafted: true
443-
"""
444-
445-
helps['iot hub job list'] = """
446-
type: command
447-
short-summary: List the jobs in an IoT hub.
448-
examples:
449-
- name: List the jobs in an IoT hub. (autogenerated)
450-
text: az iot hub job list --hub-name MyHub
451-
crafted: true
452-
"""
453-
454-
helps['iot hub job show'] = """
455-
type: command
456-
short-summary: Get the details of a job in an IoT hub.
457-
examples:
458-
- name: Get the details of a job in an IoT hub. (autogenerated)
459-
text: az iot hub job show --hub-name MyHub --job-id JobId
460-
crafted: true
461-
"""
462-
463431
helps['iot hub list'] = """
464432
type: command
465433
short-summary: List IoT hubs.

src/azure-cli/azure/cli/command_modules/iot/_params.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def load_arguments(self, _): # pylint: disable=too-many-statements
177177
help='The amount of time a SAS URI generated by IoT Hub is valid before it expires,'
178178
' between 1 and 24 hours.')
179179

180-
for subgroup in ['consumer-group', 'policy', 'job', 'certificate', 'routing-endpoint', 'route']:
180+
for subgroup in ['consumer-group', 'policy', 'certificate', 'routing-endpoint', 'route']:
181181
with self.argument_context('iot hub {}'.format(subgroup)) as c:
182182
c.argument('hub_name', options_list=['--hub-name'])
183183

@@ -255,9 +255,6 @@ def load_arguments(self, _): # pylint: disable=too-many-statements
255255
c.argument('regenerate_key', options_list=['--renew-key', '--rk'], arg_type=get_enum_type(RenewKeyType),
256256
help='Regenerate keys')
257257

258-
with self.argument_context('iot hub job') as c:
259-
c.argument('job_id', id_part='child_name_1', help='Job Id.')
260-
261258
with self.argument_context('iot hub create') as c:
262259
c.argument('hub_name', completer=None)
263260
c.argument('location', get_location_type(self.cli_ctx),

src/azure-cli/azure/cli/command_modules/iot/commands.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,13 +125,6 @@ def load_command_table(self, _): # pylint: disable=too-many-statements
125125
g.custom_command('delete', 'iot_hub_policy_delete', transform=PolicyUpdateResultTransform(self.cli_ctx))
126126
g.custom_command('renew-key', 'iot_hub_policy_key_renew', supports_no_wait=True)
127127

128-
# iot hub job commands
129-
with self.command_group('iot hub job', deprecate_info=self.deprecate(redirect=JOB_DEPRECATION_INFO),
130-
client_factory=iot_hub_service_factory) as g:
131-
g.custom_command('list', 'iot_hub_job_list')
132-
g.custom_command('show', 'iot_hub_job_get')
133-
g.custom_command('cancel', 'iot_hub_job_cancel')
134-
135128
# iot hub routing endpoint commands
136129
with self.command_group('iot hub routing-endpoint', client_factory=iot_hub_service_factory) as g:
137130
g.custom_command('create', 'iot_hub_routing_endpoint_create',

src/azure-cli/azure/cli/command_modules/iot/custom.py

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@
4343
from azure.mgmt.iotcentral.models import (AppSkuInfo,
4444
App)
4545

46-
from azure.cli.command_modules.iot.mgmt_iot_hub_device.lib.iot_hub_device_client import IotHubDeviceClient
47-
from azure.cli.command_modules.iot.sas_token_auth import SasTokenAuthentication
4846
from azure.cli.command_modules.iot.shared import EndpointType, EncodingFormat, RenewKeyType, AuthenticationType
4947
from ._constants import PNP_ENDPOINT
5048
from ._client_factory import resource_service_factory, get_pnp_client
@@ -662,21 +660,6 @@ def _is_policy_existed(policies, policy_name):
662660
return policy_name.lower() in policy_set
663661

664662

665-
def iot_hub_job_list(client, hub_name, resource_group_name=None):
666-
resource_group_name = _ensure_resource_group_name(client, resource_group_name, hub_name)
667-
return client.iot_hub_resource.list_jobs(resource_group_name, hub_name)
668-
669-
670-
def iot_hub_job_get(client, hub_name, job_id, resource_group_name=None):
671-
resource_group_name = _ensure_resource_group_name(client, resource_group_name, hub_name)
672-
return client.iot_hub_resource.get_job(resource_group_name, hub_name, job_id)
673-
674-
675-
def iot_hub_job_cancel(client, hub_name, job_id, resource_group_name=None):
676-
device_client = _get_device_client(client, resource_group_name, hub_name, '')
677-
return device_client.cancel_job(job_id)
678-
679-
680663
def iot_hub_get_quota_metrics(client, hub_name, resource_group_name=None):
681664
resource_group_name = _ensure_resource_group_name(client, resource_group_name, hub_name)
682665
iotHubQuotaMetricCollection = []
@@ -1025,17 +1008,6 @@ def _pnp_create_update_authkeys(cmd, client, repo_endpoint, repo_id, user_role,
10251008
custom_headers=headers)
10261009

10271010

1028-
def _get_device_client(client, resource_group_name, hub_name, device_id):
1029-
resource_group_name = _ensure_resource_group_name(client, resource_group_name, hub_name)
1030-
# Intermediate fix to support domains beyond azure-devices.net
1031-
hub = _get_iot_hub_by_name(client, hub_name)
1032-
base_url = hub.properties.host_name
1033-
uri = '{0}/devices/{1}'.format(base_url, device_id)
1034-
access_policy = iot_hub_policy_get(client, hub_name, 'iothubowner', resource_group_name)
1035-
creds = SasTokenAuthentication(uri, access_policy.key_name, access_policy.primary_key)
1036-
return IotHubDeviceClient(creds, client.iot_hub_resource.config.subscription_id, base_url='https://' + base_url).iot_hub_devices
1037-
1038-
10391011
def _get_iot_hub_by_name(client, hub_name):
10401012
all_hubs = iot_hub_list(client)
10411013
if all_hubs is None:

src/azure-cli/azure/cli/command_modules/iot/mgmt_iot_hub_device/__init__.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/azure-cli/azure/cli/command_modules/iot/mgmt_iot_hub_device/lib/__init__.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

src/azure-cli/azure/cli/command_modules/iot/mgmt_iot_hub_device/lib/credentials.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

src/azure-cli/azure/cli/command_modules/iot/mgmt_iot_hub_device/lib/exceptions.py

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/azure-cli/azure/cli/command_modules/iot/mgmt_iot_hub_device/lib/iot_hub_device_client.py

Lines changed: 0 additions & 117 deletions
This file was deleted.

src/azure-cli/azure/cli/command_modules/iot/mgmt_iot_hub_device/lib/models/__init__.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)