diff --git a/app/models/manageiq/providers/openstack/manager_mixin.rb b/app/models/manageiq/providers/openstack/manager_mixin.rb index d63575160..cccbf2bbd 100644 --- a/app/models/manageiq/providers/openstack/manager_mixin.rb +++ b/app/models/manageiq/providers/openstack/manager_mixin.rb @@ -58,6 +58,17 @@ def params_for_create :name => "provider_region", :label => _("Provider Region"), }, + { + :component => "select-field", + :name => "provider_id", + :label => _("Openstack Infra Provider"), + :options => ManageIQ::Providers::Openstack::Provider.pluck(:name, :id).map do |name, id| + { + :label => name, + :value => id.to_s, + } + end + }, { :component => "select-field", :name => "api_version", @@ -78,7 +89,7 @@ def params_for_create }, { :component => 'text-field', - :name => 'keystone_v3_domain_id', + :name => 'uid_ems', :label => _('Domain ID'), :isRequired => true, :condition => { @@ -113,16 +124,16 @@ def params_for_create :fields => [ { :component => 'validate-provider-credentials', - :name => 'endpoints.default.valid', + :name => 'authentications.default.valid', :validationDependencies => %w[name type api_version provider_region keystone_v3_domain_id], :fields => [ { - :component => "select-field", - :name => "endpoints.default.default_security_protocol", - :label => _("Security Protocol"), - :isRequired => true, - :validate => [{:type => "required-validator"}], - :options => [ + :component => "select-field", + :name => "endpoints.default.security_protocol", + :label => _("Security Protocol"), + :isRequired => true, + :validate => [{:type => "required-validator"}], + :options => [ { :label => _("SSL without validation"), :value => "ssl-no-validation" @@ -139,14 +150,14 @@ def params_for_create }, { :component => "text-field", - :name => "endpoints.default.default_hostname", + :name => "endpoints.default.hostname", :label => _("Hostname (or IPv4 or IPv6 address)"), :isRequired => true, :validate => [{:type => "required-validator"}], }, { :component => "text-field", - :name => "endpoints.default.default_api_port", + :name => "endpoints.default.port", :label => _("API Port"), :type => "number", :initialValue => 13_000, @@ -155,14 +166,14 @@ def params_for_create }, { :component => "text-field", - :name => "endpoints.default.default_userid", + :name => "authentications.default.userid", :label => "Username", :isRequired => true, :validate => [{:type => "required-validator"}], }, { - :component => "text-field", - :name => "endpoints.default.password", + :component => "password-field", + :name => "authentications.default.password", :label => "Password", :type => "password", :isRequired => true, @@ -204,14 +215,14 @@ def params_for_create :fields => [ { :component => "text-field", - :name => "endpoints.amqp.amqp_hostname", + :name => "endpoints.amqp.hostname", :label => _("Hostname (or IPv4 or IPv6 address)"), :isRequired => true, :validate => [{:type => "required-validator"}], }, { :component => "text-field", - :name => "endpoints.amqp.amqp_api_port", + :name => "endpoints.amqp.port", :label => _("API Port"), :type => "number", :isRequired => true, @@ -220,14 +231,14 @@ def params_for_create }, { :component => "text-field", - :name => "endpoints.amqp.amqp_userid", + :name => "authentications.amqp.userid", :label => "Username", :isRequired => true, :validate => [{:type => "required-validator"}], }, { - :component => "text-field", - :name => "endpoints.amqp.password", + :component => "password-field", + :name => "authentications.amqp.password", :label => "Password", :type => "password", :isRequired => true, @@ -239,20 +250,25 @@ def params_for_create }, { :component => 'tab-item', - :name => 'rsa', + :name => 'ssh_keypair', :title => _('RSA key pair'), :fields => [ - { - :component => "text-field", - :name => "endpoints.rsa.username", - :label => _("Username"), - }, - { - :component => "text-field", # file upload maybe? - :name => "endpoints.rsa.private_key", - :label => _("Private Key"), - :type => "password", - }, + :component => 'provider-credentials', + :name => 'endpoints.ssh_keypair.valid', + :fields => [ + { + :component => "text-field", + :name => "endpoints.ssh_keypair.userid", + :label => _("Username"), + }, + { + :component => "password-field", + :name => "endpoints.ssh_keypair.auth_key", + :componentClass => 'textarea', + :rows => 10, + :label => _("Private Key"), + }, + ], ], }, ],