Skip to content

Commit

Permalink
Adjusted endpoints and other fields in the provider creation DDF
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Mar 19, 2020
1 parent 8088ddc commit 9aeea7f
Showing 1 changed file with 47 additions and 30 deletions.
77 changes: 47 additions & 30 deletions app/models/manageiq/providers/openstack/manager_mixin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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 => {
Expand Down Expand Up @@ -113,16 +124,17 @@ 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"}],
:initialValue => 'ssl-with-validation',
:options => [
{
:label => _("SSL without validation"),
:value => "ssl-no-validation"
Expand All @@ -139,14 +151,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,
Expand All @@ -155,14 +167,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,
Expand Down Expand Up @@ -204,14 +216,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,
Expand All @@ -220,14 +232,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,
Expand All @@ -239,20 +251,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"),
},
],
],
},
],
Expand Down

0 comments on commit 9aeea7f

Please sign in to comment.