azure_mgmt_resources 0.14.0 → 0.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +6 -3
- data/lib/2016-02-01/generated/azure_mgmt_resources.rb +79 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/deployment_operations.rb +331 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/deployments.rb +1000 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/alias_path_type.rb +62 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/alias_type.rb +63 -0
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/basic_dependency.rb +1 -1
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/debug_setting.rb +45 -0
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/dependency.rb +1 -1
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment.rb +45 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +45 -0
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/deployment_extended.rb +1 -1
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/deployment_extended_filter.rb +1 -1
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +94 -0
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/deployment_mode.rb +1 -1
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_operation.rb +65 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +117 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +94 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_properties.rb +103 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +179 -0
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/deployment_validate_result.rb +1 -1
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/export_template_request.rb +65 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/generic_resource.rb +142 -0
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/generic_resource_filter.rb +1 -1
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/http_message.rb +45 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/identity.rb +68 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/parameters_link.rb +55 -0
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/plan.rb +1 -1
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/provider.rb +83 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/provider_list_result.rb +94 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +115 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/resource.rb +95 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/resource_group.rb +97 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +56 -0
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/resource_group_filter.rb +1 -1
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +94 -0
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/resource_group_properties.rb +1 -1
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/resource_identity_type.rb +1 -1
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/resource_list_result.rb +94 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +83 -0
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +1 -1
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/resources_move_info.rb +61 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/sku.rb +94 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/sub_resource.rb +45 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/tag_count.rb +54 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/tag_details.rb +83 -0
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/tag_value.rb +1 -1
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/tags_list_result.rb +94 -0
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/models/target_resource.rb +1 -1
- data/lib/2016-02-01/generated/azure_mgmt_resources/models/template_link.rb +55 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/providers.rb +507 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/resource_groups.rb +1067 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/resource_management_client.rb +151 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/resources.rb +805 -0
- data/lib/2016-02-01/generated/azure_mgmt_resources/tags.rb +568 -0
- data/lib/{generated → 2016-02-01/generated}/azure_mgmt_resources/version.rb +2 -2
- data/lib/2016-07-01/generated/azure_mgmt_resources.rb +79 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/deployment_operations.rb +331 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/deployments.rb +1000 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/alias_path_type.rb +61 -0
- data/lib/{generated → 2016-07-01/generated}/azure_mgmt_resources/models/alias_type.rb +1 -1
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/basic_dependency.rb +64 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/debug_setting.rb +45 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/dependency.rb +82 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment.rb +45 -0
- data/lib/{generated → 2016-07-01/generated}/azure_mgmt_resources/models/deployment_export_result.rb +1 -1
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_extended.rb +65 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +44 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_list_result.rb +94 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_operation.rb +65 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +117 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +94 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_properties.rb +103 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +179 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +57 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/export_template_request.rb +65 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/generic_resource.rb +142 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +64 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/http_message.rb +45 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/identity.rb +68 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/parameters_link.rb +55 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/plan.rb +74 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/provider.rb +83 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/provider_list_result.rb +94 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/provider_resource_type.rb +115 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource.rb +95 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_group.rb +97 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +56 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +54 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_group_list_result.rb +94 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +45 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +15 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_list_result.rb +94 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +83 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +85 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/resources_move_info.rb +61 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/sku.rb +94 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/sub_resource.rb +45 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/tag_count.rb +54 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/tag_details.rb +83 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/tag_value.rb +65 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/tags_list_result.rb +94 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/target_resource.rb +64 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/models/template_link.rb +55 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/providers.rb +507 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/resource_groups.rb +1067 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/resource_management_client.rb +151 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/resources.rb +805 -0
- data/lib/2016-07-01/generated/azure_mgmt_resources/tags.rb +568 -0
- data/lib/{generated/azure_mgmt_resources/module_definition.rb → 2016-07-01/generated/azure_mgmt_resources/version.rb} +3 -3
- data/lib/2016-09-01/generated/azure_mgmt_resources.rb +79 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/deployment_operations.rb +4 -4
- data/lib/2016-09-01/generated/azure_mgmt_resources/deployments.rb +1086 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/alias_path_type.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/alias_type.rb +62 -0
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/basic_dependency.rb +64 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/debug_setting.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/dependency.rb +82 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/deployment.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/deployment_export_result.rb +44 -0
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/deployment_extended.rb +65 -0
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +44 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/deployment_list_result.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/deployment_operation.rb +1 -1
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/deployment_operation_properties.rb +1 -1
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/deployment_operations_list_result.rb +1 -1
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/deployment_properties.rb +1 -1
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/deployment_properties_extended.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/deployment_validate_result.rb +57 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/export_template_request.rb +1 -1
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/generic_resource.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/generic_resource_filter.rb +64 -0
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/http_message.rb +45 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/identity.rb +1 -1
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/parameters_link.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/plan.rb +74 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/provider.rb +1 -1
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/provider_list_result.rb +1 -1
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/provider_resource_type.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource.rb +95 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/resource_group.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_group_export_result.rb +56 -0
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_group_filter.rb +54 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/resource_group_list_result.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_group_properties.rb +45 -0
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_identity_type.rb +15 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/resource_list_result.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_management_error_with_details.rb +87 -0
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +85 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/resources_move_info.rb +1 -1
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/sku.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/sub_resource.rb +45 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/tag_count.rb +1 -1
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/tag_details.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/tag_value.rb +65 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/tags_list_result.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/models/target_resource.rb +64 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/models/template_link.rb +1 -1
- data/lib/2016-09-01/generated/azure_mgmt_resources/module_definition.rb +9 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/providers.rb +6 -6
- data/lib/2016-09-01/generated/azure_mgmt_resources/resource_groups.rb +1086 -0
- data/lib/2016-09-01/generated/azure_mgmt_resources/resource_management_client.rb +149 -0
- data/lib/2016-09-01/generated/azure_mgmt_resources/resources.rb +1429 -0
- data/lib/{generated → 2016-09-01/generated}/azure_mgmt_resources/tags.rb +7 -7
- data/lib/2016-09-01/generated/azure_mgmt_resources/version.rb +8 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources.rb +80 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/deployment_operations.rb +335 -0
- data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/deployments.rb +12 -12
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/alias_path_type.rb +61 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/alias_type.rb +62 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/basic_dependency.rb +64 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/debug_setting.rb +52 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/dependency.rb +82 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment.rb +45 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_export_result.rb +44 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_extended.rb +65 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_extended_filter.rb +44 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_list_result.rb +95 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_mode.rb +16 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_operation.rb +67 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_operation_properties.rb +125 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_operations_list_result.rb +95 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_properties.rb +117 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_properties_extended.rb +183 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/deployment_validate_result.rb +57 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/export_template_request.rb +65 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/generic_resource.rb +145 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/generic_resource_filter.rb +64 -0
- data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/models/http_message.rb +1 -1
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/identity.rb +68 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/parameters_link.rb +55 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/plan.rb +74 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/provider.rb +86 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/provider_list_result.rb +95 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/provider_resource_type.rb +115 -0
- data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/models/resource.rb +1 -1
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_group.rb +107 -0
- data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/models/resource_group_export_result.rb +1 -1
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_group_filter.rb +54 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_group_list_result.rb +95 -0
- data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/models/resource_group_patchable.rb +1 -1
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_group_properties.rb +45 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_identity_type.rb +15 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_list_result.rb +95 -0
- data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/models/resource_management_error_with_details.rb +1 -1
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/resource_provider_operation_display_properties.rb +85 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/resources_move_info.rb +61 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/sku.rb +94 -0
- data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/models/sub_resource.rb +1 -1
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/tag_count.rb +54 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/tag_details.rb +85 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/tag_value.rb +65 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/tags_list_result.rb +95 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/target_resource.rb +64 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/models/template_link.rb +55 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/module_definition.rb +9 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/providers.rb +515 -0
- data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/resource_groups.rb +11 -11
- data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/resource_management_client.rb +3 -3
- data/lib/{generated → 2017-05-10/generated}/azure_mgmt_resources/resources.rb +17 -17
- data/lib/2017-05-10/generated/azure_mgmt_resources/tags.rb +593 -0
- data/lib/2017-05-10/generated/azure_mgmt_resources/version.rb +8 -0
- data/lib/azure_mgmt_resources.rb +6 -1
- data/lib/module_definition.rb +7 -0
- data/lib/profiles/common/configurable.rb +73 -0
- data/lib/profiles/common/default.rb +68 -0
- data/lib/profiles/latest/modules/resources_profile_module.rb +240 -0
- data/lib/profiles/latest/resources_latest_profile_client.rb +33 -0
- data/lib/profiles/latest/resources_module_definition.rb +9 -0
- data/lib/profiles/v2017_03_09/modules/resources_profile_module.rb +236 -0
- data/lib/profiles/v2017_03_09/resources_module_definition.rb +9 -0
- data/lib/profiles/v2017_03_09/resources_v2017_03_09_profile_client.rb +33 -0
- data/lib/version.rb +7 -0
- metadata +237 -59
- data/lib/generated/azure_mgmt_resources.rb +0 -80
@@ -0,0 +1,149 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Resources::Mgmt::V2016_09_01
|
7
|
+
#
|
8
|
+
# A service client - single point of access to the REST API.
|
9
|
+
#
|
10
|
+
class ResourceManagementClient < MsRestAzure::AzureServiceClient
|
11
|
+
include MsRestAzure
|
12
|
+
include MsRestAzure::Serialization
|
13
|
+
|
14
|
+
# @return [String] the base URI of the service.
|
15
|
+
attr_accessor :base_url
|
16
|
+
|
17
|
+
# @return Credentials needed for the client to connect to Azure.
|
18
|
+
attr_reader :credentials
|
19
|
+
|
20
|
+
# @return [String] The ID of the target subscription.
|
21
|
+
attr_accessor :subscription_id
|
22
|
+
|
23
|
+
# @return [String] The API version to use for this operation.
|
24
|
+
attr_reader :api_version
|
25
|
+
|
26
|
+
# @return [String] Gets or sets the preferred language for the response.
|
27
|
+
attr_accessor :accept_language
|
28
|
+
|
29
|
+
# @return [Integer] Gets or sets the retry timeout in seconds for Long
|
30
|
+
# Running Operations. Default value is 30.
|
31
|
+
attr_accessor :long_running_operation_retry_timeout
|
32
|
+
|
33
|
+
# @return [Boolean] When set to true a unique x-ms-client-request-id value
|
34
|
+
# is generated and included in each request. Default is true.
|
35
|
+
attr_accessor :generate_client_request_id
|
36
|
+
|
37
|
+
# @return [Deployments] deployments
|
38
|
+
attr_reader :deployments
|
39
|
+
|
40
|
+
# @return [Providers] providers
|
41
|
+
attr_reader :providers
|
42
|
+
|
43
|
+
# @return [ResourceGroups] resource_groups
|
44
|
+
attr_reader :resource_groups
|
45
|
+
|
46
|
+
# @return [Resources] resources
|
47
|
+
attr_reader :resources
|
48
|
+
|
49
|
+
# @return [Tags] tags
|
50
|
+
attr_reader :tags
|
51
|
+
|
52
|
+
# @return [DeploymentOperations] deployment_operations
|
53
|
+
attr_reader :deployment_operations
|
54
|
+
|
55
|
+
#
|
56
|
+
# Creates initializes a new instance of the ResourceManagementClient class.
|
57
|
+
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
58
|
+
# @param base_url [String] the base URI of the service.
|
59
|
+
# @param options [Array] filters to be applied to the HTTP requests.
|
60
|
+
#
|
61
|
+
def initialize(credentials = nil, base_url = nil, options = nil)
|
62
|
+
super(credentials, options)
|
63
|
+
@base_url = base_url || 'https://management.azure.com'
|
64
|
+
|
65
|
+
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
66
|
+
@credentials = credentials
|
67
|
+
|
68
|
+
@deployments = Deployments.new(self)
|
69
|
+
@providers = Providers.new(self)
|
70
|
+
@resource_groups = ResourceGroups.new(self)
|
71
|
+
@resources = Resources.new(self)
|
72
|
+
@tags = Tags.new(self)
|
73
|
+
@deployment_operations = DeploymentOperations.new(self)
|
74
|
+
@api_version = '2016-09-01'
|
75
|
+
@accept_language = 'en-US'
|
76
|
+
@long_running_operation_retry_timeout = 30
|
77
|
+
@generate_client_request_id = true
|
78
|
+
add_telemetry
|
79
|
+
end
|
80
|
+
|
81
|
+
#
|
82
|
+
# Makes a request and returns the body of the response.
|
83
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
84
|
+
# @param path [String] the path, relative to {base_url}.
|
85
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
86
|
+
# @return [Hash{String=>String}] containing the body of the response.
|
87
|
+
# Example:
|
88
|
+
#
|
89
|
+
# request_content = "{'location':'westus','tags':{'tag1':'val1','tag2':'val2'}}"
|
90
|
+
# path = "/path"
|
91
|
+
# options = {
|
92
|
+
# body: request_content,
|
93
|
+
# query_params: {'api-version' => '2016-02-01'}
|
94
|
+
# }
|
95
|
+
# result = @client.make_request(:put, path, options)
|
96
|
+
#
|
97
|
+
def make_request(method, path, options = {})
|
98
|
+
result = make_request_with_http_info(method, path, options)
|
99
|
+
result.body unless result.nil?
|
100
|
+
end
|
101
|
+
|
102
|
+
#
|
103
|
+
# Makes a request and returns the operation response.
|
104
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
105
|
+
# @param path [String] the path, relative to {base_url}.
|
106
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
107
|
+
# @return [MsRestAzure::AzureOperationResponse] Operation response containing the request, response and status.
|
108
|
+
#
|
109
|
+
def make_request_with_http_info(method, path, options = {})
|
110
|
+
result = make_request_async(method, path, options).value!
|
111
|
+
result.body = result.response.body.to_s.empty? ? nil : JSON.load(result.response.body)
|
112
|
+
result
|
113
|
+
end
|
114
|
+
|
115
|
+
#
|
116
|
+
# Makes a request asynchronously.
|
117
|
+
# @param method [Symbol] with any of the following values :get, :put, :post, :patch, :delete.
|
118
|
+
# @param path [String] the path, relative to {base_url}.
|
119
|
+
# @param options [Hash{String=>String}] specifying any request options like :body.
|
120
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
121
|
+
#
|
122
|
+
def make_request_async(method, path, options = {})
|
123
|
+
fail ArgumentError, 'method is nil' if method.nil?
|
124
|
+
fail ArgumentError, 'path is nil' if path.nil?
|
125
|
+
|
126
|
+
request_url = options[:base_url] || @base_url
|
127
|
+
|
128
|
+
request_headers = @request_headers
|
129
|
+
request_headers.merge!({'accept-language' => @accept_language}) unless @accept_language.nil?
|
130
|
+
options.merge!({headers: request_headers.merge(options[:headers] || {})})
|
131
|
+
options.merge!({credentials: @credentials}) unless @credentials.nil?
|
132
|
+
|
133
|
+
super(request_url, method, path, options)
|
134
|
+
end
|
135
|
+
|
136
|
+
|
137
|
+
private
|
138
|
+
#
|
139
|
+
# Adds telemetry information.
|
140
|
+
#
|
141
|
+
def add_telemetry
|
142
|
+
sdk_information = 'azure_mgmt_resources'
|
143
|
+
if defined? Azure::Resources::Mgmt::V2016_09_01::VERSION
|
144
|
+
sdk_information = "#{sdk_information}/#{Azure::Resources::Mgmt::V2016_09_01::VERSION}"
|
145
|
+
end
|
146
|
+
add_user_agent_information(sdk_information)
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
@@ -0,0 +1,1429 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
# Code generated by Microsoft (R) AutoRest Code Generator.
|
3
|
+
# Changes may cause incorrect behavior and will be lost if the code is
|
4
|
+
# regenerated.
|
5
|
+
|
6
|
+
module Azure::Resources::Mgmt::V2016_09_01
|
7
|
+
#
|
8
|
+
# Provides operations for working with resources and resource groups.
|
9
|
+
#
|
10
|
+
class Resources
|
11
|
+
include MsRestAzure
|
12
|
+
|
13
|
+
#
|
14
|
+
# Creates and initializes a new instance of the Resources class.
|
15
|
+
# @param client service class for accessing basic functionality.
|
16
|
+
#
|
17
|
+
def initialize(client)
|
18
|
+
@client = client
|
19
|
+
end
|
20
|
+
|
21
|
+
# @return [ResourceManagementClient] reference to the ResourceManagementClient
|
22
|
+
attr_reader :client
|
23
|
+
|
24
|
+
#
|
25
|
+
# Moves resources from one resource group to another resource group.
|
26
|
+
#
|
27
|
+
# The resources to move must be in the same source resource group. The target
|
28
|
+
# resource group may be in a different subscription. When moving resources,
|
29
|
+
# both the source group and the target group are locked for the duration of the
|
30
|
+
# operation. Write and delete operations are blocked on the groups until the
|
31
|
+
# move completes.
|
32
|
+
#
|
33
|
+
# @param source_resource_group_name [String] The name of the resource group
|
34
|
+
# containing the rsources to move.
|
35
|
+
# @param parameters [ResourcesMoveInfo] Parameters for moving resources.
|
36
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
37
|
+
# will be added to the HTTP request.
|
38
|
+
#
|
39
|
+
def move_resources(source_resource_group_name, parameters, custom_headers = nil)
|
40
|
+
response = move_resources_async(source_resource_group_name, parameters, custom_headers).value!
|
41
|
+
nil
|
42
|
+
end
|
43
|
+
|
44
|
+
#
|
45
|
+
# @param source_resource_group_name [String] The name of the resource group
|
46
|
+
# containing the rsources to move.
|
47
|
+
# @param parameters [ResourcesMoveInfo] Parameters for moving resources.
|
48
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
49
|
+
# will be added to the HTTP request.
|
50
|
+
#
|
51
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
52
|
+
# response.
|
53
|
+
#
|
54
|
+
def move_resources_async(source_resource_group_name, parameters, custom_headers = nil)
|
55
|
+
# Send request
|
56
|
+
promise = begin_move_resources_async(source_resource_group_name, parameters, custom_headers)
|
57
|
+
|
58
|
+
promise = promise.then do |response|
|
59
|
+
# Defining deserialization method.
|
60
|
+
deserialize_method = lambda do |parsed_response|
|
61
|
+
end
|
62
|
+
|
63
|
+
# Waiting for response.
|
64
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
65
|
+
end
|
66
|
+
|
67
|
+
promise
|
68
|
+
end
|
69
|
+
|
70
|
+
#
|
71
|
+
# Get all the resources in a subscription.
|
72
|
+
#
|
73
|
+
# @param filter [String] The filter to apply on the operation.
|
74
|
+
# @param expand [String] The $expand query parameter.
|
75
|
+
# @param top [Integer] The number of results to return. If null is passed,
|
76
|
+
# returns all resource groups.
|
77
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
78
|
+
# will be added to the HTTP request.
|
79
|
+
#
|
80
|
+
# @return [Array<GenericResource>] operation results.
|
81
|
+
#
|
82
|
+
def list(filter = nil, expand = nil, top = nil, custom_headers = nil)
|
83
|
+
first_page = list_as_lazy(filter, expand, top, custom_headers)
|
84
|
+
first_page.get_all_items
|
85
|
+
end
|
86
|
+
|
87
|
+
#
|
88
|
+
# Get all the resources in a subscription.
|
89
|
+
#
|
90
|
+
# @param filter [String] The filter to apply on the operation.
|
91
|
+
# @param expand [String] The $expand query parameter.
|
92
|
+
# @param top [Integer] The number of results to return. If null is passed,
|
93
|
+
# returns all resource groups.
|
94
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
95
|
+
# will be added to the HTTP request.
|
96
|
+
#
|
97
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
98
|
+
#
|
99
|
+
def list_with_http_info(filter = nil, expand = nil, top = nil, custom_headers = nil)
|
100
|
+
list_async(filter, expand, top, custom_headers).value!
|
101
|
+
end
|
102
|
+
|
103
|
+
#
|
104
|
+
# Get all the resources in a subscription.
|
105
|
+
#
|
106
|
+
# @param filter [String] The filter to apply on the operation.
|
107
|
+
# @param expand [String] The $expand query parameter.
|
108
|
+
# @param top [Integer] The number of results to return. If null is passed,
|
109
|
+
# returns all resource groups.
|
110
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
111
|
+
# to the HTTP request.
|
112
|
+
#
|
113
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
114
|
+
#
|
115
|
+
def list_async(filter = nil, expand = nil, top = nil, custom_headers = nil)
|
116
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
117
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
118
|
+
|
119
|
+
|
120
|
+
request_headers = {}
|
121
|
+
|
122
|
+
# Set Headers
|
123
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
124
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
125
|
+
path_template = 'subscriptions/{subscriptionId}/resources'
|
126
|
+
|
127
|
+
request_url = @base_url || @client.base_url
|
128
|
+
|
129
|
+
options = {
|
130
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
131
|
+
path_params: {'subscriptionId' => @client.subscription_id},
|
132
|
+
query_params: {'$filter' => filter,'$expand' => expand,'$top' => top,'api-version' => @client.api_version},
|
133
|
+
headers: request_headers.merge(custom_headers || {}),
|
134
|
+
base_url: request_url
|
135
|
+
}
|
136
|
+
promise = @client.make_request_async(:get, path_template, options)
|
137
|
+
|
138
|
+
promise = promise.then do |result|
|
139
|
+
http_response = result.response
|
140
|
+
status_code = http_response.status
|
141
|
+
response_content = http_response.body
|
142
|
+
unless status_code == 200
|
143
|
+
error_model = JSON.load(response_content)
|
144
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
145
|
+
end
|
146
|
+
|
147
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
148
|
+
# Deserialize Response
|
149
|
+
if status_code == 200
|
150
|
+
begin
|
151
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
152
|
+
result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::ResourceListResult.mapper()
|
153
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
154
|
+
rescue Exception => e
|
155
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
156
|
+
end
|
157
|
+
end
|
158
|
+
|
159
|
+
result
|
160
|
+
end
|
161
|
+
|
162
|
+
promise.execute
|
163
|
+
end
|
164
|
+
|
165
|
+
#
|
166
|
+
# Checks whether a resource exists.
|
167
|
+
#
|
168
|
+
# @param resource_group_name [String] The name of the resource group containing
|
169
|
+
# the resource to check. The name is case insensitive.
|
170
|
+
# @param resource_provider_namespace [String] The resource provider of the
|
171
|
+
# resource to check.
|
172
|
+
# @param parent_resource_path [String] The parent resource identity.
|
173
|
+
# @param resource_type [String] The resource type.
|
174
|
+
# @param resource_name [String] The name of the resource to check whether it
|
175
|
+
# exists.
|
176
|
+
# @param api_version [String] The API version to use for the operation.
|
177
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
178
|
+
# will be added to the HTTP request.
|
179
|
+
#
|
180
|
+
# @return [Boolean] operation results.
|
181
|
+
#
|
182
|
+
def check_existence(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
|
183
|
+
response = check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers).value!
|
184
|
+
response.body unless response.nil?
|
185
|
+
end
|
186
|
+
|
187
|
+
#
|
188
|
+
# Checks whether a resource exists.
|
189
|
+
#
|
190
|
+
# @param resource_group_name [String] The name of the resource group containing
|
191
|
+
# the resource to check. The name is case insensitive.
|
192
|
+
# @param resource_provider_namespace [String] The resource provider of the
|
193
|
+
# resource to check.
|
194
|
+
# @param parent_resource_path [String] The parent resource identity.
|
195
|
+
# @param resource_type [String] The resource type.
|
196
|
+
# @param resource_name [String] The name of the resource to check whether it
|
197
|
+
# exists.
|
198
|
+
# @param api_version [String] The API version to use for the operation.
|
199
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
200
|
+
# will be added to the HTTP request.
|
201
|
+
#
|
202
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
203
|
+
#
|
204
|
+
def check_existence_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
|
205
|
+
check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers).value!
|
206
|
+
end
|
207
|
+
|
208
|
+
#
|
209
|
+
# Checks whether a resource exists.
|
210
|
+
#
|
211
|
+
# @param resource_group_name [String] The name of the resource group containing
|
212
|
+
# the resource to check. The name is case insensitive.
|
213
|
+
# @param resource_provider_namespace [String] The resource provider of the
|
214
|
+
# resource to check.
|
215
|
+
# @param parent_resource_path [String] The parent resource identity.
|
216
|
+
# @param resource_type [String] The resource type.
|
217
|
+
# @param resource_name [String] The name of the resource to check whether it
|
218
|
+
# exists.
|
219
|
+
# @param api_version [String] The API version to use for the operation.
|
220
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
221
|
+
# to the HTTP request.
|
222
|
+
#
|
223
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
224
|
+
#
|
225
|
+
def check_existence_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
|
226
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
227
|
+
fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
|
228
|
+
fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
|
229
|
+
fail ArgumentError, 'resource_type is nil' if resource_type.nil?
|
230
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
231
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
232
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
233
|
+
|
234
|
+
|
235
|
+
request_headers = {}
|
236
|
+
|
237
|
+
# Set Headers
|
238
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
239
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
240
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'
|
241
|
+
|
242
|
+
request_url = @base_url || @client.base_url
|
243
|
+
|
244
|
+
options = {
|
245
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
246
|
+
path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
|
247
|
+
skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type},
|
248
|
+
query_params: {'api-version' => api_version},
|
249
|
+
headers: request_headers.merge(custom_headers || {}),
|
250
|
+
base_url: request_url
|
251
|
+
}
|
252
|
+
promise = @client.make_request_async(:head, path_template, options)
|
253
|
+
|
254
|
+
promise = promise.then do |result|
|
255
|
+
http_response = result.response
|
256
|
+
status_code = http_response.status
|
257
|
+
response_content = http_response.body
|
258
|
+
unless status_code == 204 || status_code == 404
|
259
|
+
error_model = JSON.load(response_content)
|
260
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
261
|
+
end
|
262
|
+
|
263
|
+
result.body = (status_code == 204)
|
264
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
265
|
+
|
266
|
+
result
|
267
|
+
end
|
268
|
+
|
269
|
+
promise.execute
|
270
|
+
end
|
271
|
+
|
272
|
+
#
|
273
|
+
# Deletes a resource.
|
274
|
+
#
|
275
|
+
# @param resource_group_name [String] The name of the resource group that
|
276
|
+
# contains the resource to delete. The name is case insensitive.
|
277
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
278
|
+
# provider.
|
279
|
+
# @param parent_resource_path [String] The parent resource identity.
|
280
|
+
# @param resource_type [String] The resource type.
|
281
|
+
# @param resource_name [String] The name of the resource to delete.
|
282
|
+
# @param api_version [String] The API version to use for the operation.
|
283
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
284
|
+
# will be added to the HTTP request.
|
285
|
+
#
|
286
|
+
def delete(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
|
287
|
+
response = delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers).value!
|
288
|
+
nil
|
289
|
+
end
|
290
|
+
|
291
|
+
#
|
292
|
+
# @param resource_group_name [String] The name of the resource group that
|
293
|
+
# contains the resource to delete. The name is case insensitive.
|
294
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
295
|
+
# provider.
|
296
|
+
# @param parent_resource_path [String] The parent resource identity.
|
297
|
+
# @param resource_type [String] The resource type.
|
298
|
+
# @param resource_name [String] The name of the resource to delete.
|
299
|
+
# @param api_version [String] The API version to use for the operation.
|
300
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
301
|
+
# will be added to the HTTP request.
|
302
|
+
#
|
303
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
304
|
+
# response.
|
305
|
+
#
|
306
|
+
def delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
|
307
|
+
# Send request
|
308
|
+
promise = begin_delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers)
|
309
|
+
|
310
|
+
promise = promise.then do |response|
|
311
|
+
# Defining deserialization method.
|
312
|
+
deserialize_method = lambda do |parsed_response|
|
313
|
+
end
|
314
|
+
|
315
|
+
# Waiting for response.
|
316
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
317
|
+
end
|
318
|
+
|
319
|
+
promise
|
320
|
+
end
|
321
|
+
|
322
|
+
#
|
323
|
+
# Creates a resource.
|
324
|
+
#
|
325
|
+
# @param resource_group_name [String] The name of the resource group for the
|
326
|
+
# resource. The name is case insensitive.
|
327
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
328
|
+
# provider.
|
329
|
+
# @param parent_resource_path [String] The parent resource identity.
|
330
|
+
# @param resource_type [String] The resource type of the resource to create.
|
331
|
+
# @param resource_name [String] The name of the resource to create.
|
332
|
+
# @param api_version [String] The API version to use for the operation.
|
333
|
+
# @param parameters [GenericResource] Parameters for creating or updating the
|
334
|
+
# resource.
|
335
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
336
|
+
# will be added to the HTTP request.
|
337
|
+
#
|
338
|
+
# @return [GenericResource] operation results.
|
339
|
+
#
|
340
|
+
def create_or_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers = nil)
|
341
|
+
response = create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers).value!
|
342
|
+
response.body unless response.nil?
|
343
|
+
end
|
344
|
+
|
345
|
+
#
|
346
|
+
# @param resource_group_name [String] The name of the resource group for the
|
347
|
+
# resource. The name is case insensitive.
|
348
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
349
|
+
# provider.
|
350
|
+
# @param parent_resource_path [String] The parent resource identity.
|
351
|
+
# @param resource_type [String] The resource type of the resource to create.
|
352
|
+
# @param resource_name [String] The name of the resource to create.
|
353
|
+
# @param api_version [String] The API version to use for the operation.
|
354
|
+
# @param parameters [GenericResource] Parameters for creating or updating the
|
355
|
+
# resource.
|
356
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
357
|
+
# will be added to the HTTP request.
|
358
|
+
#
|
359
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
360
|
+
# response.
|
361
|
+
#
|
362
|
+
def create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers = nil)
|
363
|
+
# Send request
|
364
|
+
promise = begin_create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers)
|
365
|
+
|
366
|
+
promise = promise.then do |response|
|
367
|
+
# Defining deserialization method.
|
368
|
+
deserialize_method = lambda do |parsed_response|
|
369
|
+
result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::GenericResource.mapper()
|
370
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
371
|
+
end
|
372
|
+
|
373
|
+
# Waiting for response.
|
374
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
375
|
+
end
|
376
|
+
|
377
|
+
promise
|
378
|
+
end
|
379
|
+
|
380
|
+
#
|
381
|
+
# Gets a resource.
|
382
|
+
#
|
383
|
+
# @param resource_group_name [String] The name of the resource group containing
|
384
|
+
# the resource to get. The name is case insensitive.
|
385
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
386
|
+
# provider.
|
387
|
+
# @param parent_resource_path [String] The parent resource identity.
|
388
|
+
# @param resource_type [String] The resource type of the resource.
|
389
|
+
# @param resource_name [String] The name of the resource to get.
|
390
|
+
# @param api_version [String] The API version to use for the operation.
|
391
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
392
|
+
# will be added to the HTTP request.
|
393
|
+
#
|
394
|
+
# @return [GenericResource] operation results.
|
395
|
+
#
|
396
|
+
def get(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
|
397
|
+
response = get_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers).value!
|
398
|
+
response.body unless response.nil?
|
399
|
+
end
|
400
|
+
|
401
|
+
#
|
402
|
+
# Gets a resource.
|
403
|
+
#
|
404
|
+
# @param resource_group_name [String] The name of the resource group containing
|
405
|
+
# the resource to get. The name is case insensitive.
|
406
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
407
|
+
# provider.
|
408
|
+
# @param parent_resource_path [String] The parent resource identity.
|
409
|
+
# @param resource_type [String] The resource type of the resource.
|
410
|
+
# @param resource_name [String] The name of the resource to get.
|
411
|
+
# @param api_version [String] The API version to use for the operation.
|
412
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
413
|
+
# will be added to the HTTP request.
|
414
|
+
#
|
415
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
416
|
+
#
|
417
|
+
def get_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
|
418
|
+
get_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers).value!
|
419
|
+
end
|
420
|
+
|
421
|
+
#
|
422
|
+
# Gets a resource.
|
423
|
+
#
|
424
|
+
# @param resource_group_name [String] The name of the resource group containing
|
425
|
+
# the resource to get. The name is case insensitive.
|
426
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
427
|
+
# provider.
|
428
|
+
# @param parent_resource_path [String] The parent resource identity.
|
429
|
+
# @param resource_type [String] The resource type of the resource.
|
430
|
+
# @param resource_name [String] The name of the resource to get.
|
431
|
+
# @param api_version [String] The API version to use for the operation.
|
432
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
433
|
+
# to the HTTP request.
|
434
|
+
#
|
435
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
436
|
+
#
|
437
|
+
def get_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
|
438
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
439
|
+
fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
|
440
|
+
fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
|
441
|
+
fail ArgumentError, 'resource_type is nil' if resource_type.nil?
|
442
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
443
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
444
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
445
|
+
|
446
|
+
|
447
|
+
request_headers = {}
|
448
|
+
|
449
|
+
# Set Headers
|
450
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
451
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
452
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'
|
453
|
+
|
454
|
+
request_url = @base_url || @client.base_url
|
455
|
+
|
456
|
+
options = {
|
457
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
458
|
+
path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
|
459
|
+
skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type},
|
460
|
+
query_params: {'api-version' => api_version},
|
461
|
+
headers: request_headers.merge(custom_headers || {}),
|
462
|
+
base_url: request_url
|
463
|
+
}
|
464
|
+
promise = @client.make_request_async(:get, path_template, options)
|
465
|
+
|
466
|
+
promise = promise.then do |result|
|
467
|
+
http_response = result.response
|
468
|
+
status_code = http_response.status
|
469
|
+
response_content = http_response.body
|
470
|
+
unless status_code == 200
|
471
|
+
error_model = JSON.load(response_content)
|
472
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
473
|
+
end
|
474
|
+
|
475
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
476
|
+
# Deserialize Response
|
477
|
+
if status_code == 200
|
478
|
+
begin
|
479
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
480
|
+
result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::GenericResource.mapper()
|
481
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
482
|
+
rescue Exception => e
|
483
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
484
|
+
end
|
485
|
+
end
|
486
|
+
|
487
|
+
result
|
488
|
+
end
|
489
|
+
|
490
|
+
promise.execute
|
491
|
+
end
|
492
|
+
|
493
|
+
#
|
494
|
+
# Checks by ID whether a resource exists.
|
495
|
+
#
|
496
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
497
|
+
# the resource name and resource type. Use the format,
|
498
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
499
|
+
# @param api_version [String] The API version to use for the operation.
|
500
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
501
|
+
# will be added to the HTTP request.
|
502
|
+
#
|
503
|
+
# @return [Boolean] operation results.
|
504
|
+
#
|
505
|
+
def check_existence_by_id(resource_id, api_version, custom_headers = nil)
|
506
|
+
response = check_existence_by_id_async(resource_id, api_version, custom_headers).value!
|
507
|
+
response.body unless response.nil?
|
508
|
+
end
|
509
|
+
|
510
|
+
#
|
511
|
+
# Checks by ID whether a resource exists.
|
512
|
+
#
|
513
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
514
|
+
# the resource name and resource type. Use the format,
|
515
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
516
|
+
# @param api_version [String] The API version to use for the operation.
|
517
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
518
|
+
# will be added to the HTTP request.
|
519
|
+
#
|
520
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
521
|
+
#
|
522
|
+
def check_existence_by_id_with_http_info(resource_id, api_version, custom_headers = nil)
|
523
|
+
check_existence_by_id_async(resource_id, api_version, custom_headers).value!
|
524
|
+
end
|
525
|
+
|
526
|
+
#
|
527
|
+
# Checks by ID whether a resource exists.
|
528
|
+
#
|
529
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
530
|
+
# the resource name and resource type. Use the format,
|
531
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
532
|
+
# @param api_version [String] The API version to use for the operation.
|
533
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
534
|
+
# to the HTTP request.
|
535
|
+
#
|
536
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
537
|
+
#
|
538
|
+
def check_existence_by_id_async(resource_id, api_version, custom_headers = nil)
|
539
|
+
fail ArgumentError, 'resource_id is nil' if resource_id.nil?
|
540
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
541
|
+
|
542
|
+
|
543
|
+
request_headers = {}
|
544
|
+
|
545
|
+
# Set Headers
|
546
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
547
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
548
|
+
path_template = '{resourceId}'
|
549
|
+
|
550
|
+
request_url = @base_url || @client.base_url
|
551
|
+
|
552
|
+
options = {
|
553
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
554
|
+
skip_encoding_path_params: {'resourceId' => resource_id},
|
555
|
+
query_params: {'api-version' => api_version},
|
556
|
+
headers: request_headers.merge(custom_headers || {}),
|
557
|
+
base_url: request_url
|
558
|
+
}
|
559
|
+
promise = @client.make_request_async(:head, path_template, options)
|
560
|
+
|
561
|
+
promise = promise.then do |result|
|
562
|
+
http_response = result.response
|
563
|
+
status_code = http_response.status
|
564
|
+
response_content = http_response.body
|
565
|
+
unless status_code == 204 || status_code == 404
|
566
|
+
error_model = JSON.load(response_content)
|
567
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
568
|
+
end
|
569
|
+
|
570
|
+
result.body = (status_code == 204)
|
571
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
572
|
+
|
573
|
+
result
|
574
|
+
end
|
575
|
+
|
576
|
+
promise.execute
|
577
|
+
end
|
578
|
+
|
579
|
+
#
|
580
|
+
# Deletes a resource by ID.
|
581
|
+
#
|
582
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
583
|
+
# the resource name and resource type. Use the format,
|
584
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
585
|
+
# @param api_version [String] The API version to use for the operation.
|
586
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
587
|
+
# will be added to the HTTP request.
|
588
|
+
#
|
589
|
+
def delete_by_id(resource_id, api_version, custom_headers = nil)
|
590
|
+
response = delete_by_id_async(resource_id, api_version, custom_headers).value!
|
591
|
+
nil
|
592
|
+
end
|
593
|
+
|
594
|
+
#
|
595
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
596
|
+
# the resource name and resource type. Use the format,
|
597
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
598
|
+
# @param api_version [String] The API version to use for the operation.
|
599
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
600
|
+
# will be added to the HTTP request.
|
601
|
+
#
|
602
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
603
|
+
# response.
|
604
|
+
#
|
605
|
+
def delete_by_id_async(resource_id, api_version, custom_headers = nil)
|
606
|
+
# Send request
|
607
|
+
promise = begin_delete_by_id_async(resource_id, api_version, custom_headers)
|
608
|
+
|
609
|
+
promise = promise.then do |response|
|
610
|
+
# Defining deserialization method.
|
611
|
+
deserialize_method = lambda do |parsed_response|
|
612
|
+
end
|
613
|
+
|
614
|
+
# Waiting for response.
|
615
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
616
|
+
end
|
617
|
+
|
618
|
+
promise
|
619
|
+
end
|
620
|
+
|
621
|
+
#
|
622
|
+
# Create a resource by ID.
|
623
|
+
#
|
624
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
625
|
+
# the resource name and resource type. Use the format,
|
626
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
627
|
+
# @param api_version [String] The API version to use for the operation.
|
628
|
+
# @param parameters [GenericResource] Create or update resource parameters.
|
629
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
630
|
+
# will be added to the HTTP request.
|
631
|
+
#
|
632
|
+
# @return [GenericResource] operation results.
|
633
|
+
#
|
634
|
+
def create_or_update_by_id(resource_id, api_version, parameters, custom_headers = nil)
|
635
|
+
response = create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers).value!
|
636
|
+
response.body unless response.nil?
|
637
|
+
end
|
638
|
+
|
639
|
+
#
|
640
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
641
|
+
# the resource name and resource type. Use the format,
|
642
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
643
|
+
# @param api_version [String] The API version to use for the operation.
|
644
|
+
# @param parameters [GenericResource] Create or update resource parameters.
|
645
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
646
|
+
# will be added to the HTTP request.
|
647
|
+
#
|
648
|
+
# @return [Concurrent::Promise] promise which provides async access to http
|
649
|
+
# response.
|
650
|
+
#
|
651
|
+
def create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers = nil)
|
652
|
+
# Send request
|
653
|
+
promise = begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers)
|
654
|
+
|
655
|
+
promise = promise.then do |response|
|
656
|
+
# Defining deserialization method.
|
657
|
+
deserialize_method = lambda do |parsed_response|
|
658
|
+
result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::GenericResource.mapper()
|
659
|
+
parsed_response = @client.deserialize(result_mapper, parsed_response)
|
660
|
+
end
|
661
|
+
|
662
|
+
# Waiting for response.
|
663
|
+
@client.get_long_running_operation_result(response, deserialize_method)
|
664
|
+
end
|
665
|
+
|
666
|
+
promise
|
667
|
+
end
|
668
|
+
|
669
|
+
#
|
670
|
+
# Gets a resource by ID.
|
671
|
+
#
|
672
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
673
|
+
# the resource name and resource type. Use the format,
|
674
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
675
|
+
# @param api_version [String] The API version to use for the operation.
|
676
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
677
|
+
# will be added to the HTTP request.
|
678
|
+
#
|
679
|
+
# @return [GenericResource] operation results.
|
680
|
+
#
|
681
|
+
def get_by_id(resource_id, api_version, custom_headers = nil)
|
682
|
+
response = get_by_id_async(resource_id, api_version, custom_headers).value!
|
683
|
+
response.body unless response.nil?
|
684
|
+
end
|
685
|
+
|
686
|
+
#
|
687
|
+
# Gets a resource by ID.
|
688
|
+
#
|
689
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
690
|
+
# the resource name and resource type. Use the format,
|
691
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
692
|
+
# @param api_version [String] The API version to use for the operation.
|
693
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
694
|
+
# will be added to the HTTP request.
|
695
|
+
#
|
696
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
697
|
+
#
|
698
|
+
def get_by_id_with_http_info(resource_id, api_version, custom_headers = nil)
|
699
|
+
get_by_id_async(resource_id, api_version, custom_headers).value!
|
700
|
+
end
|
701
|
+
|
702
|
+
#
|
703
|
+
# Gets a resource by ID.
|
704
|
+
#
|
705
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
706
|
+
# the resource name and resource type. Use the format,
|
707
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
708
|
+
# @param api_version [String] The API version to use for the operation.
|
709
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
710
|
+
# to the HTTP request.
|
711
|
+
#
|
712
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
713
|
+
#
|
714
|
+
def get_by_id_async(resource_id, api_version, custom_headers = nil)
|
715
|
+
fail ArgumentError, 'resource_id is nil' if resource_id.nil?
|
716
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
717
|
+
|
718
|
+
|
719
|
+
request_headers = {}
|
720
|
+
|
721
|
+
# Set Headers
|
722
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
723
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
724
|
+
path_template = '{resourceId}'
|
725
|
+
|
726
|
+
request_url = @base_url || @client.base_url
|
727
|
+
|
728
|
+
options = {
|
729
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
730
|
+
skip_encoding_path_params: {'resourceId' => resource_id},
|
731
|
+
query_params: {'api-version' => api_version},
|
732
|
+
headers: request_headers.merge(custom_headers || {}),
|
733
|
+
base_url: request_url
|
734
|
+
}
|
735
|
+
promise = @client.make_request_async(:get, path_template, options)
|
736
|
+
|
737
|
+
promise = promise.then do |result|
|
738
|
+
http_response = result.response
|
739
|
+
status_code = http_response.status
|
740
|
+
response_content = http_response.body
|
741
|
+
unless status_code == 200
|
742
|
+
error_model = JSON.load(response_content)
|
743
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
744
|
+
end
|
745
|
+
|
746
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
747
|
+
# Deserialize Response
|
748
|
+
if status_code == 200
|
749
|
+
begin
|
750
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
751
|
+
result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::GenericResource.mapper()
|
752
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
753
|
+
rescue Exception => e
|
754
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
755
|
+
end
|
756
|
+
end
|
757
|
+
|
758
|
+
result
|
759
|
+
end
|
760
|
+
|
761
|
+
promise.execute
|
762
|
+
end
|
763
|
+
|
764
|
+
#
|
765
|
+
# Moves resources from one resource group to another resource group.
|
766
|
+
#
|
767
|
+
# The resources to move must be in the same source resource group. The target
|
768
|
+
# resource group may be in a different subscription. When moving resources,
|
769
|
+
# both the source group and the target group are locked for the duration of the
|
770
|
+
# operation. Write and delete operations are blocked on the groups until the
|
771
|
+
# move completes.
|
772
|
+
#
|
773
|
+
# @param source_resource_group_name [String] The name of the resource group
|
774
|
+
# containing the rsources to move.
|
775
|
+
# @param parameters [ResourcesMoveInfo] Parameters for moving resources.
|
776
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
777
|
+
# will be added to the HTTP request.
|
778
|
+
#
|
779
|
+
#
|
780
|
+
def begin_move_resources(source_resource_group_name, parameters, custom_headers = nil)
|
781
|
+
response = begin_move_resources_async(source_resource_group_name, parameters, custom_headers).value!
|
782
|
+
nil
|
783
|
+
end
|
784
|
+
|
785
|
+
#
|
786
|
+
# Moves resources from one resource group to another resource group.
|
787
|
+
#
|
788
|
+
# The resources to move must be in the same source resource group. The target
|
789
|
+
# resource group may be in a different subscription. When moving resources,
|
790
|
+
# both the source group and the target group are locked for the duration of the
|
791
|
+
# operation. Write and delete operations are blocked on the groups until the
|
792
|
+
# move completes.
|
793
|
+
#
|
794
|
+
# @param source_resource_group_name [String] The name of the resource group
|
795
|
+
# containing the rsources to move.
|
796
|
+
# @param parameters [ResourcesMoveInfo] Parameters for moving resources.
|
797
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
798
|
+
# will be added to the HTTP request.
|
799
|
+
#
|
800
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
801
|
+
#
|
802
|
+
def begin_move_resources_with_http_info(source_resource_group_name, parameters, custom_headers = nil)
|
803
|
+
begin_move_resources_async(source_resource_group_name, parameters, custom_headers).value!
|
804
|
+
end
|
805
|
+
|
806
|
+
#
|
807
|
+
# Moves resources from one resource group to another resource group.
|
808
|
+
#
|
809
|
+
# The resources to move must be in the same source resource group. The target
|
810
|
+
# resource group may be in a different subscription. When moving resources,
|
811
|
+
# both the source group and the target group are locked for the duration of the
|
812
|
+
# operation. Write and delete operations are blocked on the groups until the
|
813
|
+
# move completes.
|
814
|
+
#
|
815
|
+
# @param source_resource_group_name [String] The name of the resource group
|
816
|
+
# containing the rsources to move.
|
817
|
+
# @param parameters [ResourcesMoveInfo] Parameters for moving resources.
|
818
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
819
|
+
# to the HTTP request.
|
820
|
+
#
|
821
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
822
|
+
#
|
823
|
+
def begin_move_resources_async(source_resource_group_name, parameters, custom_headers = nil)
|
824
|
+
fail ArgumentError, 'source_resource_group_name is nil' if source_resource_group_name.nil?
|
825
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
826
|
+
fail ArgumentError, '@client.api_version is nil' if @client.api_version.nil?
|
827
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
828
|
+
|
829
|
+
|
830
|
+
request_headers = {}
|
831
|
+
|
832
|
+
# Set Headers
|
833
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
834
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
835
|
+
|
836
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
837
|
+
|
838
|
+
# Serialize Request
|
839
|
+
request_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::ResourcesMoveInfo.mapper()
|
840
|
+
request_content = @client.serialize(request_mapper, parameters)
|
841
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
842
|
+
|
843
|
+
path_template = 'subscriptions/{subscriptionId}/resourceGroups/{sourceResourceGroupName}/moveResources'
|
844
|
+
|
845
|
+
request_url = @base_url || @client.base_url
|
846
|
+
|
847
|
+
options = {
|
848
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
849
|
+
path_params: {'sourceResourceGroupName' => source_resource_group_name,'subscriptionId' => @client.subscription_id},
|
850
|
+
query_params: {'api-version' => @client.api_version},
|
851
|
+
body: request_content,
|
852
|
+
headers: request_headers.merge(custom_headers || {}),
|
853
|
+
base_url: request_url
|
854
|
+
}
|
855
|
+
promise = @client.make_request_async(:post, path_template, options)
|
856
|
+
|
857
|
+
promise = promise.then do |result|
|
858
|
+
http_response = result.response
|
859
|
+
status_code = http_response.status
|
860
|
+
response_content = http_response.body
|
861
|
+
unless status_code == 202 || status_code == 204
|
862
|
+
error_model = JSON.load(response_content)
|
863
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
864
|
+
end
|
865
|
+
|
866
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
867
|
+
|
868
|
+
result
|
869
|
+
end
|
870
|
+
|
871
|
+
promise.execute
|
872
|
+
end
|
873
|
+
|
874
|
+
#
|
875
|
+
# Deletes a resource.
|
876
|
+
#
|
877
|
+
# @param resource_group_name [String] The name of the resource group that
|
878
|
+
# contains the resource to delete. The name is case insensitive.
|
879
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
880
|
+
# provider.
|
881
|
+
# @param parent_resource_path [String] The parent resource identity.
|
882
|
+
# @param resource_type [String] The resource type.
|
883
|
+
# @param resource_name [String] The name of the resource to delete.
|
884
|
+
# @param api_version [String] The API version to use for the operation.
|
885
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
886
|
+
# will be added to the HTTP request.
|
887
|
+
#
|
888
|
+
#
|
889
|
+
def begin_delete(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
|
890
|
+
response = begin_delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers).value!
|
891
|
+
nil
|
892
|
+
end
|
893
|
+
|
894
|
+
#
|
895
|
+
# Deletes a resource.
|
896
|
+
#
|
897
|
+
# @param resource_group_name [String] The name of the resource group that
|
898
|
+
# contains the resource to delete. The name is case insensitive.
|
899
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
900
|
+
# provider.
|
901
|
+
# @param parent_resource_path [String] The parent resource identity.
|
902
|
+
# @param resource_type [String] The resource type.
|
903
|
+
# @param resource_name [String] The name of the resource to delete.
|
904
|
+
# @param api_version [String] The API version to use for the operation.
|
905
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
906
|
+
# will be added to the HTTP request.
|
907
|
+
#
|
908
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
909
|
+
#
|
910
|
+
def begin_delete_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
|
911
|
+
begin_delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers).value!
|
912
|
+
end
|
913
|
+
|
914
|
+
#
|
915
|
+
# Deletes a resource.
|
916
|
+
#
|
917
|
+
# @param resource_group_name [String] The name of the resource group that
|
918
|
+
# contains the resource to delete. The name is case insensitive.
|
919
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
920
|
+
# provider.
|
921
|
+
# @param parent_resource_path [String] The parent resource identity.
|
922
|
+
# @param resource_type [String] The resource type.
|
923
|
+
# @param resource_name [String] The name of the resource to delete.
|
924
|
+
# @param api_version [String] The API version to use for the operation.
|
925
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
926
|
+
# to the HTTP request.
|
927
|
+
#
|
928
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
929
|
+
#
|
930
|
+
def begin_delete_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, custom_headers = nil)
|
931
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
932
|
+
fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
|
933
|
+
fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
|
934
|
+
fail ArgumentError, 'resource_type is nil' if resource_type.nil?
|
935
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
936
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
937
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
938
|
+
|
939
|
+
|
940
|
+
request_headers = {}
|
941
|
+
|
942
|
+
# Set Headers
|
943
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
944
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
945
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'
|
946
|
+
|
947
|
+
request_url = @base_url || @client.base_url
|
948
|
+
|
949
|
+
options = {
|
950
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
951
|
+
path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
|
952
|
+
skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type},
|
953
|
+
query_params: {'api-version' => api_version},
|
954
|
+
headers: request_headers.merge(custom_headers || {}),
|
955
|
+
base_url: request_url
|
956
|
+
}
|
957
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
958
|
+
|
959
|
+
promise = promise.then do |result|
|
960
|
+
http_response = result.response
|
961
|
+
status_code = http_response.status
|
962
|
+
response_content = http_response.body
|
963
|
+
unless status_code == 200 || status_code == 204 || status_code == 202
|
964
|
+
error_model = JSON.load(response_content)
|
965
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
966
|
+
end
|
967
|
+
|
968
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
969
|
+
|
970
|
+
result
|
971
|
+
end
|
972
|
+
|
973
|
+
promise.execute
|
974
|
+
end
|
975
|
+
|
976
|
+
#
|
977
|
+
# Creates a resource.
|
978
|
+
#
|
979
|
+
# @param resource_group_name [String] The name of the resource group for the
|
980
|
+
# resource. The name is case insensitive.
|
981
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
982
|
+
# provider.
|
983
|
+
# @param parent_resource_path [String] The parent resource identity.
|
984
|
+
# @param resource_type [String] The resource type of the resource to create.
|
985
|
+
# @param resource_name [String] The name of the resource to create.
|
986
|
+
# @param api_version [String] The API version to use for the operation.
|
987
|
+
# @param parameters [GenericResource] Parameters for creating or updating the
|
988
|
+
# resource.
|
989
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
990
|
+
# will be added to the HTTP request.
|
991
|
+
#
|
992
|
+
# @return [GenericResource] operation results.
|
993
|
+
#
|
994
|
+
def begin_create_or_update(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers = nil)
|
995
|
+
response = begin_create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers).value!
|
996
|
+
response.body unless response.nil?
|
997
|
+
end
|
998
|
+
|
999
|
+
#
|
1000
|
+
# Creates a resource.
|
1001
|
+
#
|
1002
|
+
# @param resource_group_name [String] The name of the resource group for the
|
1003
|
+
# resource. The name is case insensitive.
|
1004
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
1005
|
+
# provider.
|
1006
|
+
# @param parent_resource_path [String] The parent resource identity.
|
1007
|
+
# @param resource_type [String] The resource type of the resource to create.
|
1008
|
+
# @param resource_name [String] The name of the resource to create.
|
1009
|
+
# @param api_version [String] The API version to use for the operation.
|
1010
|
+
# @param parameters [GenericResource] Parameters for creating or updating the
|
1011
|
+
# resource.
|
1012
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1013
|
+
# will be added to the HTTP request.
|
1014
|
+
#
|
1015
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1016
|
+
#
|
1017
|
+
def begin_create_or_update_with_http_info(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers = nil)
|
1018
|
+
begin_create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers).value!
|
1019
|
+
end
|
1020
|
+
|
1021
|
+
#
|
1022
|
+
# Creates a resource.
|
1023
|
+
#
|
1024
|
+
# @param resource_group_name [String] The name of the resource group for the
|
1025
|
+
# resource. The name is case insensitive.
|
1026
|
+
# @param resource_provider_namespace [String] The namespace of the resource
|
1027
|
+
# provider.
|
1028
|
+
# @param parent_resource_path [String] The parent resource identity.
|
1029
|
+
# @param resource_type [String] The resource type of the resource to create.
|
1030
|
+
# @param resource_name [String] The name of the resource to create.
|
1031
|
+
# @param api_version [String] The API version to use for the operation.
|
1032
|
+
# @param parameters [GenericResource] Parameters for creating or updating the
|
1033
|
+
# resource.
|
1034
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1035
|
+
# to the HTTP request.
|
1036
|
+
#
|
1037
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1038
|
+
#
|
1039
|
+
def begin_create_or_update_async(resource_group_name, resource_provider_namespace, parent_resource_path, resource_type, resource_name, api_version, parameters, custom_headers = nil)
|
1040
|
+
fail ArgumentError, 'resource_group_name is nil' if resource_group_name.nil?
|
1041
|
+
fail ArgumentError, 'resource_provider_namespace is nil' if resource_provider_namespace.nil?
|
1042
|
+
fail ArgumentError, 'parent_resource_path is nil' if parent_resource_path.nil?
|
1043
|
+
fail ArgumentError, 'resource_type is nil' if resource_type.nil?
|
1044
|
+
fail ArgumentError, 'resource_name is nil' if resource_name.nil?
|
1045
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
1046
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1047
|
+
fail ArgumentError, '@client.subscription_id is nil' if @client.subscription_id.nil?
|
1048
|
+
|
1049
|
+
|
1050
|
+
request_headers = {}
|
1051
|
+
|
1052
|
+
# Set Headers
|
1053
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1054
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1055
|
+
|
1056
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1057
|
+
|
1058
|
+
# Serialize Request
|
1059
|
+
request_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::GenericResource.mapper()
|
1060
|
+
request_content = @client.serialize(request_mapper, parameters)
|
1061
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1062
|
+
|
1063
|
+
path_template = 'subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{parentResourcePath}/{resourceType}/{resourceName}'
|
1064
|
+
|
1065
|
+
request_url = @base_url || @client.base_url
|
1066
|
+
|
1067
|
+
options = {
|
1068
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1069
|
+
path_params: {'resourceGroupName' => resource_group_name,'resourceProviderNamespace' => resource_provider_namespace,'resourceName' => resource_name,'subscriptionId' => @client.subscription_id},
|
1070
|
+
skip_encoding_path_params: {'parentResourcePath' => parent_resource_path,'resourceType' => resource_type},
|
1071
|
+
query_params: {'api-version' => api_version},
|
1072
|
+
body: request_content,
|
1073
|
+
headers: request_headers.merge(custom_headers || {}),
|
1074
|
+
base_url: request_url
|
1075
|
+
}
|
1076
|
+
promise = @client.make_request_async(:put, path_template, options)
|
1077
|
+
|
1078
|
+
promise = promise.then do |result|
|
1079
|
+
http_response = result.response
|
1080
|
+
status_code = http_response.status
|
1081
|
+
response_content = http_response.body
|
1082
|
+
unless status_code == 201 || status_code == 200 || status_code == 202
|
1083
|
+
error_model = JSON.load(response_content)
|
1084
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1085
|
+
end
|
1086
|
+
|
1087
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1088
|
+
# Deserialize Response
|
1089
|
+
if status_code == 201
|
1090
|
+
begin
|
1091
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1092
|
+
result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::GenericResource.mapper()
|
1093
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1094
|
+
rescue Exception => e
|
1095
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1096
|
+
end
|
1097
|
+
end
|
1098
|
+
# Deserialize Response
|
1099
|
+
if status_code == 200
|
1100
|
+
begin
|
1101
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1102
|
+
result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::GenericResource.mapper()
|
1103
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1104
|
+
rescue Exception => e
|
1105
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1106
|
+
end
|
1107
|
+
end
|
1108
|
+
|
1109
|
+
result
|
1110
|
+
end
|
1111
|
+
|
1112
|
+
promise.execute
|
1113
|
+
end
|
1114
|
+
|
1115
|
+
#
|
1116
|
+
# Deletes a resource by ID.
|
1117
|
+
#
|
1118
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
1119
|
+
# the resource name and resource type. Use the format,
|
1120
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
1121
|
+
# @param api_version [String] The API version to use for the operation.
|
1122
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1123
|
+
# will be added to the HTTP request.
|
1124
|
+
#
|
1125
|
+
#
|
1126
|
+
def begin_delete_by_id(resource_id, api_version, custom_headers = nil)
|
1127
|
+
response = begin_delete_by_id_async(resource_id, api_version, custom_headers).value!
|
1128
|
+
nil
|
1129
|
+
end
|
1130
|
+
|
1131
|
+
#
|
1132
|
+
# Deletes a resource by ID.
|
1133
|
+
#
|
1134
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
1135
|
+
# the resource name and resource type. Use the format,
|
1136
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
1137
|
+
# @param api_version [String] The API version to use for the operation.
|
1138
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1139
|
+
# will be added to the HTTP request.
|
1140
|
+
#
|
1141
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1142
|
+
#
|
1143
|
+
def begin_delete_by_id_with_http_info(resource_id, api_version, custom_headers = nil)
|
1144
|
+
begin_delete_by_id_async(resource_id, api_version, custom_headers).value!
|
1145
|
+
end
|
1146
|
+
|
1147
|
+
#
|
1148
|
+
# Deletes a resource by ID.
|
1149
|
+
#
|
1150
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
1151
|
+
# the resource name and resource type. Use the format,
|
1152
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
1153
|
+
# @param api_version [String] The API version to use for the operation.
|
1154
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1155
|
+
# to the HTTP request.
|
1156
|
+
#
|
1157
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1158
|
+
#
|
1159
|
+
def begin_delete_by_id_async(resource_id, api_version, custom_headers = nil)
|
1160
|
+
fail ArgumentError, 'resource_id is nil' if resource_id.nil?
|
1161
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
1162
|
+
|
1163
|
+
|
1164
|
+
request_headers = {}
|
1165
|
+
|
1166
|
+
# Set Headers
|
1167
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1168
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1169
|
+
path_template = '{resourceId}'
|
1170
|
+
|
1171
|
+
request_url = @base_url || @client.base_url
|
1172
|
+
|
1173
|
+
options = {
|
1174
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1175
|
+
skip_encoding_path_params: {'resourceId' => resource_id},
|
1176
|
+
query_params: {'api-version' => api_version},
|
1177
|
+
headers: request_headers.merge(custom_headers || {}),
|
1178
|
+
base_url: request_url
|
1179
|
+
}
|
1180
|
+
promise = @client.make_request_async(:delete, path_template, options)
|
1181
|
+
|
1182
|
+
promise = promise.then do |result|
|
1183
|
+
http_response = result.response
|
1184
|
+
status_code = http_response.status
|
1185
|
+
response_content = http_response.body
|
1186
|
+
unless status_code == 200 || status_code == 204 || status_code == 202
|
1187
|
+
error_model = JSON.load(response_content)
|
1188
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1189
|
+
end
|
1190
|
+
|
1191
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1192
|
+
|
1193
|
+
result
|
1194
|
+
end
|
1195
|
+
|
1196
|
+
promise.execute
|
1197
|
+
end
|
1198
|
+
|
1199
|
+
#
|
1200
|
+
# Create a resource by ID.
|
1201
|
+
#
|
1202
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
1203
|
+
# the resource name and resource type. Use the format,
|
1204
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
1205
|
+
# @param api_version [String] The API version to use for the operation.
|
1206
|
+
# @param parameters [GenericResource] Create or update resource parameters.
|
1207
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1208
|
+
# will be added to the HTTP request.
|
1209
|
+
#
|
1210
|
+
# @return [GenericResource] operation results.
|
1211
|
+
#
|
1212
|
+
def begin_create_or_update_by_id(resource_id, api_version, parameters, custom_headers = nil)
|
1213
|
+
response = begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers).value!
|
1214
|
+
response.body unless response.nil?
|
1215
|
+
end
|
1216
|
+
|
1217
|
+
#
|
1218
|
+
# Create a resource by ID.
|
1219
|
+
#
|
1220
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
1221
|
+
# the resource name and resource type. Use the format,
|
1222
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
1223
|
+
# @param api_version [String] The API version to use for the operation.
|
1224
|
+
# @param parameters [GenericResource] Create or update resource parameters.
|
1225
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1226
|
+
# will be added to the HTTP request.
|
1227
|
+
#
|
1228
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1229
|
+
#
|
1230
|
+
def begin_create_or_update_by_id_with_http_info(resource_id, api_version, parameters, custom_headers = nil)
|
1231
|
+
begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers).value!
|
1232
|
+
end
|
1233
|
+
|
1234
|
+
#
|
1235
|
+
# Create a resource by ID.
|
1236
|
+
#
|
1237
|
+
# @param resource_id [String] The fully qualified ID of the resource, including
|
1238
|
+
# the resource name and resource type. Use the format,
|
1239
|
+
# /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
|
1240
|
+
# @param api_version [String] The API version to use for the operation.
|
1241
|
+
# @param parameters [GenericResource] Create or update resource parameters.
|
1242
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1243
|
+
# to the HTTP request.
|
1244
|
+
#
|
1245
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1246
|
+
#
|
1247
|
+
def begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers = nil)
|
1248
|
+
fail ArgumentError, 'resource_id is nil' if resource_id.nil?
|
1249
|
+
fail ArgumentError, 'api_version is nil' if api_version.nil?
|
1250
|
+
fail ArgumentError, 'parameters is nil' if parameters.nil?
|
1251
|
+
|
1252
|
+
|
1253
|
+
request_headers = {}
|
1254
|
+
|
1255
|
+
# Set Headers
|
1256
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1257
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1258
|
+
|
1259
|
+
request_headers['Content-Type'] = 'application/json; charset=utf-8'
|
1260
|
+
|
1261
|
+
# Serialize Request
|
1262
|
+
request_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::GenericResource.mapper()
|
1263
|
+
request_content = @client.serialize(request_mapper, parameters)
|
1264
|
+
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
1265
|
+
|
1266
|
+
path_template = '{resourceId}'
|
1267
|
+
|
1268
|
+
request_url = @base_url || @client.base_url
|
1269
|
+
|
1270
|
+
options = {
|
1271
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1272
|
+
skip_encoding_path_params: {'resourceId' => resource_id},
|
1273
|
+
query_params: {'api-version' => api_version},
|
1274
|
+
body: request_content,
|
1275
|
+
headers: request_headers.merge(custom_headers || {}),
|
1276
|
+
base_url: request_url
|
1277
|
+
}
|
1278
|
+
promise = @client.make_request_async(:put, path_template, options)
|
1279
|
+
|
1280
|
+
promise = promise.then do |result|
|
1281
|
+
http_response = result.response
|
1282
|
+
status_code = http_response.status
|
1283
|
+
response_content = http_response.body
|
1284
|
+
unless status_code == 201 || status_code == 200 || status_code == 202
|
1285
|
+
error_model = JSON.load(response_content)
|
1286
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1287
|
+
end
|
1288
|
+
|
1289
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1290
|
+
# Deserialize Response
|
1291
|
+
if status_code == 201
|
1292
|
+
begin
|
1293
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1294
|
+
result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::GenericResource.mapper()
|
1295
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1296
|
+
rescue Exception => e
|
1297
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1298
|
+
end
|
1299
|
+
end
|
1300
|
+
# Deserialize Response
|
1301
|
+
if status_code == 200
|
1302
|
+
begin
|
1303
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1304
|
+
result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::GenericResource.mapper()
|
1305
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1306
|
+
rescue Exception => e
|
1307
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1308
|
+
end
|
1309
|
+
end
|
1310
|
+
|
1311
|
+
result
|
1312
|
+
end
|
1313
|
+
|
1314
|
+
promise.execute
|
1315
|
+
end
|
1316
|
+
|
1317
|
+
#
|
1318
|
+
# Get all the resources in a subscription.
|
1319
|
+
#
|
1320
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1321
|
+
# to List operation.
|
1322
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1323
|
+
# will be added to the HTTP request.
|
1324
|
+
#
|
1325
|
+
# @return [ResourceListResult] operation results.
|
1326
|
+
#
|
1327
|
+
def list_next(next_page_link, custom_headers = nil)
|
1328
|
+
response = list_next_async(next_page_link, custom_headers).value!
|
1329
|
+
response.body unless response.nil?
|
1330
|
+
end
|
1331
|
+
|
1332
|
+
#
|
1333
|
+
# Get all the resources in a subscription.
|
1334
|
+
#
|
1335
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1336
|
+
# to List operation.
|
1337
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1338
|
+
# will be added to the HTTP request.
|
1339
|
+
#
|
1340
|
+
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
1341
|
+
#
|
1342
|
+
def list_next_with_http_info(next_page_link, custom_headers = nil)
|
1343
|
+
list_next_async(next_page_link, custom_headers).value!
|
1344
|
+
end
|
1345
|
+
|
1346
|
+
#
|
1347
|
+
# Get all the resources in a subscription.
|
1348
|
+
#
|
1349
|
+
# @param next_page_link [String] The NextLink from the previous successful call
|
1350
|
+
# to List operation.
|
1351
|
+
# @param [Hash{String => String}] A hash of custom headers that will be added
|
1352
|
+
# to the HTTP request.
|
1353
|
+
#
|
1354
|
+
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
1355
|
+
#
|
1356
|
+
def list_next_async(next_page_link, custom_headers = nil)
|
1357
|
+
fail ArgumentError, 'next_page_link is nil' if next_page_link.nil?
|
1358
|
+
|
1359
|
+
|
1360
|
+
request_headers = {}
|
1361
|
+
|
1362
|
+
# Set Headers
|
1363
|
+
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
1364
|
+
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
1365
|
+
path_template = '{nextLink}'
|
1366
|
+
|
1367
|
+
request_url = @base_url || @client.base_url
|
1368
|
+
|
1369
|
+
options = {
|
1370
|
+
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
1371
|
+
skip_encoding_path_params: {'nextLink' => next_page_link},
|
1372
|
+
headers: request_headers.merge(custom_headers || {}),
|
1373
|
+
base_url: request_url
|
1374
|
+
}
|
1375
|
+
promise = @client.make_request_async(:get, path_template, options)
|
1376
|
+
|
1377
|
+
promise = promise.then do |result|
|
1378
|
+
http_response = result.response
|
1379
|
+
status_code = http_response.status
|
1380
|
+
response_content = http_response.body
|
1381
|
+
unless status_code == 200
|
1382
|
+
error_model = JSON.load(response_content)
|
1383
|
+
fail MsRestAzure::AzureOperationError.new(result.request, http_response, error_model)
|
1384
|
+
end
|
1385
|
+
|
1386
|
+
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1387
|
+
# Deserialize Response
|
1388
|
+
if status_code == 200
|
1389
|
+
begin
|
1390
|
+
parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
|
1391
|
+
result_mapper = Azure::Resources::Mgmt::V2016_09_01::Models::ResourceListResult.mapper()
|
1392
|
+
result.body = @client.deserialize(result_mapper, parsed_response)
|
1393
|
+
rescue Exception => e
|
1394
|
+
fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
|
1395
|
+
end
|
1396
|
+
end
|
1397
|
+
|
1398
|
+
result
|
1399
|
+
end
|
1400
|
+
|
1401
|
+
promise.execute
|
1402
|
+
end
|
1403
|
+
|
1404
|
+
#
|
1405
|
+
# Get all the resources in a subscription.
|
1406
|
+
#
|
1407
|
+
# @param filter [String] The filter to apply on the operation.
|
1408
|
+
# @param expand [String] The $expand query parameter.
|
1409
|
+
# @param top [Integer] The number of results to return. If null is passed,
|
1410
|
+
# returns all resource groups.
|
1411
|
+
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
1412
|
+
# will be added to the HTTP request.
|
1413
|
+
#
|
1414
|
+
# @return [ResourceListResult] which provide lazy access to pages of the
|
1415
|
+
# response.
|
1416
|
+
#
|
1417
|
+
def list_as_lazy(filter = nil, expand = nil, top = nil, custom_headers = nil)
|
1418
|
+
response = list_async(filter, expand, top, custom_headers).value!
|
1419
|
+
unless response.nil?
|
1420
|
+
page = response.body
|
1421
|
+
page.next_method = Proc.new do |next_page_link|
|
1422
|
+
list_next_async(next_page_link, custom_headers)
|
1423
|
+
end
|
1424
|
+
page
|
1425
|
+
end
|
1426
|
+
end
|
1427
|
+
|
1428
|
+
end
|
1429
|
+
end
|