Make resource delete return the server response. (#1986)

This commit is contained in:
Travis Prescott 2017-02-06 15:27:14 -08:00 коммит произвёл GitHub
Родитель 7cea31e049
Коммит f2819e212d
4 изменённых файлов: 382 добавлений и 281 удалений

Просмотреть файл

@ -344,6 +344,9 @@
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_vpn_connection\lib\version.py" /> <Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_vpn_connection\lib\version.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_vpn_connection\lib\vpn_connection_creation_client.py" /> <Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_vpn_connection\lib\vpn_connection_creation_client.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_vpn_connection\lib\__init__.py" /> <Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_vpn_connection\lib\__init__.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\test_dns_zone_import.py">
<SubType>Code</SubType>
</Compile>
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\test_network_commands.py" /> <Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\test_network_commands.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\__init__.py" /> <Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\__init__.py" />
<Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\zone_file\configs.py" /> <Compile Include="command_modules\azure-cli-network\azure\cli\command_modules\network\zone_file\configs.py" />
@ -715,6 +718,7 @@
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_vpn_connection\lib\operations\" /> <Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_vpn_connection\lib\operations\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_express_route_circuit\" /> <Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_express_route_circuit\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_traffic_manager_profile\" /> <Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_traffic_manager_profile\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\zone_files\" />
<Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\zone_file\" /> <Folder Include="command_modules\azure-cli-network\azure\cli\command_modules\network\zone_file\" />
<Folder Include="command_modules\azure-cli-redis\" /> <Folder Include="command_modules\azure-cli-redis\" />
<Folder Include="command_modules\azure-cli-redis\azure\" /> <Folder Include="command_modules\azure-cli-redis\azure\" />
@ -829,7 +833,13 @@
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_vpn_connection\azuredeploy.json" /> <Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_vpn_connection\azuredeploy.json" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_vpn_connection\swagger_create_vpn_connection.json" /> <Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\mgmt_vpn_connection\swagger_create_vpn_connection.json" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\TestCert.pfx" /> <Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\TestCert.pfx" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\zone.txt" /> <Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\zone_files\merge1.txt" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\zone_files\merge2.txt" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\zone_files\zone1.txt" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\zone_files\zone2.txt" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\zone_files\zone3.txt" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\zone_files\zone4.txt" />
<Content Include="command_modules\azure-cli-network\azure\cli\command_modules\network\tests\zone_files\zone5.txt" />
<Content Include="command_modules\azure-cli-resource\azure\cli\command_modules\resource\tests\sample_policy_rule.json" /> <Content Include="command_modules\azure-cli-resource\azure\cli\command_modules\resource\tests\sample_policy_rule.json" />
<Content Include="command_modules\azure-cli-resource\azure\cli\command_modules\resource\tests\simple_deploy.json" /> <Content Include="command_modules\azure-cli-resource\azure\cli\command_modules\resource\tests\simple_deploy.json" />
<Content Include="command_modules\azure-cli-resource\azure\cli\command_modules\resource\tests\simple_deploy_parameters.json" /> <Content Include="command_modules\azure-cli-resource\azure\cli\command_modules\resource\tests\simple_deploy_parameters.json" />

Просмотреть файл

@ -22,10 +22,8 @@ from azure.cli.command_modules.resource._client_factory import (_resource_client
def transform_resource_group_list(result): def transform_resource_group_list(result):
return [OrderedDict([('Name', r['name']), \ return [OrderedDict([('Name', r['name']), \
('Location', r['location']), ('Status', r['properties']['provisioningState'])]) for r in result] ('Location', r['location']), ('Status', r['properties']['provisioningState'])]) for r in result]
cli_command(__name__, 'group delete',
'azure.mgmt.resource.resources.operations.resource_groups_operations#ResourceGroupsOperations.delete', cli_command(__name__, 'group delete', 'azure.mgmt.resource.resources.operations.resource_groups_operations#ResourceGroupsOperations.delete', cf_resource_groups, no_wait_param='raw', confirmation=True)
cf_resource_groups,
no_wait_param='raw', confirmation=True)
cli_generic_wait_command(__name__, 'group wait', 'azure.mgmt.resource.resources.operations.resource_groups_operations#ResourceGroupsOperations.get', cf_resource_groups) cli_generic_wait_command(__name__, 'group wait', 'azure.mgmt.resource.resources.operations.resource_groups_operations#ResourceGroupsOperations.get', cf_resource_groups)
cli_command(__name__, 'group show', 'azure.mgmt.resource.resources.operations.resource_groups_operations#ResourceGroupsOperations.get', cf_resource_groups) cli_command(__name__, 'group show', 'azure.mgmt.resource.resources.operations.resource_groups_operations#ResourceGroupsOperations.get', cf_resource_groups)
cli_command(__name__, 'group exists', 'azure.mgmt.resource.resources.operations.resource_groups_operations#ResourceGroupsOperations.check_existence', cf_resource_groups) cli_command(__name__, 'group exists', 'azure.mgmt.resource.resources.operations.resource_groups_operations#ResourceGroupsOperations.check_existence', cf_resource_groups)
@ -115,5 +113,3 @@ cli_command(__name__, 'lock delete', 'azure.cli.command_modules.resource.custom#
cli_command(__name__, 'lock list', 'azure.cli.command_modules.resource.custom#list_locks') cli_command(__name__, 'lock list', 'azure.cli.command_modules.resource.custom#list_locks')
cli_command(__name__, 'lock show', 'azure.cli.command_modules.resource.custom#get_lock') cli_command(__name__, 'lock show', 'azure.cli.command_modules.resource.custom#get_lock')
cli_command(__name__, 'lock update', 'azure.cli.command_modules.resource.custom#update_lock') cli_command(__name__, 'lock update', 'azure.cli.command_modules.resource.custom#update_lock')

Просмотреть файл

@ -151,7 +151,7 @@ def delete_resource(resource_group_name=None, resource_provider_namespace=None,
res = _ResourceUtils(resource_group_name, resource_provider_namespace, res = _ResourceUtils(resource_group_name, resource_provider_namespace,
parent_resource_path, resource_type, resource_name, parent_resource_path, resource_type, resource_name,
resource_id, api_version) resource_id, api_version)
res.delete() return res.delete()
def tag_resource(tags, resource_group_name=None, resource_provider_namespace=None, def tag_resource(tags, resource_group_name=None, resource_provider_namespace=None,
parent_resource_path=None, resource_type=None, resource_name=None, parent_resource_path=None, resource_type=None, resource_name=None,
@ -560,14 +560,14 @@ class _ResourceUtils(object): #pylint: disable=too-many-instance-attributes
def delete(self): def delete(self):
if self.resource_id: if self.resource_id:
self.rcf.resources.delete_by_id(self.resource_id, self.api_version) return self.rcf.resources.delete_by_id(self.resource_id, self.api_version)
else: else:
self.rcf.resources.delete(self.resource_group_name, return self.rcf.resources.delete(self.resource_group_name,
self.resource_provider_namespace, self.resource_provider_namespace,
self.parent_resource_path or '', self.parent_resource_path or '',
self.resource_type, self.resource_type,
self.resource_name, self.resource_name,
self.api_version) self.api_version)
def tag(self, tags): def tag(self, tags):
resource = self.get_resource() resource = self.get_resource()

Разница между файлами не показана из-за своего большого размера Загрузить разницу