Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update provider generator supports :create/DDFv2 #22950

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
class <%= class_name %>::<%= manager_type %> < ManageIQ::Providers::<%= manager_type %>
supports :create

# Form schema for creating/editing a provider, it should follow the DDF specification
# For more information check the DDF documentation at: https://data-driven-forms.org
#
Expand All @@ -14,11 +16,6 @@ class <%= class_name %>::<%= manager_type %> < ManageIQ::Providers::<%= manager_
def self.params_for_create
{
:fields => [
{
:component => "text-field",
:name => "provider_region",
:label => _("Provider Region"),
},
Comment on lines -17 to -21
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NOTE provider_region doesn't make sense for a lot of the supported provider types and the "writing_a_new_provider" guide covers adding a proper provider regions dropdown not a simple text field.

{
:component => 'sub-form',
:name => 'endpoints-subform',
Expand All @@ -31,32 +28,31 @@ def self.params_for_create
:validationDependencies => %w[type zone_id provider_region],
:fields => [
{
:component => "select-field",
:name => "endpoints.default.security_protocol",
:label => _("Security Protocol"),
:isRequired => true,
:validate => [{:type => "required-validator"}],
:options => [
:component => "select",
:id => "endpoints.default.verify_ssl",
:name => "endpoints.default.verify_ssl",
:label => _("SSL verification"),
:dataType => "integer",
:isRequired => true,
:validate => [{:type => "required"}],
:initialValue => OpenSSL::SSL::VERIFY_PEER,
:options => [
{
:label => _("SSL without validation"),
:value => "ssl-no-validation"
:label => _('Do not verify'),
:value => OpenSSL::SSL::VERIFY_NONE,
},
{
:label => _("SSL"),
:value => "ssl-with-validation"
:label => _('Verify'),
:value => OpenSSL::SSL::VERIFY_PEER,
},
{
:label => _("Non-SSL"),
:value => "non-ssl"
}
]
},
{
:component => "text-field",
:name => "endpoints.default.hostname",
:label => _("Hostname (or IPv4 or IPv6 address)"),
:isRequired => true,
:validate => [{:type => "required-validator"}],
:validate => [{:type => "required"}],
},
{
:component => "text-field",
Expand All @@ -65,22 +61,22 @@ def self.params_for_create
:type => "number",
:initialValue => 12345,
:isRequired => true,
:validate => [{:type => "required-validator"}],
:validate => [{:type => "required"}]
},
{
:component => "text-field",
:name => "authentications.default.userid",
:label => "Username",
:isRequired => true,
:validate => [{:type => "required-validator"}],
:validate => [{:type => "required"}]
},
{
:component => "password-field",
:name => "authentications.default.password",
:label => "Password",
:type => "password",
:isRequired => true,
:validate => [{:type => "required-validator"}],
:validate => [{:type => "required"}]
},
]
}
Expand Down