├── locale └── .keep ├── bin ├── update ├── setup └── rails ├── bundler.d └── .keep ├── config ├── settings.yml └── initializers │ ├── activerecord-id_regions.rb │ └── inflections.rb ├── spec ├── dummy │ ├── log │ │ └── .keep │ ├── tmp │ │ ├── .keep │ │ ├── pids │ │ │ └── .keep │ │ └── storage │ │ │ └── .keep │ ├── vendor │ │ └── .keep │ ├── lib │ │ ├── assets │ │ │ └── .keep │ │ └── tasks │ │ │ └── .keep │ ├── storage │ │ └── .keep │ ├── test │ │ ├── models │ │ │ └── .keep │ │ ├── system │ │ │ └── .keep │ │ ├── controllers │ │ │ └── .keep │ │ ├── helpers │ │ │ └── .keep │ │ ├── integration │ │ │ └── .keep │ │ ├── mailers │ │ │ └── .keep │ │ ├── fixtures │ │ │ └── files │ │ │ │ └── .keep │ │ ├── application_system_test_case.rb │ │ ├── channels │ │ │ └── application_cable │ │ │ │ └── connection_test.rb │ │ └── test_helper.rb │ ├── app │ │ ├── assets │ │ │ ├── images │ │ │ │ └── .keep │ │ │ ├── config │ │ │ │ └── manifest.js │ │ │ └── stylesheets │ │ │ │ └── application.css │ │ ├── models │ │ │ ├── concerns │ │ │ │ └── .keep │ │ │ └── application_record.rb │ │ ├── controllers │ │ │ ├── concerns │ │ │ │ └── .keep │ │ │ └── application_controller.rb │ │ ├── views │ │ │ ├── layouts │ │ │ │ ├── mailer.text.erb │ │ │ │ ├── mailer.html.erb │ │ │ │ └── application.html.erb │ │ │ └── pwa │ │ │ │ ├── manifest.json.erb │ │ │ │ └── service-worker.js │ │ ├── helpers │ │ │ └── application_helper.rb │ │ ├── channels │ │ │ └── application_cable │ │ │ │ ├── channel.rb │ │ │ │ └── connection.rb │ │ ├── mailers │ │ │ └── application_mailer.rb │ │ └── jobs │ │ │ └── application_job.rb │ ├── public │ │ ├── icon.png │ │ ├── robots.txt │ │ └── icon.svg │ ├── bin │ │ ├── rake │ │ ├── rails │ │ ├── brakeman │ │ ├── rubocop │ │ └── docker-entrypoint │ ├── config │ │ ├── boot.rb │ │ ├── environment.rb │ │ ├── cable.yml │ │ ├── database.tmpl.yml │ │ ├── credentials.yml.enc │ │ ├── initializers │ │ │ ├── filter_parameter_logging.rb │ │ │ ├── permissions_policy.rb │ │ │ └── inflections.rb │ │ ├── routes.rb │ │ └── locales │ │ │ └── en.yml │ ├── certs │ │ └── v2_key │ ├── config.ru │ ├── Rakefile │ ├── .rubocop.yml │ ├── .github │ │ └── dependabot.yml │ ├── .gitattributes │ ├── README.md │ ├── db │ │ └── seeds.rb │ └── .gitignore ├── support │ ├── yaml_alias_load_as_unsafe_load.rb │ ├── reserved_model_helper.rb │ ├── migration_name_helper.rb │ ├── migration_stubs.rb │ ├── migration_id_regions_helper.rb │ ├── database_helper.rb │ ├── constant_watcher.rb │ └── shared_examples_for_column_migration.rb ├── migrations │ ├── 20190531161732_add_guid_to_miq_databases_spec.rb │ ├── 20190304192641_add_provider_guids_spec.rb │ ├── 20200519213913_change_hardware_mem_types_spec.rb │ ├── 20190712135032_set_provisioned_state_to_services_spec.rb │ ├── 20200409175736_add_failed_login_attempts_to_users_spec.rb │ ├── 20200103191549_remove_miq_vim_broker_worker_rows_spec.rb │ ├── 20180112171348_drop_unnecessary_blob_parts_md5_spec.rb │ ├── 20190912152014_remove_embedded_ansible_workers_spec.rb │ ├── 20190108163812_remove_cinder_manager_event_worker_rows_spec.rb │ ├── 20210407183310_remove_google_network_refresh_workers_spec.rb │ ├── 20190228210310_service_templates_should_have_names_spec.rb │ ├── 20230830134742_delete_nil_timestamp_event_streams_spec.rb │ ├── 20180130165200_drop_webmks_spec.rb │ ├── 20180618084054_init_zones_visibility_spec.rb │ ├── 20181203224640_remove_renamed_ansible_tower_configuration_manager_refresh_worker_rows_spec.rb │ ├── 20210330012001_remove_regex_from_settings_spec.rb │ ├── 20180718132840_remove_transformation_product_setting_spec.rb │ ├── 20210817182147_remove_memcache_server_opts_spec.rb │ ├── 20210726194608_delete_rhn_authentications_spec.rb │ ├── 20200717181436_delete_workers_with_json_queue_names_spec.rb │ ├── 20190918133037_remove_rails_server_from_settings_spec.rb │ ├── 20210810191933_remove_update_repo_names_from_settings_spec.rb │ ├── 20191002103406_remove_quadicon_settings_spec.rb │ ├── 20210118185402_subclass_cinder_manager_openstack_spec.rb │ ├── 20230322171110_delete_foreman_provisioning_refresh_settings_spec.rb │ ├── 20200122215829_upgrade_dropbox_to_support_tool_spec.rb │ ├── 20180810144738_update_default_internal_attribute_spec.rb │ ├── 20191114131917_remove_miqwidget_rss_spec.rb │ ├── 20181119154009_set_vm_connection_state_spec.rb │ ├── 20180201152816_remove_invalid_server_hostnames_spec.rb │ ├── 20200128122000_add_type_column_to_service_order_spec.rb │ ├── 20221010195912_update_placement_group_view_feature_identifier_spec.rb │ ├── 20201208092011_append_alert_statuses_feature_spec.rb │ ├── 20171109225052_remove_string_column_limits_spec.rb │ ├── 20190909195908_set_zone_visible_column_default_true_spec.rb │ ├── 20181130203334_classification_parent_null_spec.rb │ └── 20240214165402_remove_openstack_network_manager_metrics_collector_workers_spec.rb ├── automated_review │ ├── belongs_to_required_by_default_spec.rb │ ├── column_documentation_spec.rb │ ├── empty_database_spec.rb │ └── data_migrations_need_tests_spec.rb ├── replication │ └── util │ │ └── primary_key_spec.rb └── spec_helper.rb ├── lib ├── manageiq-schema.rb ├── manageiq │ ├── schema │ │ ├── version.rb │ │ ├── command_recorder.rb │ │ └── migrate_with_cleared_schema_cache.rb │ └── schema.rb ├── reserve.rb ├── migration_stub_helper.rb ├── tasks │ └── README.md ├── reserved_mixin.rb ├── reserved_migration_mixin.rb ├── generators │ └── migration │ │ └── templates │ │ └── migration_spec.rb.tt └── reserved_shared_mixin.rb ├── .rspec ├── .rspec_ci ├── .whitesource ├── .rubocop.yml ├── db └── migrate │ ├── 20180215164010_add_hostname_to_vm.rb │ ├── 20200819184941_add_user_to_sessions.rb │ ├── 20180618083035_add_visible_to_zone.rb │ ├── 20180625120055_add_ems_ref_to_lans.rb │ ├── 20190801025013_add_ems_ref_to_disk.rb │ ├── 20191210162908_add_type_to_storages.rb │ ├── 20190325160127_add_state_to_services.rb │ ├── 20180611131314_add_status_to_storages.rb │ ├── 20190916150002_add_application_url.rb │ ├── 20200424183342_add_read_only_to_dialogs.rb │ ├── 20180213204846_link_queue_and_task.rb │ ├── 20190521172822_rename_service_state.rb │ ├── 20191128111630_add_restart_needed_to_vms.rb │ ├── 20200728025005_add_hidden_to_clusters.rb │ ├── 20180206140653_add_switch_id_to_hardwares.rb │ ├── 20190801025156_add_ems_ref_to_guest_device.rb │ ├── 20190830133434_add_speed_to_guest_devices.rb │ ├── 20191118161213_add_type_to_resource_pools.rb │ ├── 20180216173931_add_emf_ref_to_physical_rack.rb │ ├── 20180620170052_add_aws_region_to_file_depot.rb │ ├── 20180713194229_add_canister_id_to_hardwares.rb │ ├── 20201105151502_add_system_uid_to_miq_workers.rb │ ├── 20180613200937_add_firmware_type_to_hardware.rb │ ├── 20180924144957_rename_physical_disk_type.rb │ ├── 20190201173247_add_host_id_to_switch.rb │ ├── 20190318190517_add_zone_to_service_templates.rb │ ├── 20191209162705_drop_ems_ref_from_host_storage.rb │ ├── 20210317135305_add_ems_ref_to_authentications.rb │ ├── 20210329120600_add_shared_to_network_service.rb │ ├── 20210729132849_add_options_to_endpoints.rb │ ├── 20180323204738_add_part_number_to_asset_details.rb │ ├── 20180827145819_add_link_to_notification_types.rb │ ├── 20190123210452_add_accessible_to_host_storages.rb │ ├── 20190827141149_rename_service_display_to_visible.rb │ ├── 20190916132550_add_application_build_time.rb │ ├── 20200109190758_add_desc_string_to_miq_group.rb │ ├── 20200924151045_add_vendor_to_configured_systems.rb │ ├── 20210808125201_add_health_state_to_cloud_volume.rb │ ├── 20251105160058_drop_miq_schedule_file_depot.rb │ ├── 20180606201908_rename_towhat_to_resource_type.rb │ ├── 20180706115011_add_loc_led_name_asset_details.rb │ ├── 20190731175747_add_initiator_type_to_miq_requests.rb │ ├── 20200428144000_add_description_to_cloud_network.rb │ ├── 20210217201406_add_capabilities_to_provider.rb │ ├── 20211124180240_add_type_to_host_initiator_groups.rb │ ├── 20220927184751_add_type_to_snapshots.rb │ ├── 20180306194651_add_peer_mac_address_to_guest_devices.rb │ ├── 20181002123523_add_total_space_to_physical_storages.rb │ ├── 20190110201414_add_multi_attachment_to_cloud_volume.rb │ ├── 20190225142729_add_last_inventory_date_to_ems.rb │ ├── 20220202122417_add_parent_relation_to_miq_requests.rb │ ├── 20220617140212_add_become_method_to_authentications.rb │ ├── 20171031000000_add_migrations_ran_to_miq_regions.rb │ ├── 20200219125312_add_thin_and_format_to_disk.rb │ ├── 20210824231354_add_timestamps_to_binary_blobs.rb │ ├── 20220324143540_add_validation_message_to_dialog_fields.rb │ ├── 20220527165347_add_last_refresh_success_date.rb │ ├── 20180530160321_add_report_base_model_to_chargeback_rate.rb │ ├── 20180830121026_add_port_status_to_physical_network_ports.rb │ ├── 20180920085721_add_maintenance_zone_id_to_region.rb │ ├── 20190723023214_add_authentication_id_to_git_repository.rb │ ├── 20200921142257_rename_container_label_tag_mapping.rb │ ├── 20250603164519_drop_tenant_use_config_for_attributes.rb │ ├── 20190520174739_add_price_to_services.rb │ ├── 20191114131917_remove_miqwidget_rss.rb │ ├── 20230426164308_add_configuration_script_to_resource_action.rb │ ├── 20180713201539_add_physical_chassis_id_to_physical_storage.rb │ ├── 20181012160010_remove_special_characters_from_ansible_rabbitmq_password.rb │ ├── 20190729165913_add_ems_id_to_storages.rb │ ├── 20201008185329_add_orchestration_stacks_to_configured_systems.rb │ ├── 20210223085046_add_last_perf_capture_on_to_container_images.rb │ ├── 20180525111220_add_connected_port_to_physical_network_port.rb │ ├── 20180607134817_add_network_router_id_to_floating_ip.rb │ ├── 20180817152201_add_cloud_subnet_id_to_security_group.rb │ ├── 20180905144610_remove_report_base_model_from_chargeback_rate.rb │ ├── 20190930054416_add_resource_group_id_to_network_port.rb │ ├── 20200914005000_add_target_platform_to_configuration_profiles.rb │ ├── 20230710181609_drop_container_project_old_container_group.rb │ ├── 20250624062003_add_type_to_container_projects.rb │ ├── 20180817152200_add_network_router_id_to_security_group.rb │ ├── 20190930054405_add_resource_group_id_to_cloud_network.rb │ ├── 20190930054424_add_resource_group_id_to_security_group.rb │ ├── 20200922180455_add_family_to_physical_storages.rb │ ├── 20210217201401_add_capabilities_to_ext_management_system.rb │ ├── 20191001174700_rename_chargeback_rate_detail_currency_to_currency.rb │ ├── 20201012120000_update_comment_to_vms_table_format.rb │ ├── 20180202194924_add_vlan_info_to_guest_devices.rb │ ├── 20180219151037_add_last_updated_on_to_configuration_script_source.rb │ ├── 20180828092111_add_parent_physical_chassis_id_to_physical_chassis.rb │ ├── 20190716210326_add_git_repository_to_configuration_script_source.rb │ ├── 20191210135022_add_maintenance_mode_to_storages.rb │ ├── 20180329141018_add_last_update_error_to_configuration_script_source.rb │ ├── 20210726060426_add_fields_to_host_initiators.rb │ ├── 20180313135925_add_vm_ems_ref_to_event_streams.rb │ ├── 20190513155251_add_price_to_service_templates.rb │ ├── 20181023171353_add_tenant_id_and_tenant_node_to_miq_product_features.rb │ ├── 20240105173129_add_orchestration_stack_configuration_script.rb │ ├── 20180605210436_add_title_cves_to_openscap_rule_results.rb │ ├── 20180618084757_add_zone_before_pause_id_to_ext_management_system.rb │ ├── 20210211174438_add_type_to_volume_mappings_and_host_initiators.rb │ ├── 20190517093412_create_firmware_targets.rb │ ├── 20180705190447_add_chassis_and_switch_to_event_stream.rb │ ├── 20220719151539_add_physical_storage_to_event_streams.rb │ ├── 20171219162756_add_options_and_status_to_service_resource.rb │ ├── 20180813141056_add_cancelation_status_to_miq_request.rb │ ├── 20181003122633_add_canister_id_and_ems_ref_to_physical_disks.rb │ ├── 20190305181255_add_provider_services_supported_to_availability_zone.rb │ ├── 20200227195911_drop_region_migrations_ran.rb │ ├── 20200806112501_expand_cloud_volume.rb │ ├── 20231108172936_add_valid_to_configuration_scripts.rb │ ├── 20180209180035_add_compliance_information_to_physical_servers.rb │ ├── 20210923144304_add_host_initiator_group_references.rb │ ├── 20220808064045_create_request_log.rb │ ├── 20230609190136_create_container_indexes.rb │ ├── 20200103191549_remove_miq_vim_broker_worker_rows.rb │ ├── 20210330172200_add_destinations_sources_excluded_to_security_policy_rule.rb │ ├── 20180201152816_remove_invalid_server_hostnames.rb │ ├── 20210622184700_rename_flavors_cpus_to_match_hardware.rb │ ├── 20171130164503_add_unique_set_size_to_miq_servers_miq_workers.rb │ ├── 20190613214747_add_ansible_columns_to_authentications.rb │ ├── 20210519200613_add_miq_set_memberships.rb │ ├── 20171031010000_add_schema_migrations_ran.rb │ ├── 20190909195908_set_zone_visible_column_default_true.rb │ ├── 20190918133037_remove_rails_server_from_settings.rb │ ├── 20190514115219_create_firmware_registries.rb │ ├── 20210407183310_remove_google_network_refresh_workers.rb │ ├── 20171109225052_remove_string_column_limits.rb │ ├── 20191115164358_create_miq_worker_types.rb │ ├── 20200717181436_delete_workers_with_json_queue_names.rb │ ├── 20180130165200_drop_webmks.rb │ ├── 20180718132840_remove_transformation_product_setting.rb │ ├── 20230830134742_delete_nil_timestamp_event_streams.rb │ ├── 20180116210505_create_physical_racks_and_add_to_physical_servers.rb │ ├── 20210817182147_remove_memcache_server_opts.rb │ ├── 20210831202037_drop_database_backups_table.rb │ ├── 20171117201600_downcase_resource_group_ems_ref_for_azure.rb │ ├── 20181010134649_add_evm_owner_to_orchestration_stacks.rb │ ├── 20171219161635_create_transformation_mappings.rb │ ├── 20180129152935_remove_hawkular_ems.rb │ ├── 20180618212608_create_cloud_volume_types.rb │ ├── 20200608163713_create_physical_storage_families.rb │ ├── 20251105160057_drop_miq_schedule_file_depot_records.rb │ ├── 20190912152014_remove_embedded_ansible_workers.rb │ ├── 20180323204821_remove_switch_details_from_switches.rb │ ├── 20180618084054_init_zones_visibility.rb │ ├── 20190327132620_dialog_field_load_values_on_init.rb │ ├── 20180810144738_update_default_internal_attribute.rb │ ├── 20210824000038_default_admin_state_up.rb │ ├── 20210810191933_remove_update_repo_names_from_settings.rb │ ├── 20190314110421_create_join_table_service_template_tenant.rb │ ├── 20190514124322_create_firmware_binaries.rb │ ├── 20210330012001_remove_regex_from_settings.rb │ ├── 20221117080009_create_physical_server_profile_templates.rb │ ├── 20180917151300_add_limits_to_conversion_host.rb │ ├── 20210726194608_delete_rhn_authentications.rb │ ├── 20221116104013_add_capabilities_to_physical_storage_models.rb │ ├── 20190604090631_create_external_urls.rb │ ├── 20201111154314_create_host_initiators.rb │ ├── 20210728143006_remove_old_ems_id_from_container_tables.rb │ ├── 20230322171110_delete_foreman_provisioning_refresh_settings.rb │ ├── 20200409175736_add_failed_login_attempts_to_users.rb │ ├── 20180817212259_add_api_version_and_domain_id_and_security_protocol_and_openstack_region_to_file_depot.rb │ ├── 20200521150213_create_storage_services.rb │ ├── 20210925144400_create_wwpn_candidates.rb │ ├── 20190531161732_add_guid_to_miq_databases.rb │ ├── 20191023180149_add_ems_ref_type.rb │ ├── 20180719162710_add_owner_and_group_to_auth.rb │ ├── 20200519213913_change_hardware_mem_types.rb │ ├── 20180807152553_drop_vim_performance_tag_values.rb │ ├── 20171213223553_move_ems_refresh_openstack_settings.rb │ ├── 20190712135032_set_provisioned_state_to_services.rb │ ├── 20191113200451_remove_ems_ref_obj.rb │ ├── 20230407170430_add_payload_credentials_configuration_scripts.rb │ ├── 20181119154009_set_vm_connection_state.rb │ ├── 20190528161746_add_ems_extensions.rb │ ├── 20180118131417_change_container_quota_items_to_decimals.rb │ ├── 20190517093516_create_firmware_binary_firmware_targets.rb │ ├── 20210810114405_create_host_initiator_groups.rb │ ├── 20190228210310_service_templates_should_have_names.rb │ ├── 20240214165402_remove_openstack_network_manager_metrics_collector_workers.rb │ ├── 20190304192641_add_provider_guids.rb │ ├── 20190301174502_remove_rss_feeds.rb │ ├── 20190528160313_add_ems_licenses.rb │ ├── 20180726142030_create_physical_disk.rb │ ├── 20181203224640_remove_renamed_ansible_tower_configuration_manager_refresh_worker_rows.rb │ ├── 20171219151634_create_transformation_mapping_items.rb │ ├── 20201220133400_create_volume_mappings.rb │ ├── 20210118185402_subclass_cinder_manager_openstack.rb │ ├── 20190108163812_remove_cinder_manager_event_worker_rows.rb │ ├── 20230919143746_remove_vim_strings_from_miq_queue.rb │ ├── 20200122215829_upgrade_dropbox_to_support_tool.rb │ ├── 20180319113755_add_product_details_columns_to_asset_details.rb │ ├── 20181002192054_fix_conversion_host_resource_type.rb │ ├── 20200519141015_create_storage_resources.rb │ ├── 20201124063738_create_san_addresses.rb │ ├── 20191002103406_remove_quadicon_settings.rb │ ├── 20221107195559_drop_iso_datastore.rb │ ├── 20220909190221_drop_cockpit_role.rb │ ├── 20180426163655_create_physical_storage.rb │ ├── 20191017211747_add_general_indexes.rb │ ├── 20200427122455_remove_vim_strings_from_notifications.rb │ ├── 20171117201519_update_resource_group_type_for_azure.rb │ ├── 20180807153714_add_conversion_host_table.rb │ ├── 20230220204405_delete_ovirt_rhv_network_event_catcher_workers.rb │ ├── 20180126144529_add_extra_information_to_switches.rb │ ├── 20220407210610_placement_group_additions.rb │ ├── 20220707150906_create_cloud_database_server.rb │ ├── 20180409120422_create_physical_network_ports.rb │ ├── 20221111201223_remove_vim_strings_from_custom_attributes.rb │ ├── 20211119152213_remove_hawkular_authentications.rb │ ├── 20220401093502_create_physical_server_profiles.rb │ ├── 20221114165219_remove_vim_string_from_miq_request_task_options.rb │ ├── 20200629194033_remove_vim_strings_from_miq_provision.rb │ ├── 20241017013023_reencrypt_password_scramsha.rb │ ├── 20181130203334_classification_parent_null.rb │ ├── 20200524074928_create_storage_service_resource_attachments.rb │ ├── 20230709181609_drop_archived_container_projects.rb │ ├── 20191112132759_copy_owner_id_to_group_id_for_dashboards.rb │ ├── 20230310183805_delete_ovn_event_catcher_settings.rb │ ├── 20180827083140_create_service_instances_table.rb │ ├── 20180713194201_create_canister.rb │ ├── 20221010195912_update_placement_group_view_feature_identifier.rb │ ├── 20201208092011_append_alert_statuses_feature.rb │ ├── 20180405145642_remove_provider_region_for_google_provider.rb │ ├── 20210819145618_update_network_router_admin_state_up.rb │ ├── 20180112171348_drop_unnecessary_blob_parts_md5.rb │ ├── 20180507134810_azure_normalize_image_name.rb │ ├── 20180327162308_create_physical_chassis.rb │ ├── 20191023180130_update_openstack_hosts_uid_ems.rb │ ├── 20240227184516_update_audit_managed_resources_queue_name.rb │ ├── 20181012161000_remove_special_characters_from_ansible_rabbitmq_password_two.rb │ ├── 20190726204302_remove_local_default_embedded_ansible_repos.rb │ ├── 20210105162025_subclass_swift_manager_openstack.rb │ ├── 20180712122000_remove_host_provisioning.rb │ ├── 20250603164430_update_tenant_name.rb │ ├── 20200910163614_adjust_control_explorer_features.rb │ ├── 20180605135438_add_resource_to_miq_schedule.rb │ ├── 20190201173316_add_missing_ems_id_to_switch.rb │ ├── 20200212171537_remove_ovirt_sdk4_from_event_stream.rb │ ├── 20191122203218_replace_server_capabilities_with_vix_disk_lib.rb │ ├── 20190809193031_move_embedded_ansible_proxy_setting_to_git_repository_proxy_settings.rb │ ├── 20210521192754_update_product_features_where_identifier_was_renamed_since_lasker.rb │ ├── 20190307131832_removing_authentication_for_container_deployments.rb │ ├── 20191126204129_remove_middleware_columns_in_event_streams.rb │ ├── 20180525171150_add_deleted_on_to_service_template.rb │ ├── 20220223095704_remove_col3_from_miq_widget_set.rb │ ├── 20180606083431_convert_quadicon_settings_keys.rb │ ├── 20200128122000_add_type_column_to_service_order.rb │ ├── 20210106201124_update_policy_log_startpage_url.rb │ ├── 20200428143000_create_network_service.rb │ ├── 20210106180202_update_policy_rsop_startpage_url.rb │ ├── 20201022201901_update_amazon_tag_mapper_resource_type.rb │ └── 20210106200226_update_policy_export_startpage_url.rb ├── renovate.json ├── .rubocop_local.yml ├── .yamllint ├── .gitignore ├── Rakefile └── Gemfile /locale/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /bin/update: -------------------------------------------------------------------------------- 1 | ./setup -------------------------------------------------------------------------------- /bundler.d/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /config/settings.yml: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/log/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/tmp/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/vendor/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/lib/assets/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/lib/tasks/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/storage/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/test/models/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/test/system/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/tmp/pids/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/tmp/storage/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/test/controllers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/test/helpers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/test/integration/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/test/mailers/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/app/assets/images/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/app/models/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/test/fixtures/files/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /spec/dummy/app/controllers/concerns/.keep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /lib/manageiq-schema.rb: -------------------------------------------------------------------------------- 1 | require "manageiq/schema" 2 | -------------------------------------------------------------------------------- /spec/dummy/app/views/layouts/mailer.text.erb: -------------------------------------------------------------------------------- 1 | <%= yield %> 2 | -------------------------------------------------------------------------------- /.rspec: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | --color 3 | --order defined 4 | -------------------------------------------------------------------------------- /spec/dummy/app/helpers/application_helper.rb: -------------------------------------------------------------------------------- 1 | module ApplicationHelper 2 | end 3 | -------------------------------------------------------------------------------- /.rspec_ci: -------------------------------------------------------------------------------- 1 | --require spec_helper 2 | --color 3 | --order defined 4 | --profile 25 5 | -------------------------------------------------------------------------------- /.whitesource: -------------------------------------------------------------------------------- 1 | { 2 | "settingsInheritedFrom": "ManageIQ/whitesource-config@master" 3 | } 4 | -------------------------------------------------------------------------------- /spec/dummy/app/assets/config/manifest.js: -------------------------------------------------------------------------------- 1 | //= link_tree ../images 2 | //= link_directory ../stylesheets .css 3 | -------------------------------------------------------------------------------- /spec/dummy/public/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ManageIQ/manageiq-schema/HEAD/spec/dummy/public/icon.png -------------------------------------------------------------------------------- /.rubocop.yml: -------------------------------------------------------------------------------- 1 | inherit_gem: 2 | manageiq-style: ".rubocop_base.yml" 3 | inherit_from: 4 | - ".rubocop_local.yml" 5 | -------------------------------------------------------------------------------- /config/initializers/activerecord-id_regions.rb: -------------------------------------------------------------------------------- 1 | ActiveRecord::Migration.include(ActiveRecord::IdRegions::Migration) 2 | -------------------------------------------------------------------------------- /lib/manageiq/schema/version.rb: -------------------------------------------------------------------------------- 1 | module ManageIQ 2 | module Schema 3 | VERSION = '0.1.0'.freeze 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/dummy/bin/rake: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require_relative "../config/boot" 3 | require "rake" 4 | Rake.application.run 5 | -------------------------------------------------------------------------------- /spec/dummy/app/models/application_record.rb: -------------------------------------------------------------------------------- 1 | class ApplicationRecord < ActiveRecord::Base 2 | primary_abstract_class 3 | end 4 | -------------------------------------------------------------------------------- /spec/dummy/public/robots.txt: -------------------------------------------------------------------------------- 1 | # See https://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file 2 | -------------------------------------------------------------------------------- /lib/reserve.rb: -------------------------------------------------------------------------------- 1 | class Reserve < ActiveRecord::Base 2 | belongs_to :resource, :polymorphic => true 3 | 4 | serialize :reserved 5 | end 6 | -------------------------------------------------------------------------------- /spec/dummy/app/channels/application_cable/channel.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Channel < ActionCable::Channel::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /spec/dummy/app/channels/application_cable/connection.rb: -------------------------------------------------------------------------------- 1 | module ApplicationCable 2 | class Connection < ActionCable::Connection::Base 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /spec/dummy/app/mailers/application_mailer.rb: -------------------------------------------------------------------------------- 1 | class ApplicationMailer < ActionMailer::Base 2 | default from: "from@example.com" 3 | layout "mailer" 4 | end 5 | -------------------------------------------------------------------------------- /spec/dummy/public/icon.svg: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /spec/support/yaml_alias_load_as_unsafe_load.rb: -------------------------------------------------------------------------------- 1 | if Psych::VERSION >= "4.0" 2 | require 'yaml' 3 | YAML.singleton_class.alias_method :load, :unsafe_load 4 | end 5 | -------------------------------------------------------------------------------- /spec/dummy/config/boot.rb: -------------------------------------------------------------------------------- 1 | ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../../Gemfile", __dir__) 2 | 3 | require "bundler/setup" # Set up gems listed in the Gemfile. 4 | -------------------------------------------------------------------------------- /bin/setup: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | if [ -z "$CI" ]; then 4 | bundle update --jobs=3 5 | fi 6 | 7 | cp -n spec/dummy/config/database.{tmpl.,}yml 8 | bundle exec rake spec:setup 9 | -------------------------------------------------------------------------------- /spec/dummy/bin/rails: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | APP_PATH = File.expand_path("../config/application", __dir__) 3 | require_relative "../config/boot" 4 | require "rails/commands" 5 | -------------------------------------------------------------------------------- /db/migrate/20180215164010_add_hostname_to_vm.rb: -------------------------------------------------------------------------------- 1 | class AddHostnameToVm < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :vms, :hostname, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200819184941_add_user_to_sessions.rb: -------------------------------------------------------------------------------- 1 | class AddUserToSessions < ActiveRecord::Migration[5.2] 2 | def change 3 | add_reference :sessions, :user 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "inheritConfig": true, 4 | "inheritConfigRepoName": "manageiq/renovate-config" 5 | } 6 | -------------------------------------------------------------------------------- /spec/dummy/config/environment.rb: -------------------------------------------------------------------------------- 1 | # Load the Rails application. 2 | require_relative "application" 3 | 4 | # Initialize the Rails application. 5 | Rails.application.initialize! 6 | -------------------------------------------------------------------------------- /db/migrate/20180618083035_add_visible_to_zone.rb: -------------------------------------------------------------------------------- 1 | class AddVisibleToZone < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :zones, :visible, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180625120055_add_ems_ref_to_lans.rb: -------------------------------------------------------------------------------- 1 | class AddEmsRefToLans < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :lans, :ems_ref, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190801025013_add_ems_ref_to_disk.rb: -------------------------------------------------------------------------------- 1 | class AddEmsRefToDisk < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :disks, :ems_ref, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191210162908_add_type_to_storages.rb: -------------------------------------------------------------------------------- 1 | class AddTypeToStorages < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :storages, :type, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190325160127_add_state_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddStateToServices < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :services, :state, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/dummy/bin/brakeman: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "rubygems" 3 | require "bundler/setup" 4 | 5 | ARGV.unshift("--ensure-latest") 6 | 7 | load Gem.bin_path("brakeman", "brakeman") 8 | -------------------------------------------------------------------------------- /db/migrate/20180611131314_add_status_to_storages.rb: -------------------------------------------------------------------------------- 1 | class AddStatusToStorages < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :storages, :status, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190916150002_add_application_url.rb: -------------------------------------------------------------------------------- 1 | class AddApplicationUrl < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :guest_applications, :url, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200424183342_add_read_only_to_dialogs.rb: -------------------------------------------------------------------------------- 1 | class AddReadOnlyToDialogs < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :dialogs, :system, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/dummy/certs/v2_key: -------------------------------------------------------------------------------- 1 | --- 2 | :EZCRYPTO KEY FILE: KEEP THIS SECURE ! 3 | :created: 2014-02-28 09:59:47 -0500 4 | :algorithm: aes-256-cbc 5 | :key: uXfIgSAUq5Oz8goc/zI8HOOo0SI++Sd9mfpgBanYIM4= 6 | -------------------------------------------------------------------------------- /db/migrate/20180213204846_link_queue_and_task.rb: -------------------------------------------------------------------------------- 1 | class LinkQueueAndTask < ActiveRecord::Migration[5.0] 2 | def change 3 | add_reference :miq_queue, :miq_task, :type => :bigint 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190521172822_rename_service_state.rb: -------------------------------------------------------------------------------- 1 | class RenameServiceState < ActiveRecord::Migration[5.0] 2 | def change 3 | rename_column :services, :state, :lifecycle_state 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191128111630_add_restart_needed_to_vms.rb: -------------------------------------------------------------------------------- 1 | class AddRestartNeededToVms < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :vms, :restart_needed, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200728025005_add_hidden_to_clusters.rb: -------------------------------------------------------------------------------- 1 | class AddHiddenToClusters < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :ems_clusters, :hidden, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180206140653_add_switch_id_to_hardwares.rb: -------------------------------------------------------------------------------- 1 | class AddSwitchIdToHardwares < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :hardwares, :switch_id, :bigint 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190801025156_add_ems_ref_to_guest_device.rb: -------------------------------------------------------------------------------- 1 | class AddEmsRefToGuestDevice < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :guest_devices, :ems_ref, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190830133434_add_speed_to_guest_devices.rb: -------------------------------------------------------------------------------- 1 | class AddSpeedToGuestDevices < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :guest_devices, :speed, :bigint 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191118161213_add_type_to_resource_pools.rb: -------------------------------------------------------------------------------- 1 | class AddTypeToResourcePools < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :resource_pools, :type, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/dummy/config.ru: -------------------------------------------------------------------------------- 1 | # This file is used by Rack-based servers to start the application. 2 | 3 | require_relative "config/environment" 4 | 5 | run Rails.application 6 | Rails.application.load_server 7 | -------------------------------------------------------------------------------- /db/migrate/20180216173931_add_emf_ref_to_physical_rack.rb: -------------------------------------------------------------------------------- 1 | class AddEmfRefToPhysicalRack < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :physical_racks, :ems_ref, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180620170052_add_aws_region_to_file_depot.rb: -------------------------------------------------------------------------------- 1 | class AddAwsRegionToFileDepot < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :file_depots, :aws_region, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180713194229_add_canister_id_to_hardwares.rb: -------------------------------------------------------------------------------- 1 | class AddCanisterIdToHardwares < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :hardwares, :canister_id, :bigint 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201105151502_add_system_uid_to_miq_workers.rb: -------------------------------------------------------------------------------- 1 | class AddSystemUidToMiqWorkers < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :miq_workers, :system_uid, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /.rubocop_local.yml: -------------------------------------------------------------------------------- 1 | AllCops: 2 | Exclude: 3 | - 'spec/dummy/**/*' 4 | 5 | Rails/ApplicationRecord: 6 | Enabled: false 7 | 8 | Rails/SkipsModelValidations: 9 | AllowedMethods: 10 | - update_all 11 | -------------------------------------------------------------------------------- /.yamllint: -------------------------------------------------------------------------------- 1 | --- 2 | ignore: | 3 | /vendor/** 4 | /spec/manageiq/** 5 | 6 | extends: relaxed 7 | 8 | rules: 9 | indentation: 10 | indent-sequences: false 11 | line-length: 12 | max: 120 13 | -------------------------------------------------------------------------------- /db/migrate/20180613200937_add_firmware_type_to_hardware.rb: -------------------------------------------------------------------------------- 1 | class AddFirmwareTypeToHardware < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :hardwares, :firmware_type, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180924144957_rename_physical_disk_type.rb: -------------------------------------------------------------------------------- 1 | class RenamePhysicalDiskType < ActiveRecord::Migration[5.0] 2 | def change 3 | rename_column :physical_disks, :type, :controller_type 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190201173247_add_host_id_to_switch.rb: -------------------------------------------------------------------------------- 1 | class AddHostIdToSwitch < ActiveRecord::Migration[5.0] 2 | def change 3 | add_reference :switches, :host, :type => :bigint, :index => true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190318190517_add_zone_to_service_templates.rb: -------------------------------------------------------------------------------- 1 | class AddZoneToServiceTemplates < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :service_templates, :zone_id, :bigint 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191209162705_drop_ems_ref_from_host_storage.rb: -------------------------------------------------------------------------------- 1 | class DropEmsRefFromHostStorage < ActiveRecord::Migration[5.1] 2 | def change 3 | remove_column :host_storages, :ems_ref, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210317135305_add_ems_ref_to_authentications.rb: -------------------------------------------------------------------------------- 1 | class AddEmsRefToAuthentications < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :authentications, :ems_ref, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210329120600_add_shared_to_network_service.rb: -------------------------------------------------------------------------------- 1 | class AddSharedToNetworkService < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :network_services, :shared, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210729132849_add_options_to_endpoints.rb: -------------------------------------------------------------------------------- 1 | class AddOptionsToEndpoints < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :endpoints, :options, :jsonb, :default => {} 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180323204738_add_part_number_to_asset_details.rb: -------------------------------------------------------------------------------- 1 | class AddPartNumberToAssetDetails < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :asset_details, :part_number, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180827145819_add_link_to_notification_types.rb: -------------------------------------------------------------------------------- 1 | class AddLinkToNotificationTypes < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :notification_types, :link_to, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190123210452_add_accessible_to_host_storages.rb: -------------------------------------------------------------------------------- 1 | class AddAccessibleToHostStorages < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :host_storages, :accessible, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190827141149_rename_service_display_to_visible.rb: -------------------------------------------------------------------------------- 1 | class RenameServiceDisplayToVisible < ActiveRecord::Migration[5.0] 2 | def change 3 | rename_column :services, :display, :visible 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190916132550_add_application_build_time.rb: -------------------------------------------------------------------------------- 1 | class AddApplicationBuildTime < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :guest_applications, :build_time, :timestamp 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200109190758_add_desc_string_to_miq_group.rb: -------------------------------------------------------------------------------- 1 | class AddDescStringToMiqGroup < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :miq_groups, :detailed_description, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200924151045_add_vendor_to_configured_systems.rb: -------------------------------------------------------------------------------- 1 | class AddVendorToConfiguredSystems < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :configured_systems, :vendor, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210808125201_add_health_state_to_cloud_volume.rb: -------------------------------------------------------------------------------- 1 | class AddHealthStateToCloudVolume < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :cloud_volumes, :health_state, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20251105160058_drop_miq_schedule_file_depot.rb: -------------------------------------------------------------------------------- 1 | class DropMiqScheduleFileDepot < ActiveRecord::Migration[7.2] 2 | def change 3 | remove_column :miq_schedules, :file_depot_id, :bigint 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180606201908_rename_towhat_to_resource_type.rb: -------------------------------------------------------------------------------- 1 | class RenameTowhatToResourceType < ActiveRecord::Migration[5.0] 2 | def change 3 | rename_column :miq_schedules, :towhat, :resource_type 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180706115011_add_loc_led_name_asset_details.rb: -------------------------------------------------------------------------------- 1 | class AddLocLedNameAssetDetails < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :asset_details, :location_led_ems_ref, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190731175747_add_initiator_type_to_miq_requests.rb: -------------------------------------------------------------------------------- 1 | class AddInitiatorTypeToMiqRequests < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :miq_requests, :initiated_by, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200428144000_add_description_to_cloud_network.rb: -------------------------------------------------------------------------------- 1 | class AddDescriptionToCloudNetwork < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :cloud_networks, :description, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210217201406_add_capabilities_to_provider.rb: -------------------------------------------------------------------------------- 1 | class AddCapabilitiesToProvider < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :providers, :capabilities, :jsonb, :default => {} 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20211124180240_add_type_to_host_initiator_groups.rb: -------------------------------------------------------------------------------- 1 | class AddTypeToHostInitiatorGroups < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :host_initiator_groups, :type, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20220927184751_add_type_to_snapshots.rb: -------------------------------------------------------------------------------- 1 | class AddTypeToSnapshots < ActiveRecord::Migration[6.1] 2 | def change 3 | add_column :snapshots, :type, :string 4 | add_index :snapshots, :type 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180306194651_add_peer_mac_address_to_guest_devices.rb: -------------------------------------------------------------------------------- 1 | class AddPeerMacAddressToGuestDevices < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :guest_devices, :peer_mac_address, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20181002123523_add_total_space_to_physical_storages.rb: -------------------------------------------------------------------------------- 1 | class AddTotalSpaceToPhysicalStorages < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :physical_storages, :total_space, :bigint 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190110201414_add_multi_attachment_to_cloud_volume.rb: -------------------------------------------------------------------------------- 1 | class AddMultiAttachmentToCloudVolume < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :cloud_volumes, :multi_attachment, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190225142729_add_last_inventory_date_to_ems.rb: -------------------------------------------------------------------------------- 1 | class AddLastInventoryDateToEms < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :ext_management_systems, :last_inventory_date, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20220202122417_add_parent_relation_to_miq_requests.rb: -------------------------------------------------------------------------------- 1 | class AddParentRelationToMiqRequests < ActiveRecord::Migration[6.0] 2 | def change 3 | add_reference :miq_requests, :parent, :type => :bigint 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20220617140212_add_become_method_to_authentications.rb: -------------------------------------------------------------------------------- 1 | class AddBecomeMethodToAuthentications < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :authentications, :become_method, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/dummy/test/application_system_test_case.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | class ApplicationSystemTestCase < ActionDispatch::SystemTestCase 4 | driven_by :selenium, using: :headless_chrome, screen_size: [ 1400, 1400 ] 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20171031000000_add_migrations_ran_to_miq_regions.rb: -------------------------------------------------------------------------------- 1 | class AddMigrationsRanToMiqRegions < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :miq_regions, :migrations_ran, :string, :array => true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200219125312_add_thin_and_format_to_disk.rb: -------------------------------------------------------------------------------- 1 | class AddThinAndFormatToDisk < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :disks, :thin, :boolean 4 | add_column :disks, :format, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20210824231354_add_timestamps_to_binary_blobs.rb: -------------------------------------------------------------------------------- 1 | class AddTimestampsToBinaryBlobs < ActiveRecord::Migration[6.0] 2 | def change 3 | add_timestamps :binary_blobs, :null => false, :default => -> { 'NOW()' } 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20220324143540_add_validation_message_to_dialog_fields.rb: -------------------------------------------------------------------------------- 1 | class AddValidationMessageToDialogFields < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :dialog_fields, :validator_message, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20220527165347_add_last_refresh_success_date.rb: -------------------------------------------------------------------------------- 1 | class AddLastRefreshSuccessDate < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :ext_management_systems, :last_refresh_success_date, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180530160321_add_report_base_model_to_chargeback_rate.rb: -------------------------------------------------------------------------------- 1 | class AddReportBaseModelToChargebackRate < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :chargeback_rates, :report_base_model, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180830121026_add_port_status_to_physical_network_ports.rb: -------------------------------------------------------------------------------- 1 | class AddPortStatusToPhysicalNetworkPorts < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :physical_network_ports, :port_status, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180920085721_add_maintenance_zone_id_to_region.rb: -------------------------------------------------------------------------------- 1 | class AddMaintenanceZoneIdToRegion < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :miq_regions, :maintenance_zone_id, :bigint, :index => true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190723023214_add_authentication_id_to_git_repository.rb: -------------------------------------------------------------------------------- 1 | class AddAuthenticationIdToGitRepository < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :git_repositories, :authentication_id, :bigint 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200921142257_rename_container_label_tag_mapping.rb: -------------------------------------------------------------------------------- 1 | class RenameContainerLabelTagMapping < ActiveRecord::Migration[5.2] 2 | def change 3 | rename_table :container_label_tag_mappings, :provider_tag_mappings 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20250603164519_drop_tenant_use_config_for_attributes.rb: -------------------------------------------------------------------------------- 1 | class DropTenantUseConfigForAttributes < ActiveRecord::Migration[7.0] 2 | def change 3 | remove_column :tenants, :use_config_for_attributes, :boolean 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190520174739_add_price_to_services.rb: -------------------------------------------------------------------------------- 1 | class AddPriceToServices < ActiveRecord::Migration[5.0] 2 | def change 3 | add_reference :services, :currency, :type => :bigint 4 | add_column :services, :price, :float 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20191114131917_remove_miqwidget_rss.rb: -------------------------------------------------------------------------------- 1 | class RemoveMiqwidgetRss < ActiveRecord::Migration[5.1] 2 | class MiqWidget < ActiveRecord::Base; end 3 | 4 | def up 5 | MiqWidget.where(:content_type => 'rss').delete_all 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20230426164308_add_configuration_script_to_resource_action.rb: -------------------------------------------------------------------------------- 1 | class AddConfigurationScriptToResourceAction < ActiveRecord::Migration[6.1] 2 | def change 3 | add_reference :resource_actions, :configuration_script 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180713201539_add_physical_chassis_id_to_physical_storage.rb: -------------------------------------------------------------------------------- 1 | class AddPhysicalChassisIdToPhysicalStorage < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :physical_storages, :physical_chassis_id, :bigint 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20181012160010_remove_special_characters_from_ansible_rabbitmq_password.rb: -------------------------------------------------------------------------------- 1 | class RemoveSpecialCharactersFromAnsibleRabbitmqPassword < ActiveRecord::Migration[5.0] 2 | # noop - see RemoveSpecialCharactersFromAnsibleRabbitmqPasswordTwo 3 | end 4 | -------------------------------------------------------------------------------- /db/migrate/20190729165913_add_ems_id_to_storages.rb: -------------------------------------------------------------------------------- 1 | class AddEmsIdToStorages < ActiveRecord::Migration[5.0] 2 | def change 3 | add_reference :storages, :ems, :type => :bigint, :index => true, :references => :ext_management_system 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201008185329_add_orchestration_stacks_to_configured_systems.rb: -------------------------------------------------------------------------------- 1 | class AddOrchestrationStacksToConfiguredSystems < ActiveRecord::Migration[5.2] 2 | def change 3 | add_reference :configured_systems, :orchestration_stack 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210223085046_add_last_perf_capture_on_to_container_images.rb: -------------------------------------------------------------------------------- 1 | class AddLastPerfCaptureOnToContainerImages < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :container_images, :last_perf_capture_on, :datetime 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180525111220_add_connected_port_to_physical_network_port.rb: -------------------------------------------------------------------------------- 1 | class AddConnectedPortToPhysicalNetworkPort < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :physical_network_ports, :connected_port_uid, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180607134817_add_network_router_id_to_floating_ip.rb: -------------------------------------------------------------------------------- 1 | class AddNetworkRouterIdToFloatingIp < ActiveRecord::Migration[5.0] 2 | def change 3 | add_reference(:floating_ips, :network_router, :type => :bigint, :index => true) 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180817152201_add_cloud_subnet_id_to_security_group.rb: -------------------------------------------------------------------------------- 1 | class AddCloudSubnetIdToSecurityGroup < ActiveRecord::Migration[5.0] 2 | def change 3 | add_reference :security_groups, :cloud_subnet, :type => :bigint, :index => true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180905144610_remove_report_base_model_from_chargeback_rate.rb: -------------------------------------------------------------------------------- 1 | class RemoveReportBaseModelFromChargebackRate < ActiveRecord::Migration[5.0] 2 | def change 3 | remove_column :chargeback_rates, :report_base_model, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190930054416_add_resource_group_id_to_network_port.rb: -------------------------------------------------------------------------------- 1 | class AddResourceGroupIdToNetworkPort < ActiveRecord::Migration[5.1] 2 | def change 3 | add_reference :network_ports, :resource_group, :type => :bigint, :index => true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200914005000_add_target_platform_to_configuration_profiles.rb: -------------------------------------------------------------------------------- 1 | class AddTargetPlatformToConfigurationProfiles < ActiveRecord::Migration[5.2] 2 | def change 3 | add_column :configuration_profiles, :target_platform, :string 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20230710181609_drop_container_project_old_container_group.rb: -------------------------------------------------------------------------------- 1 | class DropContainerProjectOldContainerGroup < ActiveRecord::Migration[6.1] 2 | def change 3 | remove_column :container_groups, :old_container_project_id, :bigint 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20250624062003_add_type_to_container_projects.rb: -------------------------------------------------------------------------------- 1 | class AddTypeToContainerProjects < ActiveRecord::Migration[7.0] 2 | def change 3 | add_column :container_projects, :type, :string 4 | add_index :container_projects, :type 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180817152200_add_network_router_id_to_security_group.rb: -------------------------------------------------------------------------------- 1 | class AddNetworkRouterIdToSecurityGroup < ActiveRecord::Migration[5.0] 2 | def change 3 | add_reference :security_groups, :network_router, :type => :bigint, :index => true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190930054405_add_resource_group_id_to_cloud_network.rb: -------------------------------------------------------------------------------- 1 | class AddResourceGroupIdToCloudNetwork < ActiveRecord::Migration[5.1] 2 | def change 3 | add_reference :cloud_networks, :resource_group, :type => :bigint, :index => true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190930054424_add_resource_group_id_to_security_group.rb: -------------------------------------------------------------------------------- 1 | class AddResourceGroupIdToSecurityGroup < ActiveRecord::Migration[5.1] 2 | def change 3 | add_reference :security_groups, :resource_group, :type => :bigint, :index => true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200922180455_add_family_to_physical_storages.rb: -------------------------------------------------------------------------------- 1 | class AddFamilyToPhysicalStorages < ActiveRecord::Migration[5.2] 2 | def change 3 | add_reference :physical_storages, :physical_storage_family, :type => :bigint, :index => true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210217201401_add_capabilities_to_ext_management_system.rb: -------------------------------------------------------------------------------- 1 | class AddCapabilitiesToExtManagementSystem < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :ext_management_systems, :capabilities, :jsonb, :default => {} 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/dummy/config/cable.yml: -------------------------------------------------------------------------------- 1 | development: 2 | adapter: async 3 | 4 | test: 5 | adapter: test 6 | 7 | production: 8 | adapter: redis 9 | url: <%= ENV.fetch("REDIS_URL") { "redis://localhost:6379/1" } %> 10 | channel_prefix: dummy_production 11 | -------------------------------------------------------------------------------- /db/migrate/20191001174700_rename_chargeback_rate_detail_currency_to_currency.rb: -------------------------------------------------------------------------------- 1 | class RenameChargebackRateDetailCurrencyToCurrency < ActiveRecord::Migration[5.1] 2 | def change 3 | rename_table :chargeback_rate_detail_currencies, :currencies 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20201012120000_update_comment_to_vms_table_format.rb: -------------------------------------------------------------------------------- 1 | class UpdateCommentToVmsTableFormat < ActiveRecord::Migration[5.2] 2 | def up 3 | change_column_comment :vms, :format, "The format of the VM's disk, such as vmdk, qcow2, and tier1." 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /spec/dummy/Rakefile: -------------------------------------------------------------------------------- 1 | # Add your own tasks in files placed in lib/tasks ending in .rake, 2 | # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake. 3 | 4 | require_relative "config/application" 5 | 6 | Rails.application.load_tasks 7 | -------------------------------------------------------------------------------- /spec/dummy/app/controllers/application_controller.rb: -------------------------------------------------------------------------------- 1 | class ApplicationController < ActionController::Base 2 | # Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has. 3 | allow_browser versions: :modern 4 | end 5 | -------------------------------------------------------------------------------- /db/migrate/20180202194924_add_vlan_info_to_guest_devices.rb: -------------------------------------------------------------------------------- 1 | class AddVlanInfoToGuestDevices < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :guest_devices, :vlan_key, :string 4 | add_column :guest_devices, :vlan_enabled, :boolean 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180219151037_add_last_updated_on_to_configuration_script_source.rb: -------------------------------------------------------------------------------- 1 | class AddLastUpdatedOnToConfigurationScriptSource < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :configuration_script_sources, :last_updated_on, :timestamp 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180828092111_add_parent_physical_chassis_id_to_physical_chassis.rb: -------------------------------------------------------------------------------- 1 | class AddParentPhysicalChassisIdToPhysicalChassis < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :physical_chassis, :parent_physical_chassis_id, :bigint 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20190716210326_add_git_repository_to_configuration_script_source.rb: -------------------------------------------------------------------------------- 1 | class AddGitRepositoryToConfigurationScriptSource < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :configuration_script_sources, :git_repository_id, :bigint 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20191210135022_add_maintenance_mode_to_storages.rb: -------------------------------------------------------------------------------- 1 | class AddMaintenanceModeToStorages < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :storages, :maintenance, :boolean 4 | add_column :storages, :maintenance_reason, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/support/reserved_model_helper.rb: -------------------------------------------------------------------------------- 1 | def reserved_model(module_to_include) 2 | Class.new(ActiveRecord::Base) do 3 | def self.name 4 | "TestClass" 5 | end 6 | 7 | self.table_name = "vms" 8 | include module_to_include 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180329141018_add_last_update_error_to_configuration_script_source.rb: -------------------------------------------------------------------------------- 1 | class AddLastUpdateErrorToConfigurationScriptSource < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :configuration_script_sources, :last_update_error, :text 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210726060426_add_fields_to_host_initiators.rb: -------------------------------------------------------------------------------- 1 | class AddFieldsToHostInitiators < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :host_initiators, :status, :string 4 | add_column :host_initiators, :host_cluster_name, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180313135925_add_vm_ems_ref_to_event_streams.rb: -------------------------------------------------------------------------------- 1 | class AddVmEmsRefToEventStreams < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :event_streams, :vm_ems_ref, :string 4 | add_column :event_streams, :dest_vm_ems_ref, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20190513155251_add_price_to_service_templates.rb: -------------------------------------------------------------------------------- 1 | class AddPriceToServiceTemplates < ActiveRecord::Migration[5.0] 2 | def change 3 | add_reference :service_templates, :currency, :type => :bigint 4 | add_column :service_templates, :price, :float 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20181023171353_add_tenant_id_and_tenant_node_to_miq_product_features.rb: -------------------------------------------------------------------------------- 1 | class AddTenantIdAndTenantNodeToMiqProductFeatures < ActiveRecord::Migration[5.0] 2 | def change 3 | add_reference :miq_product_features, :tenant, :type => :bigint, :index => true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20240105173129_add_orchestration_stack_configuration_script.rb: -------------------------------------------------------------------------------- 1 | class AddOrchestrationStackConfigurationScript < ActiveRecord::Migration[6.1] 2 | def change 3 | add_reference :orchestration_stacks, :configuration_script, :type => :bigint, :index => true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20180605210436_add_title_cves_to_openscap_rule_results.rb: -------------------------------------------------------------------------------- 1 | class AddTitleCvesToOpenscapRuleResults < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :openscap_rule_results, :title, :string 4 | add_column :openscap_rule_results, :cves, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180618084757_add_zone_before_pause_id_to_ext_management_system.rb: -------------------------------------------------------------------------------- 1 | class AddZoneBeforePauseIdToExtManagementSystem < ActiveRecord::Migration[5.0] 2 | def change 3 | add_reference :ext_management_systems, :zone_before_pause, :type => :bigint, :index => true 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20210211174438_add_type_to_volume_mappings_and_host_initiators.rb: -------------------------------------------------------------------------------- 1 | class AddTypeToVolumeMappingsAndHostInitiators < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :volume_mappings, :type, :string 4 | add_column :host_initiators, :type, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/support/migration_name_helper.rb: -------------------------------------------------------------------------------- 1 | def require_migration 2 | require migration_path 3 | end 4 | 5 | def migration_path 6 | spec_name = caller_locations.detect {|loc| loc.path.end_with?("_spec.rb")}.path 7 | spec_name.sub("spec/migrations", "db/migrate").sub("_spec.rb", ".rb") 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20190517093412_create_firmware_targets.rb: -------------------------------------------------------------------------------- 1 | class CreateFirmwareTargets < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :firmware_targets do |t| 4 | t.string :manufacturer 5 | t.string :model 6 | t.timestamps 7 | end 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180705190447_add_chassis_and_switch_to_event_stream.rb: -------------------------------------------------------------------------------- 1 | class AddChassisAndSwitchToEventStream < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :event_streams, :physical_chassis_id, :bigint 4 | add_column :event_streams, :physical_switch_id, :bigint 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20220719151539_add_physical_storage_to_event_streams.rb: -------------------------------------------------------------------------------- 1 | class AddPhysicalStorageToEventStreams < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :event_streams, :physical_storage_id, :bigint 4 | add_column :event_streams, :physical_storage_name, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/dummy/.rubocop.yml: -------------------------------------------------------------------------------- 1 | # Omakase Ruby styling for Rails 2 | inherit_gem: { rubocop-rails-omakase: rubocop.yml } 3 | 4 | # Overwrite or add rules to create your own house style 5 | # 6 | # # Use `[a, [b, c]]` not `[ a, [ b, c ] ]` 7 | # Layout/SpaceInsideArrayLiteralBrackets: 8 | # Enabled: false 9 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /.bundle/ 2 | /.yardoc 3 | /Gemfile.lock 4 | /_yardoc/ 5 | /coverage/ 6 | /doc/ 7 | /pkg/ 8 | /spec/reports/ 9 | /tmp/ 10 | 11 | .rubocop-* 12 | /bundler.d/* 13 | !/bundler.d/.keep 14 | /config/settings.local.yml 15 | /config/settings/*.local.yml 16 | /config/environments/*.local.yml 17 | -------------------------------------------------------------------------------- /db/migrate/20171219162756_add_options_and_status_to_service_resource.rb: -------------------------------------------------------------------------------- 1 | class AddOptionsAndStatusToServiceResource < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :service_resources, :options, :jsonb, :default => {} 4 | add_column :service_resources, :status, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180813141056_add_cancelation_status_to_miq_request.rb: -------------------------------------------------------------------------------- 1 | class AddCancelationStatusToMiqRequest < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :miq_requests, :cancelation_status, :string 4 | add_column :miq_request_tasks, :cancelation_status, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20181003122633_add_canister_id_and_ems_ref_to_physical_disks.rb: -------------------------------------------------------------------------------- 1 | class AddCanisterIdAndEmsRefToPhysicalDisks < ActiveRecord::Migration[5.0] 2 | def change 3 | add_reference :physical_disks, :canister, :type => :bigint 4 | add_column :physical_disks, :ems_ref, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20190305181255_add_provider_services_supported_to_availability_zone.rb: -------------------------------------------------------------------------------- 1 | class AddProviderServicesSupportedToAvailabilityZone < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :availability_zones, :provider_services_supported, :string, :array => true, :default => [] 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /db/migrate/20200227195911_drop_region_migrations_ran.rb: -------------------------------------------------------------------------------- 1 | class DropRegionMigrationsRan < ActiveRecord::Migration[5.1] 2 | def up 3 | remove_column :miq_regions, :migrations_ran 4 | end 5 | 6 | def down 7 | add_column :miq_regions, :migrations_ran, :string, :array => true 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20200806112501_expand_cloud_volume.rb: -------------------------------------------------------------------------------- 1 | class ExpandCloudVolume < ActiveRecord::Migration[5.2] 2 | def change 3 | add_reference :cloud_volumes, :storage_resource, :type => :bigint, :index => true 4 | add_reference :cloud_volumes, :storage_service, :type => :bigint, :index => true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20231108172936_add_valid_to_configuration_scripts.rb: -------------------------------------------------------------------------------- 1 | class AddValidToConfigurationScripts < ActiveRecord::Migration[6.1] 2 | def change 3 | add_column :configuration_scripts, :payload_valid, :boolean, :default => true 4 | add_column :configuration_scripts, :payload_error, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/dummy/bin/rubocop: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require "rubygems" 3 | require "bundler/setup" 4 | 5 | # explicit rubocop config increases performance slightly while avoiding config confusion. 6 | ARGV.unshift("--config", File.expand_path("../.rubocop.yml", __dir__)) 7 | 8 | load Gem.bin_path("rubocop", "rubocop") 9 | -------------------------------------------------------------------------------- /db/migrate/20180209180035_add_compliance_information_to_physical_servers.rb: -------------------------------------------------------------------------------- 1 | class AddComplianceInformationToPhysicalServers < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :physical_servers, :ems_compliance_name, :string 4 | add_column :physical_servers, :ems_compliance_status, :string 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20210923144304_add_host_initiator_group_references.rb: -------------------------------------------------------------------------------- 1 | class AddHostInitiatorGroupReferences < ActiveRecord::Migration[6.0] 2 | def change 3 | add_reference :host_initiators, :host_initiator_group, :type => :bigint 4 | add_reference :volume_mappings, :host_initiator_group, :type => :bigint 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20220808064045_create_request_log.rb: -------------------------------------------------------------------------------- 1 | class CreateRequestLog < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :request_logs do |t| 4 | t.string :message 5 | t.string :severity 6 | t.references :resource, :type => :bigint 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20230609190136_create_container_indexes.rb: -------------------------------------------------------------------------------- 1 | class CreateContainerIndexes < ActiveRecord::Migration[6.1] 2 | def change 3 | add_index :containers, :container_group_id 4 | add_index :containers, :container_image_id 5 | add_index :containers, :ems_id 6 | add_index :container_images, :ems_id 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /spec/dummy/app/jobs/application_job.rb: -------------------------------------------------------------------------------- 1 | class ApplicationJob < ActiveJob::Base 2 | # Automatically retry jobs that encountered a deadlock 3 | # retry_on ActiveRecord::Deadlocked 4 | 5 | # Most jobs are safe to ignore if the underlying records are no longer available 6 | # discard_on ActiveJob::DeserializationError 7 | end 8 | -------------------------------------------------------------------------------- /spec/dummy/app/views/layouts/mailer.html.erb: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 | 8 | 9 | 10 | 11 | <%= yield %> 12 | 13 | 14 | -------------------------------------------------------------------------------- /spec/dummy/.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: bundler 4 | directory: "/" 5 | schedule: 6 | interval: daily 7 | open-pull-requests-limit: 10 8 | - package-ecosystem: github-actions 9 | directory: "/" 10 | schedule: 11 | interval: daily 12 | open-pull-requests-limit: 10 13 | -------------------------------------------------------------------------------- /db/migrate/20200103191549_remove_miq_vim_broker_worker_rows.rb: -------------------------------------------------------------------------------- 1 | class RemoveMiqVimBrokerWorkerRows < ActiveRecord::Migration[5.1] 2 | class MiqWorker < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | end 5 | 6 | def up 7 | MiqWorker.where(:type => "MiqVimBrokerWorker").delete_all 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20210330172200_add_destinations_sources_excluded_to_security_policy_rule.rb: -------------------------------------------------------------------------------- 1 | class AddDestinationsSourcesExcludedToSecurityPolicyRule < ActiveRecord::Migration[6.0] 2 | def change 3 | add_column :security_policy_rules, :sources_excluded, :boolean 4 | add_column :security_policy_rules, :destinations_excluded, :boolean 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20180201152816_remove_invalid_server_hostnames.rb: -------------------------------------------------------------------------------- 1 | class RemoveInvalidServerHostnames < ActiveRecord::Migration[5.0] 2 | class MiqServer < ActiveRecord::Base; end 3 | def up 4 | MiqServer.where.not(:hostname => nil).find_each do |server| 5 | server.update(:hostname => nil) unless server.hostname.hostname? 6 | end 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20210622184700_rename_flavors_cpus_to_match_hardware.rb: -------------------------------------------------------------------------------- 1 | class RenameFlavorsCpusToMatchHardware < ActiveRecord::Migration[6.0] 2 | def change 3 | rename_column :flavors, :cpus, :cpu_total_cores 4 | rename_column :flavors, :cpu_cores, :cpu_cores_per_socket 5 | add_column :flavors, :cpu_sockets, :integer, :default => 1 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20171130164503_add_unique_set_size_to_miq_servers_miq_workers.rb: -------------------------------------------------------------------------------- 1 | class AddUniqueSetSizeToMiqServersMiqWorkers < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :miq_servers, :unique_set_size, :decimal, :precision => 20, :scale => 0 4 | add_column :miq_workers, :unique_set_size, :decimal, :precision => 20, :scale => 0 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /db/migrate/20190613214747_add_ansible_columns_to_authentications.rb: -------------------------------------------------------------------------------- 1 | class AddAnsibleColumnsToAuthentications < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :authentications, :become_username, :string 4 | add_column :authentications, :become_password, :string 5 | add_column :authentications, :auth_key_password, :string 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20210519200613_add_miq_set_memberships.rb: -------------------------------------------------------------------------------- 1 | class AddMiqSetMemberships < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :miq_set_memberships do |t| 4 | t.belongs_to :member, :polymorphic => true, :type => :bigint 5 | t.belongs_to :miq_set, :type => :bigint 6 | 7 | t.timestamps 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20171031010000_add_schema_migrations_ran.rb: -------------------------------------------------------------------------------- 1 | class AddSchemaMigrationsRan < ActiveRecord::Migration[5.0] 2 | def up 3 | create_table :schema_migrations_ran do |t| 4 | t.string :version 5 | t.datetime :created_at, :null => false 6 | end 7 | end 8 | 9 | def down 10 | drop_table :schema_migrations_ran 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20190909195908_set_zone_visible_column_default_true.rb: -------------------------------------------------------------------------------- 1 | class SetZoneVisibleColumnDefaultTrue < ActiveRecord::Migration[5.0] 2 | class Zone < ActiveRecord::Base 3 | end 4 | 5 | def change 6 | change_column_default(:zones, :visible, :from => nil, :to => true) 7 | Zone.where(:visible => nil).update_all(:visible => true) 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20190918133037_remove_rails_server_from_settings.rb: -------------------------------------------------------------------------------- 1 | class RemoveRailsServerFromSettings < ActiveRecord::Migration[5.1] 2 | class SettingsChange < ActiveRecord::Base 3 | end 4 | 5 | def up 6 | say_with_time("Remove rails_server settings") do 7 | SettingsChange.where(:key => "/server/rails_server").delete_all 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20190514115219_create_firmware_registries.rb: -------------------------------------------------------------------------------- 1 | class CreateFirmwareRegistries < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :firmware_registries do |t| 4 | t.string :name 5 | t.datetime :last_refresh_on 6 | t.text :last_refresh_error 7 | t.string :type 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20210407183310_remove_google_network_refresh_workers.rb: -------------------------------------------------------------------------------- 1 | class RemoveGoogleNetworkRefreshWorkers < ActiveRecord::Migration[6.0] 2 | class MiqWorker < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | end 5 | 6 | def up 7 | MiqWorker.where(:type => "ManageIQ::Providers::Google::NetworkManager::RefreshWorker").delete_all 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /spec/support/migration_stubs.rb: -------------------------------------------------------------------------------- 1 | module Spec 2 | module Support 3 | module MigrationStubs 4 | def self.reserved_stub 5 | Class.new(ActiveRecord::Base) do 6 | self.table_name = "reserves" 7 | self.inheritance_column = :_type_disabled # disable STI 8 | serialize :reserved 9 | end 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/dummy/test/channels/application_cable/connection_test.rb: -------------------------------------------------------------------------------- 1 | require "test_helper" 2 | 3 | module ApplicationCable 4 | class ConnectionTest < ActionCable::Connection::TestCase 5 | # test "connects with cookies" do 6 | # cookies.signed[:user_id] = 42 7 | # 8 | # connect 9 | # 10 | # assert_equal connection.user_id, "42" 11 | # end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20171109225052_remove_string_column_limits.rb: -------------------------------------------------------------------------------- 1 | class RemoveStringColumnLimits < ActiveRecord::Migration[5.0] 2 | def up 3 | connection.tables.sort.each do |t| 4 | connection.columns(t).each do |col| 5 | next unless col.type == :string && !col.limit.nil? 6 | change_column t, col.name, :string, :limit => nil 7 | end 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20191115164358_create_miq_worker_types.rb: -------------------------------------------------------------------------------- 1 | class CreateMiqWorkerTypes < ActiveRecord::Migration[5.1] 2 | def change 3 | create_table :miq_worker_types do |t| 4 | t.string :worker_type, :null => false 5 | t.string :bundler_groups, :array => true 6 | t.integer :kill_priority 7 | 8 | t.index :worker_type, :unique => true 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200717181436_delete_workers_with_json_queue_names.rb: -------------------------------------------------------------------------------- 1 | class DeleteWorkersWithJsonQueueNames < ActiveRecord::Migration[5.2] 2 | class MiqWorker < ActiveRecord::Base 3 | include ActiveRecord::IdRegions 4 | 5 | self.inheritance_column = :_type_disabled 6 | end 7 | 8 | def up 9 | MiqWorker.in_my_region.where("queue_name LIKE ?", "\[%\]").delete_all 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /spec/migrations/20190531161732_add_guid_to_miq_databases_spec.rb: -------------------------------------------------------------------------------- 1 | require_migration 2 | 3 | describe AddGuidToMiqDatabases do 4 | let(:miq_database) { migration_stub(:MiqDatabase) } 5 | 6 | migration_context :up do 7 | it "sets miq_database guids" do 8 | db = miq_database.create! 9 | 10 | migrate 11 | 12 | expect(db.reload.guid).to be_guid 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /spec/dummy/.gitattributes: -------------------------------------------------------------------------------- 1 | # See https://git-scm.com/docs/gitattributes for more about git attribute files. 2 | 3 | # Mark the database schema as having been generated. 4 | db/schema.rb linguist-generated 5 | 6 | # Mark any vendored files as having been vendored. 7 | vendor/* linguist-vendored 8 | config/credentials/*.yml.enc diff=rails_credentials 9 | config/credentials.yml.enc diff=rails_credentials 10 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | require 'bundler/setup' 2 | 3 | begin 4 | require 'rspec/core/rake_task' 5 | 6 | APP_RAKEFILE = File.expand_path("spec/dummy/Rakefile", __dir__) 7 | load 'rails/tasks/engine.rake' 8 | load 'rails/tasks/statistics.rake' 9 | rescue LoadError 10 | end 11 | 12 | require 'bundler/gem_tasks' 13 | 14 | FileList['lib/tasks_private/**/*.rake'].each { |r| load r } 15 | 16 | task :default => :spec 17 | -------------------------------------------------------------------------------- /db/migrate/20180130165200_drop_webmks.rb: -------------------------------------------------------------------------------- 1 | class DropWebmks < ActiveRecord::Migration[5.0] 2 | class MiqServer < ActiveRecord::Base; end 3 | class SettingsChange < ActiveRecord::Base; end 4 | 5 | def up 6 | say_with_time "Remove all VMware MKS console-related records from settings" do 7 | SettingsChange.where(:key => '/server/remote_console_type', :value => 'MKS').delete_all 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20180718132840_remove_transformation_product_setting.rb: -------------------------------------------------------------------------------- 1 | class RemoveTransformationProductSetting < ActiveRecord::Migration[5.0] 2 | class SettingsChange < ActiveRecord::Base 3 | serialize :value 4 | end 5 | 6 | def up 7 | say_with_time("Removing transformation product setting (v2v)") do 8 | SettingsChange.where(:key => "/product/transformation").delete_all 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20230830134742_delete_nil_timestamp_event_streams.rb: -------------------------------------------------------------------------------- 1 | class DeleteNilTimestampEventStreams < ActiveRecord::Migration[6.1] 2 | class EventStream < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | end 5 | 6 | def up 7 | say_with_time("Deleting event_streams with nil timestamp values") do 8 | EventStream.where(:timestamp => nil).delete_all 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180116210505_create_physical_racks_and_add_to_physical_servers.rb: -------------------------------------------------------------------------------- 1 | class CreatePhysicalRacksAndAddToPhysicalServers < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :physical_racks do |t| 4 | t.bigint :ems_id 5 | t.string :uid_ems 6 | t.string :name 7 | t.timestamps 8 | end 9 | 10 | add_column :physical_servers, :physical_rack_id, :bigint 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20210817182147_remove_memcache_server_opts.rb: -------------------------------------------------------------------------------- 1 | class RemoveMemcacheServerOpts < ActiveRecord::Migration[6.0] 2 | class SettingsChange < ActiveRecord::Base 3 | include ActiveRecord::IdRegions 4 | end 5 | 6 | def up 7 | say_with_time("Remove memcache_server_opts settings") do 8 | SettingsChange.in_my_region.where(:key => "/session/memcache_server_opts").delete_all 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20210831202037_drop_database_backups_table.rb: -------------------------------------------------------------------------------- 1 | class DropDatabaseBackupsTable < ActiveRecord::Migration[6.0] 2 | def up 3 | drop_table :database_backups 4 | end 5 | 6 | def down 7 | create_table "database_backups", :force => :cascade do |t| 8 | t.string "name" 9 | t.datetime "created_at", :null => false 10 | t.datetime "updated_at", :null => false 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20171117201600_downcase_resource_group_ems_ref_for_azure.rb: -------------------------------------------------------------------------------- 1 | class DowncaseResourceGroupEmsRefForAzure < ActiveRecord::Migration[5.0] 2 | class ResourceGroup < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | end 5 | 6 | def up 7 | say_with_time("Downcase ems_ref for Azure resource groups") do 8 | ResourceGroup.update_all("ems_ref = lower(ems_ref)") 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20181010134649_add_evm_owner_to_orchestration_stacks.rb: -------------------------------------------------------------------------------- 1 | class AddEvmOwnerToOrchestrationStacks < ActiveRecord::Migration[5.0] 2 | def change 3 | add_reference :orchestration_stacks, :evm_owner, :type => :bigint, :index => true 4 | add_reference :orchestration_stacks, :miq_group, :type => :bigint, :index => true 5 | add_reference :orchestration_stacks, :tenant, :type => :bigint, :index => true 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /db/migrate/20171219161635_create_transformation_mappings.rb: -------------------------------------------------------------------------------- 1 | class CreateTransformationMappings < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :transformation_mappings do |t| 4 | t.string :name 5 | t.string :description 6 | t.string :comments 7 | t.string :state 8 | t.jsonb :options, :default => {} 9 | t.bigint :tenant_id 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20180129152935_remove_hawkular_ems.rb: -------------------------------------------------------------------------------- 1 | class RemoveHawkularEms < ActiveRecord::Migration[5.0] 2 | class ExtManagementSystem < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | end 5 | 6 | def up 7 | say_with_time("Removing Hawkular MiddlewareManagers") do 8 | ExtManagementSystem.where(:type => 'ManageIQ::Providers::Hawkular::MiddlewareManager').delete_all 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180618212608_create_cloud_volume_types.rb: -------------------------------------------------------------------------------- 1 | class CreateCloudVolumeTypes < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :cloud_volume_types do |t| 4 | t.text :description 5 | t.string :name 6 | t.string :type 7 | t.string :backend_name 8 | t.string :ems_ref 9 | t.bigint :ems_id 10 | t.boolean :public 11 | 12 | t.timestamps 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20200608163713_create_physical_storage_families.rb: -------------------------------------------------------------------------------- 1 | class CreatePhysicalStorageFamilies < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :physical_storage_families do |t| 4 | t.string :name 5 | t.string :version 6 | t.references :ems, :type => :bigint, :index => true, :references => :ext_management_system 7 | t.string :ems_ref 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20251105160057_drop_miq_schedule_file_depot_records.rb: -------------------------------------------------------------------------------- 1 | class DropMiqScheduleFileDepotRecords < ActiveRecord::Migration[7.2] 2 | class MiqSchedule < ActiveRecord::Base 3 | include ActiveRecord::IdRegions 4 | end 5 | 6 | def up 7 | say_with_time("Dropping schedules attached to file_depot records") do 8 | MiqSchedule.in_my_region.where.not(:file_depot_id => nil).delete_all 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /spec/migrations/20190304192641_add_provider_guids_spec.rb: -------------------------------------------------------------------------------- 1 | require_migration 2 | 3 | describe AddProviderGuids do 4 | let(:provider) { migration_stub(:Provider) } 5 | 6 | migration_context :up do 7 | it "sets provider guids" do 8 | obj1 = provider.create! 9 | 10 | expect(obj1.reload.guid).to eq(nil) 11 | 12 | migrate 13 | 14 | expect(obj1.reload.guid).not_to eq(nil) 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20190912152014_remove_embedded_ansible_workers.rb: -------------------------------------------------------------------------------- 1 | class RemoveEmbeddedAnsibleWorkers < ActiveRecord::Migration[5.1] 2 | class MiqWorker < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | end 5 | 6 | def up 7 | say_with_time "Remove EmbeddedAnsibleWorker records where the model was removed" do 8 | MiqWorker.where(:type => "EmbeddedAnsibleWorker").delete_all 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180323204821_remove_switch_details_from_switches.rb: -------------------------------------------------------------------------------- 1 | class RemoveSwitchDetailsFromSwitches < ActiveRecord::Migration[5.0] 2 | def change 3 | remove_column :switches, :product_name, :string 4 | remove_column :switches, :part_number, :string 5 | remove_column :switches, :serial_number, :string 6 | remove_column :switches, :description, :string 7 | remove_column :switches, :manufacturer, :string 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20180618084054_init_zones_visibility.rb: -------------------------------------------------------------------------------- 1 | class InitZonesVisibility < ActiveRecord::Migration[5.0] 2 | class Zone < ActiveRecord::Base 3 | end 4 | 5 | def up 6 | say_with_time("Updating all zones to visible") do 7 | Zone.update_all(:visible => true) 8 | end 9 | end 10 | 11 | def down 12 | say_with_time("Resetting zone visibility") do 13 | Zone.update_all(:visible => nil) 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20190327132620_dialog_field_load_values_on_init.rb: -------------------------------------------------------------------------------- 1 | class DialogFieldLoadValuesOnInit < ActiveRecord::Migration[5.0] 2 | class DialogField < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled # disable STI 4 | end 5 | 6 | def up 7 | say_with_time("Updating Dialog Fields") do 8 | DialogField.where(:show_refresh_button => [false, nil]).update_all('load_values_on_init = true') 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20180810144738_update_default_internal_attribute.rb: -------------------------------------------------------------------------------- 1 | class UpdateDefaultInternalAttribute < ActiveRecord::Migration[5.0] 2 | class ServiceTemplate < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | end 5 | 6 | def up 7 | say_with_time("Set ServiceTemplate internal") do 8 | ServiceTemplate.where.not(:type => "ServiceTemplateTransformationPlan").update_all(:internal => false) 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20210824000038_default_admin_state_up.rb: -------------------------------------------------------------------------------- 1 | class DefaultAdminStateUp < ActiveRecord::Migration[6.0] 2 | def up 3 | change_column_default :network_ports, :admin_state_up, false 4 | 5 | change_column_null :network_routers, :admin_state_up, true 6 | end 7 | 8 | def down 9 | change_column_default :network_ports, :admin_state_up, false 10 | 11 | change_column_null :network_routers, :admin_state_up, false 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/automated_review/belongs_to_required_by_default_spec.rb: -------------------------------------------------------------------------------- 1 | describe "belongs_to_required_by_default" do 2 | it "should be the default value of true", :skip => "Skipped until all migrations specs are changed to work with the default value" do 3 | # NOTE: Once all migrations are changed, we can remove this test. It is here to act as a reminder. 4 | expect(Rails.application.config.active_record.belongs_to_required_by_default).to be true 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /spec/support/migration_id_regions_helper.rb: -------------------------------------------------------------------------------- 1 | module Spec 2 | module Support 3 | module MigrationIdRegionsHelper 4 | def anonymous_class_with_id_regions 5 | ActiveRecord::IdRegions::Migration.anonymous_class_with_id_regions 6 | end 7 | 8 | def id_in_current_region(id) 9 | anonymous_class_with_id_regions.id_in_region(id, anonymous_class_with_id_regions.my_region_number) 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20210810191933_remove_update_repo_names_from_settings.rb: -------------------------------------------------------------------------------- 1 | class RemoveUpdateRepoNamesFromSettings < ActiveRecord::Migration[6.0] 2 | class SettingsChange < ActiveRecord::Base 3 | end 4 | 5 | def up 6 | say_with_time("deleting update_repo_names that are no longer used") do 7 | SettingsChange.where(:resource_type => "MiqRegion", :key => "/product/update_repo_names") 8 | .destroy_all 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /spec/dummy/bin/docker-entrypoint: -------------------------------------------------------------------------------- 1 | #!/bin/bash -e 2 | 3 | # Enable jemalloc for reduced memory usage and latency. 4 | if [ -z "${LD_PRELOAD+x}" ] && [ -f /usr/lib/*/libjemalloc.so.2 ]; then 5 | export LD_PRELOAD="$(echo /usr/lib/*/libjemalloc.so.2)" 6 | fi 7 | 8 | # If running the rails server then create or migrate existing database 9 | if [ "${1}" == "./bin/rails" ] && [ "${2}" == "server" ]; then 10 | ./bin/rails db:prepare 11 | fi 12 | 13 | exec "${@}" 14 | -------------------------------------------------------------------------------- /db/migrate/20190314110421_create_join_table_service_template_tenant.rb: -------------------------------------------------------------------------------- 1 | class CreateJoinTableServiceTemplateTenant < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :service_template_tenants do |t| 4 | t.bigint :service_template_id 5 | t.bigint :tenant_id 6 | t.index :service_template_id, :name => 'index_service_template_id' 7 | t.index :tenant_id, :name => 'index_tenant_id' 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20190514124322_create_firmware_binaries.rb: -------------------------------------------------------------------------------- 1 | class CreateFirmwareBinaries < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :firmware_binaries do |t| 4 | t.string :name 5 | t.string :external_ref 6 | t.text :description 7 | t.string :version 8 | t.string :type 9 | t.references :firmware_registry, :type => :bigint, :index => true 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20210330012001_remove_regex_from_settings.rb: -------------------------------------------------------------------------------- 1 | class RemoveRegexFromSettings < ActiveRecord::Migration[6.0] 2 | class SettingsChange < ActiveRecord::Base 3 | serialize :value 4 | end 5 | 6 | def up 7 | say_with_time("Changing regexps in configurations") do 8 | SettingsChange.where("value LIKE ?", "%!ruby/regexp%") 9 | .update_all("value = REGEXP_REPLACE(value, '!ruby/regexp ','','g')") 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20221117080009_create_physical_server_profile_templates.rb: -------------------------------------------------------------------------------- 1 | class CreatePhysicalServerProfileTemplates < ActiveRecord::Migration[6.1] 2 | def change 3 | create_table :physical_server_profile_templates do |t| 4 | t.references :ems, :type => :bigint, :index => true, :references => :ext_management_system 5 | t.string :ems_ref 6 | t.string :name 7 | t.string :type, :index => true 8 | t.timestamps 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /spec/dummy/config/database.tmpl.yml: -------------------------------------------------------------------------------- 1 | --- 2 | base: &base 3 | adapter: postgresql 4 | encoding: utf8 5 | username: root 6 | password: smartvm 7 | pool: 5 8 | wait_timeout: 5 9 | min_messages: warning 10 | 11 | development: 12 | <<: *base 13 | database: dummy_development 14 | min_messages: notice 15 | 16 | production: 17 | <<: *base 18 | database: dummy_production 19 | 20 | test: &test 21 | <<: *base 22 | pool: 3 23 | database: dummy_test 24 | -------------------------------------------------------------------------------- /db/migrate/20180917151300_add_limits_to_conversion_host.rb: -------------------------------------------------------------------------------- 1 | class AddLimitsToConversionHost < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :conversion_hosts, :concurrent_transformation_limit, :string 4 | add_column :conversion_hosts, :cpu_limit, :string 5 | add_column :conversion_hosts, :memory_limit, :string 6 | add_column :conversion_hosts, :network_limit, :string 7 | add_column :conversion_hosts, :blockio_limit, :string 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20210726194608_delete_rhn_authentications.rb: -------------------------------------------------------------------------------- 1 | class DeleteRhnAuthentications < ActiveRecord::Migration[6.0] 2 | class Authentication < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | end 5 | 6 | def up 7 | say_with_time("removing authentication records for Red Hat Network") do 8 | Authentication.where(:authtype => %w[registration registration_http_proxy]) 9 | .destroy_all 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /spec/dummy/config/credentials.yml.enc: -------------------------------------------------------------------------------- 1 | RRPGFQ9OwvddsQReKDAp8U4S8h8jCP1ARBleTgK3DVpFefkbtMTu1cmUpgtPoWj0opdc7vYQjSwcIvuGCUbu3eA4KAGfPMneqxuPkQJHvmqAoNAvy1IXqJ1GPNpWtTbQfgjHjlfjIIz1r4UKp78+5g6A27nVbO6qbuve2FQsDVTBOgFFYOByF/9sHr8sClDnTYS4l2G1I99jeawhtKQ90TSFZKAfATahz6J+KlylepjnPnmkdyxPjBUBh4LMuMzwzatAjw/ojZHACy2rFACyPtnFXc999P5bwuf5DFbWwee0xCr6eBNtFh67x1suU9NUTlaKXljWvsGOOQ/FITqwQqMY8NQ7i/cnTNeDdKzmDpzCb4/tgUtikztu8Kuh06+umBZeA238gNrVxPr+0YMarEae/pUj--8e5t1RtcFiUSdw9K--NrIYlUPiixa5lFZD4ffsDQ== -------------------------------------------------------------------------------- /db/migrate/20221116104013_add_capabilities_to_physical_storage_models.rb: -------------------------------------------------------------------------------- 1 | class AddCapabilitiesToPhysicalStorageModels < ActiveRecord::Migration[6.1] 2 | def change 3 | add_column :physical_storage_families, :capabilities, :jsonb, :default => {} 4 | add_column :physical_storages, :capabilities, :jsonb, :default => {} 5 | add_column :storage_resources, :capabilities, :jsonb, :default => {} 6 | add_column :storage_services, :capabilities, :jsonb, :default => {} 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20190604090631_create_external_urls.rb: -------------------------------------------------------------------------------- 1 | class CreateExternalUrls < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :external_urls, :id => :bigserial do |t| 4 | t.references :resource, :polymorphic => true, :type => :bigint 5 | t.string :url 6 | t.belongs_to :user, :type => :bigint 7 | end 8 | 9 | add_index "external_urls", [:resource_id, :resource_type], :name => "external_urls_on_resource_id_and_resource_type" 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20201111154314_create_host_initiators.rb: -------------------------------------------------------------------------------- 1 | class CreateHostInitiators < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :host_initiators do |t| 4 | t.string :name 5 | t.references :ems, :type => :bigint, :index => true, :references => :ext_management_system 6 | t.string :ems_ref 7 | t.string :uid_ems 8 | t.references :physical_storage, :type => :bigint, :index => true 9 | 10 | t.timestamps 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20210728143006_remove_old_ems_id_from_container_tables.rb: -------------------------------------------------------------------------------- 1 | class RemoveOldEmsIdFromContainerTables < ActiveRecord::Migration[6.0] 2 | def change 3 | remove_column :containers, :old_ems_id, :bigint 4 | remove_column :container_groups, :old_ems_id, :bigint 5 | remove_column :container_images, :old_ems_id, :bigint 6 | remove_column :container_nodes, :old_ems_id, :bigint 7 | remove_column :container_projects, :old_ems_id, :bigint 8 | end 9 | end 10 | -------------------------------------------------------------------------------- /db/migrate/20230322171110_delete_foreman_provisioning_refresh_settings.rb: -------------------------------------------------------------------------------- 1 | class DeleteForemanProvisioningRefreshSettings < ActiveRecord::Migration[6.1] 2 | class SettingsChange < ActiveRecord::Base 3 | include ActiveRecord::IdRegions 4 | end 5 | 6 | def up 7 | say_with_time("Deleting Foreman ProvisioningManager Refresh SettingsChanges") do 8 | SettingsChange.in_my_region.where("key LIKE '/ems_refresh/foreman_provisioning/%'").delete_all 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20200409175736_add_failed_login_attempts_to_users.rb: -------------------------------------------------------------------------------- 1 | class AddFailedLoginAttemptsToUsers < ActiveRecord::Migration[5.1] 2 | class User < ActiveRecord::Base; end 3 | 4 | def up 5 | add_column :users, :failed_login_attempts, :integer 6 | 7 | say_with_time 'Zeroing failed_login_attempts for all users' do 8 | User.update_all(:failed_login_attempts => 0) 9 | end 10 | end 11 | 12 | def down 13 | remove_column :users, :failed_login_attempts 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /spec/dummy/README.md: -------------------------------------------------------------------------------- 1 | # README 2 | 3 | This README would normally document whatever steps are necessary to get the 4 | application up and running. 5 | 6 | Things you may want to cover: 7 | 8 | * Ruby version 9 | 10 | * System dependencies 11 | 12 | * Configuration 13 | 14 | * Database creation 15 | 16 | * Database initialization 17 | 18 | * How to run the test suite 19 | 20 | * Services (job queues, cache servers, search engines, etc.) 21 | 22 | * Deployment instructions 23 | 24 | * ... 25 | -------------------------------------------------------------------------------- /spec/dummy/test/test_helper.rb: -------------------------------------------------------------------------------- 1 | ENV["RAILS_ENV"] ||= "test" 2 | require_relative "../config/environment" 3 | require "rails/test_help" 4 | 5 | module ActiveSupport 6 | class TestCase 7 | # Run tests in parallel with specified workers 8 | parallelize(workers: :number_of_processors) 9 | 10 | # Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order. 11 | fixtures :all 12 | 13 | # Add more helper methods to be used by all tests here... 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180817212259_add_api_version_and_domain_id_and_security_protocol_and_openstack_region_to_file_depot.rb: -------------------------------------------------------------------------------- 1 | class AddApiVersionAndDomainIdAndSecurityProtocolAndOpenstackRegionToFileDepot < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :file_depots, :keystone_api_version, :string 4 | add_column :file_depots, :v3_domain_ident, :string 5 | add_column :file_depots, :security_protocol, :string 6 | add_column :file_depots, :openstack_region, :string 7 | end 8 | end 9 | -------------------------------------------------------------------------------- /db/migrate/20200521150213_create_storage_services.rb: -------------------------------------------------------------------------------- 1 | class CreateStorageServices < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :storage_services do |t| 4 | t.string :name 5 | t.string :description 6 | t.bigint :version 7 | t.references :ems, :type => :bigint, :index => true, :references => :ext_management_system 8 | t.string :ems_ref 9 | t.string :uid_ems 10 | t.string :type 11 | 12 | t.timestamps 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20210925144400_create_wwpn_candidates.rb: -------------------------------------------------------------------------------- 1 | class CreateWwpnCandidates < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :wwpn_candidates do |t| 4 | # stores WWPN candidate 5 | t.string :candidate 6 | 7 | t.string :ems_ref 8 | t.references :ems, :type => :bigint, :index => true, :references => :ext_management_system 9 | t.references :physical_storage, :type => :bigint, :index => true 10 | 11 | t.timestamps 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /lib/manageiq/schema/command_recorder.rb: -------------------------------------------------------------------------------- 1 | module ManageIQ 2 | module Schema 3 | module CommandRecorder 4 | def add_trigger(*args) 5 | record(:add_trigger, args) 6 | end 7 | 8 | def drop_trigger(*args) 9 | record(:drop_trigger, args) 10 | end 11 | 12 | def create_view(*args) 13 | record(:create_view, args) 14 | end 15 | 16 | def drop_view(*args) 17 | record(:drop_view, args) 18 | end 19 | end 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /spec/automated_review/column_documentation_spec.rb: -------------------------------------------------------------------------------- 1 | describe "Column documentation" do 2 | # Documented tables 3 | %w[miq_tasks].each do |table_name| 4 | it "#{table_name} columns are documented" do 5 | klass = Class.new(ActiveRecord::Base) do 6 | self.table_name = table_name 7 | end 8 | 9 | klass.columns.each do |column| 10 | expect(column.comment).not_to be_nil, "#{table_name}##{column.name} is not documented." 11 | end 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20190531161732_add_guid_to_miq_databases.rb: -------------------------------------------------------------------------------- 1 | class AddGuidToMiqDatabases < ActiveRecord::Migration[5.0] 2 | class MiqDatabase < ActiveRecord::Base 3 | end 4 | 5 | def up 6 | add_column :miq_databases, :guid, :string, :limit => 36 7 | 8 | say_with_time("Create default guids for miq_databases") do 9 | MiqDatabase.all.each { |d| d.update!(:guid => SecureRandom.uuid) } 10 | end 11 | end 12 | 13 | def down 14 | remove_column :miq_databases, :guid 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20191023180149_add_ems_ref_type.rb: -------------------------------------------------------------------------------- 1 | class AddEmsRefType < ActiveRecord::Migration[5.1] 2 | def change 3 | add_column :ems_clusters, :ems_ref_type, :string 4 | add_column :ems_folders, :ems_ref_type, :string 5 | add_column :hosts, :ems_ref_type, :string 6 | add_column :resource_pools, :ems_ref_type, :string 7 | add_column :snapshots, :ems_ref_type, :string 8 | add_column :storages, :ems_ref_type, :string 9 | add_column :vms, :ems_ref_type, :string 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /lib/manageiq/schema/migrate_with_cleared_schema_cache.rb: -------------------------------------------------------------------------------- 1 | module ManageIQ 2 | module Schema 3 | module MigrateWithClearedSchemaCache 4 | def migrate(*args) 5 | clearing_caches do 6 | super 7 | end 8 | end 9 | 10 | private 11 | 12 | def clear_caches 13 | ActiveRecord::Base.connection.schema_cache.clear! 14 | end 15 | 16 | def clearing_caches 17 | clear_caches 18 | yield 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /spec/migrations/20200519213913_change_hardware_mem_types_spec.rb: -------------------------------------------------------------------------------- 1 | require_migration 2 | 3 | describe ChangeHardwareMemTypes do 4 | migration_context :down do 5 | let(:hardware) { migration_stub(:Hardware).create(:memory_mb => 2_147_483_648) } 6 | 7 | it "caps > 2147483647" do 8 | expect(hardware.memory_mb).to eq(2_147_483_648) 9 | 10 | migrate 11 | hardware.reload 12 | 13 | expect(hardware).to have_attributes(:memory_mb => 2_147_483_647) 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20180719162710_add_owner_and_group_to_auth.rb: -------------------------------------------------------------------------------- 1 | class AddOwnerAndGroupToAuth < ActiveRecord::Migration[5.0] 2 | def up 3 | add_column :authentications, :evm_owner_id, :bigint 4 | add_column :authentications, :miq_group_id, :bigint 5 | add_column :authentications, :tenant_id, :bigint 6 | end 7 | 8 | def down 9 | remove_column :authentications, :evm_owner_id 10 | remove_column :authentications, :miq_group_id 11 | remove_column :authentications, :tenant_id 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20200519213913_change_hardware_mem_types.rb: -------------------------------------------------------------------------------- 1 | class ChangeHardwareMemTypes < ActiveRecord::Migration[5.2] 2 | class Hardware < ActiveRecord::Base 3 | end 4 | 5 | def up 6 | change_column :hardwares, :memory_mb, :bigint 7 | end 8 | 9 | def down 10 | say_with_time "clamp oversized memory_mb values" do 11 | Hardware.where("memory_mb > 2147483647").update_all(:memory_mb => 2_147_483_647) 12 | end 13 | 14 | change_column :hardwares, :memory_mb, :integer 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/migrations/20190712135032_set_provisioned_state_to_services_spec.rb: -------------------------------------------------------------------------------- 1 | require_migration 2 | 3 | describe SetProvisionedStateToServices do 4 | let(:service) { migration_stub(:Service) } 5 | 6 | migration_context :up do 7 | it "sets lifecycle state" do 8 | obj1 = service.create!(:lifecycle_state => nil) 9 | 10 | expect(obj1.reload.lifecycle_state).to eq(nil) 11 | 12 | migrate 13 | 14 | expect(obj1.reload.lifecycle_state).to eq('provisioned') 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20180807152553_drop_vim_performance_tag_values.rb: -------------------------------------------------------------------------------- 1 | class DropVimPerformanceTagValues < ActiveRecord::Migration[5.0] 2 | def change 3 | drop_table :vim_performance_tag_values do |t| 4 | t.string :association_type 5 | t.string :category 6 | t.string :tag_name 7 | t.string :column_name 8 | t.float :value 9 | t.text :assoc_ids 10 | t.bigint :metric_id 11 | t.string :metric_type 12 | t.index [:metric_id, :metric_type] 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20171213223553_move_ems_refresh_openstack_settings.rb: -------------------------------------------------------------------------------- 1 | class MoveEmsRefreshOpenstackSettings < ActiveRecord::Migration[5.0] 2 | class SettingsChange < ActiveRecord::Base 3 | end 4 | 5 | def up 6 | say_with_time('Move ems_refresh Openstack provider refresher settings under the root') do 7 | SettingsChange.where('key LIKE ?', '/ems/ems_refresh/openstack%').each do |s| 8 | s.key = s.key.sub('/ems/ems_refresh', '/ems_refresh') 9 | s.save! 10 | end 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20190712135032_set_provisioned_state_to_services.rb: -------------------------------------------------------------------------------- 1 | class SetProvisionedStateToServices < ActiveRecord::Migration[5.1] 2 | class Service < ActiveRecord::Base 3 | include ActiveRecord::IdRegions 4 | self.inheritance_column = :_type_disabled # disable STI 5 | end 6 | 7 | def up 8 | say_with_time("Update service lifecycle state values") do 9 | Service.in_my_region.where(:lifecycle_state => nil, :retired => nil).update_all(:lifecycle_state => 'provisioned') 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20191113200451_remove_ems_ref_obj.rb: -------------------------------------------------------------------------------- 1 | class RemoveEmsRefObj < ActiveRecord::Migration[5.1] 2 | def change 3 | remove_column :ems_clusters, :ems_ref_obj, :string 4 | remove_column :ems_folders, :ems_ref_obj, :string 5 | remove_column :hosts, :ems_ref_obj, :string 6 | remove_column :resource_pools, :ems_ref_obj, :string 7 | remove_column :snapshots, :ems_ref_obj, :string 8 | remove_column :storages, :ems_ref_obj, :string 9 | remove_column :vms, :ems_ref_obj, :string 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20230407170430_add_payload_credentials_configuration_scripts.rb: -------------------------------------------------------------------------------- 1 | class AddPayloadCredentialsConfigurationScripts < ActiveRecord::Migration[6.1] 2 | def change 3 | change_table :configuration_scripts do |t| 4 | t.string :run_by_userid 5 | t.string :payload 6 | t.string :payload_type 7 | t.jsonb :credentials 8 | t.jsonb :context 9 | t.jsonb :output 10 | t.string :status 11 | t.references :miq_task 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20181119154009_set_vm_connection_state.rb: -------------------------------------------------------------------------------- 1 | class SetVmConnectionState < ActiveRecord::Migration[4.2] 2 | class VmOrTemplate < ActiveRecord::Base 3 | include ActiveRecord::IdRegions 4 | 5 | self.inheritance_column = :_type_disabled 6 | self.table_name = 'vms' 7 | end 8 | 9 | def up 10 | say_with_time('Filling nil connection_state to "connected"') do 11 | VmOrTemplate.in_my_region.where(:connection_state => nil).update_all(:connection_state => 'connected') 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20190528161746_add_ems_extensions.rb: -------------------------------------------------------------------------------- 1 | class AddEmsExtensions < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :ems_extensions, :id => :bigserial, :force => :cascade do |t| 4 | t.references :ems, :type => :bigint, :index => true, :references => :ext_management_system 5 | 6 | t.string :ems_ref 7 | t.string :key 8 | t.string :company 9 | t.string :label 10 | t.string :summary 11 | t.string :version 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/dummy/app/views/pwa/manifest.json.erb: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Dummy", 3 | "icons": [ 4 | { 5 | "src": "/icon.png", 6 | "type": "image/png", 7 | "sizes": "512x512" 8 | }, 9 | { 10 | "src": "/icon.png", 11 | "type": "image/png", 12 | "sizes": "512x512", 13 | "purpose": "maskable" 14 | } 15 | ], 16 | "start_url": "/", 17 | "display": "standalone", 18 | "scope": "/", 19 | "description": "Dummy.", 20 | "theme_color": "red", 21 | "background_color": "red" 22 | } 23 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/filter_parameter_logging.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Configure parameters to be partially matched (e.g. passw matches password) and filtered from the log file. 4 | # Use this to limit dissemination of sensitive information. 5 | # See the ActiveSupport::ParameterFilter documentation for supported notations and behaviors. 6 | Rails.application.config.filter_parameters += [ 7 | :passw, :email, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn 8 | ] 9 | -------------------------------------------------------------------------------- /db/migrate/20180118131417_change_container_quota_items_to_decimals.rb: -------------------------------------------------------------------------------- 1 | class ChangeContainerQuotaItemsToDecimals < ActiveRecord::Migration[5.0] 2 | def up 3 | %i(quota_desired quota_enforced quota_observed).each do |column| 4 | change_column :container_quota_items, column, :decimal, :scale => 3, :precision => 30 5 | end 6 | end 7 | 8 | def down 9 | %i(quota_desired quota_enforced quota_observed).each do |column| 10 | change_column :container_quota_items, column, :float 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20190517093516_create_firmware_binary_firmware_targets.rb: -------------------------------------------------------------------------------- 1 | class CreateFirmwareBinaryFirmwareTargets < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :firmware_binaries_firmware_targets do |t| 4 | t.references :firmware_binary, :type => :bigint, :index => false 5 | t.references :firmware_target, :type => :bigint, :index => false 6 | 7 | t.index %i[firmware_binary_id firmware_target_id], :unique => true, :name => :index_firmware_binaries_firmware_targets 8 | end 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20210810114405_create_host_initiator_groups.rb: -------------------------------------------------------------------------------- 1 | class CreateHostInitiatorGroups < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :host_initiator_groups do |t| 4 | t.references :ems, :type => :bigint, :index => true, :references => :ext_management_system 5 | t.references :physical_storage, :type => :bigint, :index => true 6 | 7 | t.string :name 8 | t.string :status 9 | t.string :ems_ref 10 | t.string :uid_ems 11 | 12 | t.timestamps 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20190228210310_service_templates_should_have_names.rb: -------------------------------------------------------------------------------- 1 | class ServiceTemplatesShouldHaveNames < ActiveRecord::Migration[5.0] 2 | class ServiceTemplate < ActiveRecord::Base 3 | include ActiveRecord::IdRegions 4 | self.inheritance_column = :_type_disabled # disable STI 5 | end 6 | 7 | def up 8 | say_with_time("Checking service templates for names") do 9 | ServiceTemplate.in_my_region.where(:name => [nil, ""]).each { |t| t.update!(:name => "ServiceTemplate" + SecureRandom.uuid) } 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /db/migrate/20240214165402_remove_openstack_network_manager_metrics_collector_workers.rb: -------------------------------------------------------------------------------- 1 | class RemoveOpenstackNetworkManagerMetricsCollectorWorkers < ActiveRecord::Migration[6.1] 2 | class MiqWorker < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | end 5 | 6 | def up 7 | say_with_time("Deleting all Openstack NetworkManager MetricsCollectorWorker records") do 8 | MiqWorker.where(:type => "ManageIQ::Providers::Openstack::NetworkManager::MetricsCollectorWorker").delete_all 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /spec/dummy/db/seeds.rb: -------------------------------------------------------------------------------- 1 | # This file should ensure the existence of records required to run the application in every environment (production, 2 | # development, test). The code here should be idempotent so that it can be executed at any point in every environment. 3 | # The data can then be loaded with the bin/rails db:seed command (or created alongside the database with db:setup). 4 | # 5 | # Example: 6 | # 7 | # ["Action", "Comedy", "Drama", "Horror"].each do |genre_name| 8 | # MovieGenre.find_or_create_by!(name: genre_name) 9 | # end 10 | -------------------------------------------------------------------------------- /db/migrate/20190304192641_add_provider_guids.rb: -------------------------------------------------------------------------------- 1 | class AddProviderGuids < ActiveRecord::Migration[5.0] 2 | class Provider < ActiveRecord::Base 3 | include ActiveRecord::IdRegions 4 | validates :guid, :uniqueness => true 5 | self.inheritance_column = :_type_disabled # disable STI 6 | end 7 | 8 | def up 9 | say_with_time("Update provider guid values") do 10 | Provider.in_my_region.where(:guid => nil).each do |provider| 11 | provider.update!(:guid => SecureRandom.uuid) 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20190301174502_remove_rss_feeds.rb: -------------------------------------------------------------------------------- 1 | class RemoveRssFeeds < ActiveRecord::Migration[5.0] 2 | def up 3 | drop_table :rss_feeds 4 | end 5 | 6 | def down 7 | create_table "rss_feeds" do |t| 8 | t.string "name" 9 | t.text "title" 10 | t.text "link" 11 | t.text "description" 12 | t.datetime "created_on" 13 | t.datetime "updated_on" 14 | t.datetime "yml_file_mtime" 15 | end 16 | 17 | add_index "rss_feeds", ["name"], :name => "index_rss_feeds_on_name" 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /db/migrate/20190528160313_add_ems_licenses.rb: -------------------------------------------------------------------------------- 1 | class AddEmsLicenses < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :ems_licenses, :id => :bigserial, :force => :cascade do |t| 4 | t.references :ems, :type => :bigint, :index => true, :references => :ext_management_system 5 | 6 | t.string :ems_ref 7 | t.string :name 8 | t.string :license_key 9 | t.string :license_edition 10 | t.integer :total_licenses 11 | t.integer :used_licenses 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/migrations/20200409175736_add_failed_login_attempts_to_users_spec.rb: -------------------------------------------------------------------------------- 1 | require_migration 2 | 3 | describe AddFailedLoginAttemptsToUsers do 4 | let(:user_stub) { migration_stub(:User) } 5 | let(:user) { user_stub.create(:name => 'test', :userid => 'test') } 6 | 7 | migration_context :up do 8 | it 'creates a new field which defaults to 0' do 9 | expect(user).to_not respond_to(:failed_login_attempts) 10 | 11 | migrate 12 | user.reload 13 | 14 | expect(user.failed_login_attempts).to eq(0) 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20180726142030_create_physical_disk.rb: -------------------------------------------------------------------------------- 1 | class CreatePhysicalDisk < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :physical_disks do |t| 4 | t.string :model 5 | t.string :vendor 6 | t.string :status 7 | t.string :location 8 | t.index :location 9 | t.string :serial_number 10 | t.string :health_state 11 | t.string :type 12 | t.string :disk_size 13 | t.bigint :physical_storage_id 14 | t.index :physical_storage_id 15 | t.timestamps 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /db/migrate/20181203224640_remove_renamed_ansible_tower_configuration_manager_refresh_worker_rows.rb: -------------------------------------------------------------------------------- 1 | class RemoveRenamedAnsibleTowerConfigurationManagerRefreshWorkerRows < ActiveRecord::Migration[5.0] 2 | class MiqWorker < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | end 5 | 6 | def up 7 | # Was renamed to ManageIQ::Providers::AnsibleTower::AutomationManager::RefreshWorker in 2f0ef1a90758f2 8 | MiqWorker.where(:type => "ManageIQ::Providers::AnsibleTower::ConfigurationManager::RefreshWorker").delete_all 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /spec/automated_review/empty_database_spec.rb: -------------------------------------------------------------------------------- 1 | describe "Empty Database" do 2 | it "after migrated remains empty" do 3 | counts = ActiveRecord::Base.connection.tables.each_with_object([]) do |t, array| 4 | next if ManageIQ::Schema::SYSTEM_TABLES.include?(t) 5 | count = ActiveRecord::Base.connection.execute("SELECT COUNT(*) FROM #{t};").getvalue(0, 0) 6 | array << "#{t}: #{count}" if count.positive? 7 | end 8 | 9 | expect(counts.size).to eq(0), "Records were found in the following tables:\n#{counts.join("\n")}" 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /spec/migrations/20200103191549_remove_miq_vim_broker_worker_rows_spec.rb: -------------------------------------------------------------------------------- 1 | require_migration 2 | 3 | describe RemoveMiqVimBrokerWorkerRows do 4 | migration_context :up do 5 | let(:miq_worker) { migration_stub(:MiqWorker) } 6 | 7 | it "deletes MiqVimBrokerWorker workers" do 8 | miq_worker.create!(:type => "MiqWorker") 9 | miq_worker.create!(:type => "MiqVimBrokerWorker") 10 | 11 | migrate 12 | 13 | expect(miq_worker.count).to eq(1) 14 | expect(miq_worker.first.type).to eq("MiqWorker") 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20171219151634_create_transformation_mapping_items.rb: -------------------------------------------------------------------------------- 1 | class CreateTransformationMappingItems < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :transformation_mapping_items do |t| 4 | t.bigint :source_id 5 | t.string :source_type 6 | t.bigint :destination_id 7 | t.string :destination_type 8 | t.bigint :transformation_mapping_id 9 | t.jsonb :options, :default => {} 10 | t.timestamps 11 | end 12 | 13 | add_index :transformation_mapping_items, :transformation_mapping_id 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20201220133400_create_volume_mappings.rb: -------------------------------------------------------------------------------- 1 | class CreateVolumeMappings < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :volume_mappings do |t| 4 | t.references :ems, :type => :bigint, :index => true, :references => :ext_management_system 5 | t.references :cloud_volume, :type => :bigint, :index => true 6 | t.references :host_initiator, :type => :bigint, :index => true 7 | 8 | t.string :ems_ref 9 | t.string :uid_ems 10 | 11 | t.integer :lun 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20210118185402_subclass_cinder_manager_openstack.rb: -------------------------------------------------------------------------------- 1 | class SubclassCinderManagerOpenstack < ActiveRecord::Migration[6.0] 2 | class ExtManagementSystem < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | end 5 | 6 | def up 7 | say_with_time("Subclass CinderManager under Openstack") do 8 | ExtManagementSystem.where(:type => "ManageIQ::Providers::StorageManager::CinderManager") 9 | .update_all(:type => "ManageIQ::Providers::Openstack::StorageManager::CinderManager") 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /lib/migration_stub_helper.rb: -------------------------------------------------------------------------------- 1 | # NOTE: If included, this must be included AFTER any autoloaded modules since it 2 | # modifies included.name. Rails autoload will not be able to detect 3 | # the other modules if included before them. 4 | # 5 | 6 | module MigrationStubHelper 7 | extend ActiveSupport::Concern 8 | included do 9 | # Fixes issues where reflections in stubs will use the class name in the 10 | # query, which is unexpectedly namespaced. 11 | def self.name 12 | super.split("::")[1..-1].join("::") 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20190108163812_remove_cinder_manager_event_worker_rows.rb: -------------------------------------------------------------------------------- 1 | class RemoveCinderManagerEventWorkerRows < ActiveRecord::Migration[5.0] 2 | class MiqWorker < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | end 5 | 6 | def up 7 | # ManageIQ::Providers::StorageManager::CinderManager::EventCatcher was removed in 772bdc283360e99f9cf2209184297d1827f3a9e6 8 | # https://github.com/ManageIQ/manageiq/pull/14962 9 | MiqWorker.where(:type => "ManageIQ::Providers::StorageManager::CinderManager::EventCatcher").delete_all 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /db/migrate/20230919143746_remove_vim_strings_from_miq_queue.rb: -------------------------------------------------------------------------------- 1 | class RemoveVimStringsFromMiqQueue < ActiveRecord::Migration[6.1] 2 | disable_ddl_transaction! 3 | include MigrationHelper 4 | 5 | class MiqQueue < ActiveRecord::Base 6 | end 7 | 8 | def up 9 | regex_replace_column_value(MiqQueue, 'args', '!ruby/string:VimString', '!ruby/string:String') 10 | regex_replace_column_value(MiqQueue, 'args', '!ruby/hash-with-ivars:VimHash', '!ruby/hash-with-ivars:Hash') 11 | end 12 | 13 | # this is very old, not rolling back 14 | def down 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/dummy/config/initializers/permissions_policy.rb: -------------------------------------------------------------------------------- 1 | # Be sure to restart your server when you modify this file. 2 | 3 | # Define an application-wide HTTP permissions policy. For further 4 | # information see: https://developers.google.com/web/updates/2018/06/feature-policy 5 | 6 | # Rails.application.config.permissions_policy do |policy| 7 | # policy.camera :none 8 | # policy.gyroscope :none 9 | # policy.microphone :none 10 | # policy.usb :none 11 | # policy.fullscreen :self 12 | # policy.payment :self, "https://secure.example.com" 13 | # end 14 | -------------------------------------------------------------------------------- /db/migrate/20200122215829_upgrade_dropbox_to_support_tool.rb: -------------------------------------------------------------------------------- 1 | class UpgradeDropboxToSupportTool < ActiveRecord::Migration[5.1] 2 | class FileDepot < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled # disable STI 4 | end 5 | 6 | def change 7 | # update_all is used here to avoid instantiating a possibly undefined class 8 | FileDepot.where(:type => "FileDepotFtpAnonymousRedhatDropbox").update_all( 9 | :type => "FileDepotRedhatSupport", 10 | :name => "Red Hat Support", 11 | :uri => "support://redhat.com" 12 | ) 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20180319113755_add_product_details_columns_to_asset_details.rb: -------------------------------------------------------------------------------- 1 | class AddProductDetailsColumnsToAssetDetails < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :asset_details, :product_name, :string 4 | add_column :asset_details, :manufacturer, :string 5 | add_column :asset_details, :machine_type, :string 6 | add_column :asset_details, :model, :string 7 | add_column :asset_details, :serial_number, :string 8 | add_column :asset_details, :field_replaceable_unit, :string 9 | end 10 | end 11 | -------------------------------------------------------------------------------- /db/migrate/20181002192054_fix_conversion_host_resource_type.rb: -------------------------------------------------------------------------------- 1 | class FixConversionHostResourceType < ActiveRecord::Migration[5.0] 2 | class ConversionHost < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | include ActiveRecord::IdRegions 5 | end 6 | 7 | def up 8 | say_with_time("Converting invalid resource_type to Host") do 9 | ConversionHost.in_my_region 10 | .where(:resource_type => "AddConversionHostIdToMiqRequestTasks::Host") 11 | .update_all(:resource_type => "Host") 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /db/migrate/20200519141015_create_storage_resources.rb: -------------------------------------------------------------------------------- 1 | class CreateStorageResources < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :storage_resources do |t| 4 | t.string :name 5 | t.references :ems, :type => :bigint, :index => true, :references => :ext_management_system 6 | t.string :ems_ref 7 | t.string :uid_ems 8 | t.bigint :logical_free 9 | t.bigint :logical_total 10 | t.references :physical_storage, :type => :bigint, :index => true 11 | t.string :type 12 | 13 | t.timestamps 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20201124063738_create_san_addresses.rb: -------------------------------------------------------------------------------- 1 | class CreateSanAddresses < ActiveRecord::Migration[5.2] 2 | def change 3 | create_table :san_addresses do |t| 4 | t.references :ems, :type => :bigint, :index => true, :references => :ext_management_system 5 | t.string :ems_ref 6 | t.belongs_to :owner, :polymorphic => true, :type => :bigint 7 | t.string :iqn 8 | t.string :chap_name 9 | t.string :chap_secret 10 | t.string :wwpn 11 | t.string :wwnn 12 | t.string :type 13 | 14 | t.timestamps 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/migrations/20180112171348_drop_unnecessary_blob_parts_md5_spec.rb: -------------------------------------------------------------------------------- 1 | require_migration 2 | 3 | describe DropUnnecessaryBlobPartsMd5 do 4 | let(:binary_blob_part_stub) { migration_stub :BinaryBlobPart } 5 | 6 | migration_context :down do 7 | it "restores the md5 sum and size of all records" do 8 | binary_blob_part_stub.create!(:data => "A test string") 9 | 10 | migrate 11 | 12 | expect(binary_blob_part_stub.first).to have_attributes( 13 | :md5 => "99ce4dbdc6db1ab876443113ae24b816", 14 | :size => 13, 15 | ) 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /db/migrate/20191002103406_remove_quadicon_settings.rb: -------------------------------------------------------------------------------- 1 | class RemoveQuadiconSettings < ActiveRecord::Migration[5.0] 2 | class User < ActiveRecord::Base 3 | serialize :settings, :type => Hash 4 | end 5 | 6 | def up 7 | say_with_time("Dropping quadicon settings keys from user settings") do 8 | User.where("settings like '%quadicons%'").each do |user| 9 | settings = user.settings 10 | 11 | next unless settings[:quadicons] 12 | 13 | settings.delete(:quadicons) 14 | user.update!(:settings => settings) 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /db/migrate/20221107195559_drop_iso_datastore.rb: -------------------------------------------------------------------------------- 1 | class DropIsoDatastore < ActiveRecord::Migration[6.1] 2 | def up 3 | say_with_time("Drop IsoDatastore table") do 4 | remove_reference :iso_images, :iso_datastore 5 | drop_table :iso_datastores 6 | end 7 | end 8 | 9 | def down 10 | say_with_time("Create IsoDatastore table") do 11 | create_table :iso_datastores, :force => :cascade do |t| 12 | t.bigint :ems_id 13 | t.datetime :last_refresh_on 14 | end 15 | 16 | add_reference :iso_images, :iso_datastore 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /spec/support/database_helper.rb: -------------------------------------------------------------------------------- 1 | module DatabaseHelper 2 | def self.columns_for_table(table_name) 3 | ActiveRecord::Base.connection.data_source_exists?(table_name) ? ActiveRecord::Base.connection.columns(table_name).sort_by(&:name) : [] 4 | end 5 | 6 | def self.indexes_for_table(table_name) 7 | ActiveRecord::Base.connection.data_source_exists?(table_name) ? ActiveRecord::Base.connection.indexes(table_name).sort_by(&:name) : [] 8 | end 9 | 10 | def self.table_has_type_column?(table_name) 11 | columns_for_table(table_name).detect { |i| i.name == "type" } 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20220909190221_drop_cockpit_role.rb: -------------------------------------------------------------------------------- 1 | class DropCockpitRole < ActiveRecord::Migration[6.0] 2 | class SettingsChange < ActiveRecord::Base; end 3 | 4 | def up 5 | say_with_time("Deleting cockpit role configuration") do 6 | SettingsChange.where("key = '/server/role' AND value LIKE '%ws_cockpit%'").select('id', 'value').each do |row| 7 | if row.value == 'ws_cockpit' 8 | row.delete 9 | else 10 | row.update(:value => row.value.split(',').tap { |a| a.delete("ws_cockpit") }.join(',')) 11 | end 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /db/migrate/20180426163655_create_physical_storage.rb: -------------------------------------------------------------------------------- 1 | class CreatePhysicalStorage < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :physical_storages do |t| 4 | t.string :ems_ref 5 | t.string :uid_ems 6 | t.string :name 7 | t.string :type 8 | t.string :access_state 9 | t.string :health_state 10 | t.string :overall_health_state 11 | t.bigint :ems_id 12 | t.bigint :physical_rack_id 13 | t.integer :drive_bays 14 | t.integer :enclosures 15 | t.integer :canister_slots 16 | t.timestamps 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /db/migrate/20191017211747_add_general_indexes.rb: -------------------------------------------------------------------------------- 1 | class AddGeneralIndexes < ActiveRecord::Migration[5.1] 2 | def change 3 | add_index :miq_schedules, :updated_at 4 | add_index :blacklisted_events, [:ems_id, :enabled] 5 | add_index :key_pairs_vms, :vm_id 6 | add_index :miq_requests, [:tenant_id, :approval_state] 7 | add_index :miq_roles_features, :miq_user_role_id 8 | add_index :miq_queue, [:state, :handler_type, :handler_id] 9 | add_index :vms, :tenant_id 10 | add_index :entitlements, :miq_group_id 11 | add_index :endpoints, [:resource_id, :resource_type] 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /db/migrate/20200427122455_remove_vim_strings_from_notifications.rb: -------------------------------------------------------------------------------- 1 | class RemoveVimStringsFromNotifications < ActiveRecord::Migration[5.1] 2 | disable_ddl_transaction! 3 | include MigrationHelper 4 | 5 | class Notification < ActiveRecord::Base 6 | include ActiveRecord::IdRegions 7 | end 8 | 9 | def up 10 | regex_replace_column_value(Notification.in_my_region, 'options', '!ruby/string:VimString', '!ruby/string:String') 11 | end 12 | 13 | def down 14 | regex_replace_column_value(Notification.in_my_region, 'options', '!ruby/string:String', '!ruby/string:VimString') 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /spec/migrations/20190912152014_remove_embedded_ansible_workers_spec.rb: -------------------------------------------------------------------------------- 1 | require_migration 2 | 3 | describe RemoveEmbeddedAnsibleWorkers do 4 | migration_context :up do 5 | let(:worker_stub) { migration_stub(:MiqWorker) } 6 | 7 | it "Removes rows where the model was deleted" do 8 | worker_stub.create!(:type => "EmbeddedAnsibleWorker") 9 | not_orphaned = worker_stub.create! 10 | 11 | expect(worker_stub.count).to eql 2 12 | 13 | migrate 14 | 15 | expect(worker_stub.first).to eql not_orphaned 16 | expect(worker_stub.count).to eql 1 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /db/migrate/20171117201519_update_resource_group_type_for_azure.rb: -------------------------------------------------------------------------------- 1 | class UpdateResourceGroupTypeForAzure < ActiveRecord::Migration[5.0] 2 | class ResourceGroup < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | end 5 | 6 | def up 7 | say_with_time("Update Azure resource group type") do 8 | ResourceGroup.update_all(:type => 'ManageIQ::Providers::Azure::ResourceGroup') 9 | end 10 | end 11 | 12 | def down 13 | say_with_time("Set Azure resource group type to base value") do 14 | ResourceGroup.update_all(:type => 'ResourceGroup') 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20180807153714_add_conversion_host_table.rb: -------------------------------------------------------------------------------- 1 | class AddConversionHostTable < ActiveRecord::Migration[5.0] 2 | def change 3 | create_table :conversion_hosts do |t| 4 | t.string :name 5 | t.string :address 6 | t.string :type 7 | t.references :resource, :type => :bigint, :polymorphic => true 8 | t.string :version 9 | t.integer :max_concurrent_tasks 10 | t.boolean :vddk_transport_supported 11 | t.boolean :ssh_transport_supported 12 | t.timestamps 13 | t.index %w(resource_id resource_type) 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20230220204405_delete_ovirt_rhv_network_event_catcher_workers.rb: -------------------------------------------------------------------------------- 1 | class DeleteOvirtRhvNetworkEventCatcherWorkers < ActiveRecord::Migration[6.1] 2 | class MiqWorker < ActiveRecord::Base 3 | self.inheritance_column = :_type_disabled 4 | end 5 | 6 | def up 7 | say_with_time("Deleting Ovirt/RHV Network Event Catcher Workers") do 8 | MiqWorker.where( 9 | :type => %w[ 10 | ManageIQ::Providers::Ovirt::NetworkManager::EventCatcher 11 | ManageIQ::Providers::Redhat::NetworkManager::EventCatcher 12 | ] 13 | ).delete_all 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /db/migrate/20180126144529_add_extra_information_to_switches.rb: -------------------------------------------------------------------------------- 1 | class AddExtraInformationToSwitches < ActiveRecord::Migration[5.0] 2 | def change 3 | add_column :switches, :ems_id, :bigint 4 | add_column :switches, :type, :string 5 | add_column :switches, :health_state, :string 6 | add_column :switches, :power_state, :string 7 | add_column :switches, :product_name, :string 8 | add_column :switches, :part_number, :string 9 | add_column :switches, :serial_number, :string 10 | add_column :switches, :description, :string 11 | add_column :switches, :manufacturer, :string 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /spec/support/constant_watcher.rb: -------------------------------------------------------------------------------- 1 | module Spec 2 | module Support 3 | module ConstantWatcher 4 | mattr_accessor :classes_by_file 5 | 6 | def inherited(other) 7 | Spec::Support::ConstantWatcher.add(other) 8 | super 9 | end 10 | 11 | def self.add(const) 12 | path = caller_locations(2..2).first.path 13 | self.classes_by_file ||= {} 14 | self.classes_by_file[path] ||= [] 15 | self.classes_by_file[path] << const.name 16 | end 17 | end 18 | end 19 | end 20 | 21 | ActiveRecord::Base.singleton_class.prepend(Spec::Support::ConstantWatcher) 22 | -------------------------------------------------------------------------------- /spec/migrations/20190108163812_remove_cinder_manager_event_worker_rows_spec.rb: -------------------------------------------------------------------------------- 1 | require_migration 2 | 3 | describe RemoveCinderManagerEventWorkerRows do 4 | migration_context :up do 5 | let(:miq_worker) { migration_stub(:MiqWorker) } 6 | 7 | it "deletes Openstack Cinder event workers" do 8 | miq_worker.create!(:type => "MiqWorker") 9 | miq_worker.create!(:type => "ManageIQ::Providers::StorageManager::CinderManager::EventCatcher") 10 | 11 | migrate 12 | 13 | expect(miq_worker.count).to eq(1) 14 | expect(miq_worker.first.type).to eq("MiqWorker") 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /spec/migrations/20210407183310_remove_google_network_refresh_workers_spec.rb: -------------------------------------------------------------------------------- 1 | require_migration 2 | 3 | describe RemoveGoogleNetworkRefreshWorkers do 4 | migration_context :up do 5 | let(:miq_worker) { migration_stub(:MiqWorker) } 6 | 7 | it "deletes Google NetworkManager RefreshWorker workers" do 8 | miq_worker.create!(:type => "MiqWorker") 9 | miq_worker.create!(:type => "ManageIQ::Providers::Google::NetworkManager::RefreshWorker") 10 | 11 | migrate 12 | 13 | expect(miq_worker.count).to eq(1) 14 | expect(miq_worker.first.type).to eq("MiqWorker") 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /db/migrate/20220407210610_placement_group_additions.rb: -------------------------------------------------------------------------------- 1 | class PlacementGroupAdditions < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :placement_groups do |t| 4 | t.string :name 5 | t.string :policy 6 | t.string :ems_ref 7 | t.string :type, :index => true 8 | 9 | t.references :availability_zone, :type => :bigint 10 | t.references :cloud_tenant, :type => :bigint 11 | t.references :ems, :type => :bigint 12 | 13 | t.timestamps 14 | end 15 | 16 | add_reference :vms, :placement_group, :type => :bigint 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /db/migrate/20220707150906_create_cloud_database_server.rb: -------------------------------------------------------------------------------- 1 | class CreateCloudDatabaseServer < ActiveRecord::Migration[6.0] 2 | def change 3 | create_table :cloud_database_servers do |t| 4 | t.string :name 5 | t.string :type, :index => true 6 | t.string :ems_ref 7 | t.string :server_type 8 | t.string :status 9 | t.string :version 10 | t.bigint :resource_group_id 11 | t.references :ems, :type => :bigint, :index => true, :references => :ext_management_system 12 | t.timestamps 13 | end 14 | 15 | add_reference :cloud_databases, :cloud_database_server 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /lib/tasks/README.md: -------------------------------------------------------------------------------- 1 | Tasks (.rake files) in this directory will be available as public tasks in the main 2 | ManageIQ app. They can be executed in the plugin gem via the app: namespace 3 | 4 | ```shell 5 | bin/rails app: