44
44
dps_name_type = CLIArgumentType (
45
45
options_list = ['--dps-name' ],
46
46
completer = get_resource_name_completion_list ('Microsoft.Devices/ProvisioningServices' ),
47
- help = 'IoT Provisioning Service name' )
47
+ help = 'IoT Hub Device Provisioning Service name' )
48
48
49
49
app_name_type = CLIArgumentType (
50
50
completer = get_resource_name_completion_list ('Microsoft.IoTCentral/IoTApps' ),
@@ -67,40 +67,78 @@ def load_arguments(self, _): # pylint: disable=too-many-statements
67
67
68
68
with self .argument_context ('iot dps create' ) as c :
69
69
c .argument ('location' , get_location_type (self .cli_ctx ),
70
- help = 'Location of your IoT Provisioning Service. Default is the location of target resource group.' )
70
+ help = 'Location of your IoT Hub Device Provisioning Service. '
71
+ 'Default is the location of target resource group.' )
71
72
c .argument ('sku' , arg_type = get_enum_type (IotDpsSku ),
72
- help = 'Pricing tier for the IoT provisioning service .' )
73
- c .argument ('unit' , help = 'Units in your IoT Provisioning Service.' , type = int )
73
+ help = 'Pricing tier for the IoT Hub Device Provisioning Service .' )
74
+ c .argument ('unit' , help = 'Units in your IoT Hub Device Provisioning Service.' , type = int )
74
75
76
+ # To deprecate
75
77
for subgroup in ['access-policy' , 'linked-hub' , 'certificate' ]:
76
78
with self .argument_context ('iot dps {}' .format (subgroup )) as c :
77
79
c .argument ('dps_name' , options_list = ['--dps-name' ], id_part = None )
78
80
81
+ # To replace deprecated
82
+ for subgroup in ['policy' ]:
83
+ with self .argument_context ('iot dps {}' .format (subgroup )) as c :
84
+ c .argument ('dps_name' , options_list = ['--dps-name' , '-n' ], id_part = None )
85
+
79
86
with self .argument_context ('iot dps access-policy' ) as c :
80
87
c .argument ('access_policy_name' , options_list = ['--access-policy-name' , '--name' , '-n' ],
81
- help = 'A friendly name for DPS access policy.' )
88
+ help = 'A friendly name for DPS shared access policy.' )
82
89
83
90
with self .argument_context ('iot dps access-policy create' ) as c :
84
91
c .argument ('rights' , options_list = ['--rights' , '-r' ], nargs = '+' ,
85
92
arg_type = get_enum_type (AccessRightsDescription ),
86
- help = 'Access rights for the IoT provisioning service. Use space-separated list for multiple rights.' )
93
+ help = 'Access rights for the IoT Hub Device Provisioning Service. '
94
+ 'Use space-separated list for multiple rights.' )
87
95
c .argument ('primary_key' , help = 'Primary SAS key value.' )
88
96
c .argument ('secondary_key' , help = 'Secondary SAS key value.' )
89
97
90
98
with self .argument_context ('iot dps access-policy update' ) as c :
91
99
c .argument ('rights' , options_list = ['--rights' , '-r' ], nargs = '+' ,
92
100
arg_type = get_enum_type (AccessRightsDescription ),
93
- help = 'Access rights for the IoT provisioning service. Use space-separated list for multiple rights.' )
101
+ help = 'Access rights for the IoT Hub Device Provisioning Service. '
102
+ 'Use space-separated list for multiple rights.' )
103
+ c .argument ('primary_key' , help = 'Primary SAS key value.' )
104
+ c .argument ('secondary_key' , help = 'Secondary SAS key value.' )
105
+
106
+ with self .argument_context ('iot dps policy' ) as c :
107
+ c .argument ('access_policy_name' , options_list = ['--policy-name' , '--pn' ],
108
+ help = 'A friendly name for DPS access policy.' )
109
+
110
+ with self .argument_context ('iot dps policy create' ) as c :
111
+ c .argument ('rights' , options_list = ['--rights' , '-r' ], nargs = '+' ,
112
+ arg_type = get_enum_type (AccessRightsDescription ),
113
+ help = 'Access rights for the IoT Hub Device Provisioning Service. '
114
+ 'Use space-separated list for multiple rights.' )
115
+ c .argument ('primary_key' , help = 'Primary SAS key value.' )
116
+ c .argument ('secondary_key' , help = 'Secondary SAS key value.' )
117
+
118
+ with self .argument_context ('iot dps policy update' ) as c :
119
+ c .argument ('rights' , options_list = ['--rights' , '-r' ], nargs = '+' ,
120
+ arg_type = get_enum_type (AccessRightsDescription ),
121
+ help = 'Access rights for the IoT Hub Device Provisioning Service. '
122
+ 'Use space-separated list for multiple rights.' )
94
123
c .argument ('primary_key' , help = 'Primary SAS key value.' )
95
124
c .argument ('secondary_key' , help = 'Secondary SAS key value.' )
96
125
97
126
with self .argument_context ('iot dps linked-hub' ) as c :
98
127
c .argument ('linked_hub' , options_list = ['--linked-hub' ], help = 'Host name of linked IoT Hub.' )
99
128
100
129
with self .argument_context ('iot dps linked-hub create' ) as c :
101
- c .argument ('connection_string' , help = 'Connection string of the IoT hub.' )
130
+ c .argument ('connection_string' ,
131
+ help = 'Connection string of the IoT hub. Required if hub name is not provided using --hub-name.' ,
132
+ arg_group = 'IoT Hub Identifier' )
133
+ c .argument ('hub_name' , help = 'IoT Hub name.' , arg_group = 'IoT Hub Identifier' )
134
+ c .argument ('hub_resource_group' ,
135
+ options_list = ['--hub-resource-group' , '--hrg' ],
136
+ help = 'IoT Hub resource group name.' ,
137
+ arg_group = 'IoT Hub Identifier' )
102
138
c .argument ('location' , get_location_type (self .cli_ctx ),
103
- help = 'Location of the IoT hub.' )
139
+ help = 'Location of the IoT hub.' ,
140
+ arg_group = 'IoT Hub Identifier' ,
141
+ deprecate_info = c .deprecate (hide = True ))
104
142
c .argument ('apply_allocation_policy' ,
105
143
help = 'A boolean indicating whether to apply allocation policy to the IoT hub.' ,
106
144
arg_type = get_three_state_flag ())
@@ -114,7 +152,7 @@ def load_arguments(self, _): # pylint: disable=too-many-statements
114
152
115
153
with self .argument_context ('iot dps allocation-policy update' ) as c :
116
154
c .argument ('allocation_policy' , options_list = ['--policy' , '-p' ], arg_type = get_enum_type (AllocationPolicy ),
117
- help = 'Allocation policy for the IoT provisioning service .' )
155
+ help = 'Allocation policy for the IoT Hub Device Provisioning Service .' )
118
156
119
157
with self .argument_context ('iot dps certificate' ) as c :
120
158
c .argument ('certificate_path' , options_list = ['--path' , '-p' ], type = file_type ,
0 commit comments