|
10 | 10 | # pylint: disable=too-many-lines |
11 | 11 | # pylint: disable=too-many-statements |
12 | 12 |
|
13 | | -from knack.arguments import CLIArgumentType |
14 | | -from azure.cli.core.commands.parameters import ( |
15 | | - resource_group_name_type, |
16 | | - get_location_type |
17 | | -) |
18 | | -from azure.cli.core.commands.validators import get_default_location_from_resource_group |
19 | | -from azext_guestconfig.action import ( |
20 | | - AddGuestConfigurationConfigurationParameter, |
21 | | - AddGuestConfigurationConfigurationSetting |
22 | | -) |
| 13 | +from azure.cli.core.commands.parameters import resource_group_name_type |
23 | 14 |
|
24 | 15 |
|
25 | 16 | def load_arguments(self, _): |
26 | 17 |
|
27 | 18 | with self.argument_context('guestconfig guest-configuration-assignment list') as c: |
28 | 19 | c.argument('resource_group_name', resource_group_name_type) |
29 | | - c.argument('vm_name', help='The name of the virtual machine.') |
| 20 | + c.argument('vm_name', type=str, help='The name of the virtual machine.') |
30 | 21 |
|
31 | 22 | with self.argument_context('guestconfig guest-configuration-assignment show') as c: |
32 | 23 | c.argument('resource_group_name', resource_group_name_type) |
33 | | - c.argument('guest_configuration_assignment_name', options_list=['--name', '-n'], help='The guest configuration ' |
34 | | - 'assignment name.', id_part='child_name_1') |
35 | | - c.argument('vm_name', help='The name of the virtual machine.', id_part='name') |
36 | | - |
37 | | - with self.argument_context('guestconfig guest-configuration-assignment create') as c: |
38 | | - c.argument('guest_configuration_assignment_name', help='Name of the guest configuration assignment.') |
39 | | - c.argument('resource_group_name', resource_group_name_type) |
40 | | - c.argument('vm_name', help='The name of the virtual machine.') |
41 | | - c.argument('name', help='Name of the guest configuration assignment.') |
42 | | - c.argument('location', arg_type=get_location_type(self.cli_ctx), |
43 | | - validator=get_default_location_from_resource_group) |
44 | | - c.argument('context', help='The source which initiated the guest configuration assignment. Ex: Azure Policy') |
45 | | - c.argument('latest_assignment_report_assignment', arg_type=CLIArgumentType(options_list=['--latest-assignment-r' |
46 | | - 'eport-assignment'], help='Configuration details of the guest configuration assignment. Expected val' 'ue: json-string/@json-file.')) |
47 | | - c.argument('guest_configuration_name', help='Name of the guest configuration.') |
48 | | - c.argument('guest_configuration_version', help='Version of the guest configuration.') |
49 | | - c.argument('guest_configuration_configuration_parameter', action=AddGuestConfigurationConfigurationParameter, |
50 | | - nargs='+', help='The configuration parameters for the guest configuration.') |
51 | | - c.argument('guest_configuration_configuration_setting', action=AddGuestConfigurationConfigurationSetting, |
52 | | - nargs='+', help='The configuration setting for the guest configuration.') |
53 | | - |
54 | | - with self.argument_context('guestconfig guest-configuration-assignment update') as c: |
55 | | - c.argument('guest_configuration_assignment_name', help='Name of the guest configuration assignment.', id_part='child_name_1') |
56 | | - c.argument('resource_group_name', resource_group_name_type) |
57 | | - c.argument('vm_name', help='The name of the virtual machine.', id_part='name') |
58 | | - c.argument('name', help='Name of the guest configuration assignment.') |
59 | | - c.argument('location', arg_type=get_location_type(self.cli_ctx), |
60 | | - validator=get_default_location_from_resource_group) |
61 | | - c.argument('context', help='The source which initiated the guest configuration assignment. Ex: Azure Policy') |
62 | | - c.argument('latest_assignment_report_assignment', arg_type=CLIArgumentType(options_list=['--latest-assignment-r' |
63 | | - 'eport-assignment'], help='Configuration details of the guest configuration assignment. Expected val' 'ue: json-string/@json-file.')) |
64 | | - c.argument('guest_configuration_name', help='Name of the guest configuration.') |
65 | | - c.argument('guest_configuration_version', help='Version of the guest configuration.') |
66 | | - c.argument('guest_configuration_configuration_parameter', action=AddGuestConfigurationConfigurationParameter, |
67 | | - nargs='+', help='The configuration parameters for the guest configuration.') |
68 | | - c.argument('guest_configuration_configuration_setting', action=AddGuestConfigurationConfigurationSetting, |
69 | | - nargs='+', help='The configuration setting for the guest configuration.') |
70 | | - |
71 | | - with self.argument_context('guestconfig guest-configuration-assignment delete') as c: |
72 | | - c.argument('resource_group_name', resource_group_name_type) |
73 | | - c.argument('guest_configuration_assignment_name', options_list=['--name', '-n'], help='Name of the guest config' |
74 | | - 'uration assignment', id_part='child_name_1') |
75 | | - c.argument('vm_name', help='The name of the virtual machine.', id_part='name') |
76 | | - |
77 | | - with self.argument_context('guestconfig guest-configuration-assignment wait') as c: |
78 | | - c.argument('resource_group_name', resource_group_name_type) |
79 | | - c.argument('guest_configuration_assignment_name', options_list=['--name', '-n'], help='The guest configuration ' |
80 | | - 'assignment name.', id_part='child_name_1') |
81 | | - c.argument('vm_name', help='The name of the virtual machine.', id_part='name') |
| 24 | + c.argument('guest_configuration_assignment_name', options_list=['--name', '-n', |
| 25 | + '--guest-configuration-assignment-name'], |
| 26 | + type=str, help='The guest configuration assignment name.', id_part='child_name_1') |
| 27 | + c.argument('vm_name', type=str, help='The name of the virtual machine.', id_part='name') |
82 | 28 |
|
83 | 29 | with self.argument_context('guestconfig guest-configuration-assignment-report list') as c: |
84 | 30 | c.argument('resource_group_name', resource_group_name_type) |
85 | | - c.argument('guest_configuration_assignment_name', help='The guest configuration assignment name.') |
86 | | - c.argument('vm_name', help='The name of the virtual machine.') |
| 31 | + c.argument('guest_configuration_assignment_name', type=str, help='The guest configuration assignment name.') |
| 32 | + c.argument('vm_name', type=str, help='The name of the virtual machine.') |
87 | 33 |
|
88 | 34 | with self.argument_context('guestconfig guest-configuration-assignment-report show') as c: |
89 | 35 | c.argument('resource_group_name', resource_group_name_type) |
90 | | - c.argument('guest_configuration_assignment_name', help='The guest configuration assignment name.', id_part='chi' |
91 | | - 'ld_name_1') |
92 | | - c.argument('report_id', help='The GUID for the guest configuration assignment report.', |
| 36 | + c.argument('guest_configuration_assignment_name', type=str, help='The guest configuration assignment name.', |
| 37 | + id_part='child_name_1') |
| 38 | + c.argument('report_id', type=str, help='The GUID for the guest configuration assignment report.', |
93 | 39 | id_part='child_name_2') |
94 | | - c.argument('vm_name', help='The name of the virtual machine.', id_part='name') |
| 40 | + c.argument('vm_name', type=str, help='The name of the virtual machine.', id_part='name') |
95 | 41 |
|
96 | 42 | with self.argument_context('guestconfig guest-configuration-hcrp-assignment list') as c: |
97 | 43 | c.argument('resource_group_name', resource_group_name_type) |
98 | | - c.argument('machine_name', help='The name of the ARC machine.') |
| 44 | + c.argument('machine_name', type=str, help='The name of the ARC machine.') |
99 | 45 |
|
100 | 46 | with self.argument_context('guestconfig guest-configuration-hcrp-assignment show') as c: |
101 | 47 | c.argument('resource_group_name', resource_group_name_type) |
102 | | - c.argument('guest_configuration_assignment_name', help='The guest configuration assignment name.', id_part='chi' |
103 | | - 'ld_name_1') |
104 | | - c.argument('machine_name', help='The name of the ARC machine.', id_part='name') |
105 | | - |
106 | | - with self.argument_context('guestconfig guest-configuration-hcrp-assignment create') as c: |
107 | | - c.argument('guest_configuration_assignment_name', help='Name of the guest configuration assignment.') |
108 | | - c.argument('resource_group_name', resource_group_name_type) |
109 | | - c.argument('machine_name', help='The name of the ARC machine.') |
110 | | - c.argument('name', help='Name of the guest configuration assignment.') |
111 | | - c.argument('location', arg_type=get_location_type(self.cli_ctx), |
112 | | - validator=get_default_location_from_resource_group) |
113 | | - c.argument('context', help='The source which initiated the guest configuration assignment. Ex: Azure Policy') |
114 | | - c.argument('latest_assignment_report_assignment', arg_type=CLIArgumentType(options_list=['--latest-assignment-r' |
115 | | - 'eport-assignment'], help='Configuration details of the guest configuration assignment. Expected val' 'ue: json-string/@json-file.')) |
116 | | - c.argument('guest_configuration_name', help='Name of the guest configuration.') |
117 | | - c.argument('guest_configuration_version', help='Version of the guest configuration.') |
118 | | - c.argument('guest_configuration_configuration_parameter', action=AddGuestConfigurationConfigurationParameter, |
119 | | - nargs='+', help='The configuration parameters for the guest configuration.') |
120 | | - c.argument('guest_configuration_configuration_setting', action=AddGuestConfigurationConfigurationSetting, |
121 | | - nargs='+', help='The configuration setting for the guest configuration.') |
122 | | - |
123 | | - with self.argument_context('guestconfig guest-configuration-hcrp-assignment update') as c: |
124 | | - c.argument('guest_configuration_assignment_name', help='Name of the guest configuration assignment.', id_part='child_name_1') |
125 | | - c.argument('resource_group_name', resource_group_name_type) |
126 | | - c.argument('machine_name', help='The name of the ARC machine.', id_part='name') |
127 | | - c.argument('name', help='Name of the guest configuration assignment.') |
128 | | - c.argument('location', arg_type=get_location_type(self.cli_ctx), |
129 | | - validator=get_default_location_from_resource_group) |
130 | | - c.argument('context', help='The source which initiated the guest configuration assignment. Ex: Azure Policy') |
131 | | - c.argument('latest_assignment_report_assignment', arg_type=CLIArgumentType(options_list=['--latest-assignment-r' |
132 | | - 'eport-assignment'], help='Configuration details of the guest configuration assignment. Expected val' 'ue: json-string/@json-file.')) |
133 | | - c.argument('guest_configuration_name', help='Name of the guest configuration.') |
134 | | - c.argument('guest_configuration_version', help='Version of the guest configuration.') |
135 | | - c.argument('guest_configuration_configuration_parameter', action=AddGuestConfigurationConfigurationParameter, |
136 | | - nargs='+', help='The configuration parameters for the guest configuration.') |
137 | | - c.argument('guest_configuration_configuration_setting', action=AddGuestConfigurationConfigurationSetting, |
138 | | - nargs='+', help='The configuration setting for the guest configuration.') |
139 | | - |
140 | | - with self.argument_context('guestconfig guest-configuration-hcrp-assignment delete') as c: |
141 | | - c.argument('resource_group_name', resource_group_name_type) |
142 | | - c.argument('guest_configuration_assignment_name', help='Name of the guest configuration assignment', id_part='c' |
143 | | - 'hild_name_1') |
144 | | - c.argument('machine_name', help='The name of the ARC machine.', id_part='name') |
145 | | - |
146 | | - with self.argument_context('guestconfig guest-configuration-hcrp-assignment wait') as c: |
147 | | - c.argument('resource_group_name', resource_group_name_type) |
148 | | - c.argument('guest_configuration_assignment_name', help='The guest configuration assignment name.', id_part='chi' |
149 | | - 'ld_name_1') |
150 | | - c.argument('machine_name', help='The name of the ARC machine.', id_part='name') |
| 48 | + c.argument('guest_configuration_assignment_name', type=str, help='The guest configuration assignment name.', |
| 49 | + id_part='child_name_1') |
| 50 | + c.argument('machine_name', type=str, help='The name of the ARC machine.', id_part='name') |
151 | 51 |
|
152 | 52 | with self.argument_context('guestconfig guest-configuration-hcrp-assignment-report list') as c: |
153 | 53 | c.argument('resource_group_name', resource_group_name_type) |
154 | | - c.argument('guest_configuration_assignment_name', help='The guest configuration assignment name.') |
155 | | - c.argument('machine_name', help='The name of the ARC machine.') |
| 54 | + c.argument('guest_configuration_assignment_name', type=str, help='The guest configuration assignment name.') |
| 55 | + c.argument('machine_name', type=str, help='The name of the ARC machine.') |
156 | 56 |
|
157 | 57 | with self.argument_context('guestconfig guest-configuration-hcrp-assignment-report show') as c: |
158 | 58 | c.argument('resource_group_name', resource_group_name_type) |
159 | | - c.argument('guest_configuration_assignment_name', help='The guest configuration assignment name.', id_part='chi' |
160 | | - 'ld_name_1') |
161 | | - c.argument('report_id', help='The GUID for the guest configuration assignment report.', |
| 59 | + c.argument('guest_configuration_assignment_name', type=str, help='The guest configuration assignment name.', |
| 60 | + id_part='child_name_1') |
| 61 | + c.argument('report_id', type=str, help='The GUID for the guest configuration assignment report.', |
162 | 62 | id_part='child_name_2') |
163 | | - c.argument('machine_name', help='The name of the ARC machine.', id_part='name') |
| 63 | + c.argument('machine_name', type=str, help='The name of the ARC machine.', id_part='name') |
0 commit comments