Skip to content

Commit d9e254b

Browse files
authored
Merge pull request #836 from MelsHyrule/host-update-fields
Introducing params_for_update schema fields for Hosts
2 parents 19bb190 + 3e96092 commit d9e254b

File tree

1 file changed

+158
-0
lines changed
  • app/models/manageiq/providers/openstack/infra_manager

1 file changed

+158
-0
lines changed

app/models/manageiq/providers/openstack/infra_manager/host.rb

Lines changed: 158 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ class ManageIQ::Providers::Openstack::InfraManager::Host < ::Host
2020
include_concern 'Operations'
2121

2222
supports :capture
23+
supports :update
2324
supports :refresh_network_interfaces
2425
supports :set_node_maintenance
2526
supports :unset_node_maintenance
@@ -83,6 +84,163 @@ def authentication_status
8384
end
8485
end
8586

87+
def params_for_update
88+
{
89+
:fields => [
90+
{
91+
:component => 'sub-form',
92+
:id => 'endpoints-subform',
93+
:name => 'endpoints-subform',
94+
:title => _("Endpoints"),
95+
:fields => [
96+
:component => 'tabs',
97+
:name => 'tabs',
98+
:fields => [
99+
{
100+
:component => 'tab-item',
101+
:id => 'default-tab',
102+
:name => 'default-tab',
103+
:title => _('Default'),
104+
:fields => [
105+
{
106+
:component => 'validate-host-credentials',
107+
:id => 'endpoints.default.valid',
108+
:name => 'endpoints.default.valid',
109+
:skipSubmit => true,
110+
:isRequired => true,
111+
:fields => [
112+
{
113+
:component => "text-field",
114+
:id => "authentications.default.userid",
115+
:name => "authentications.default.userid",
116+
:label => _("Username"),
117+
:isRequired => true,
118+
:validate => [{:type => "required"}],
119+
},
120+
{
121+
:component => "password-field",
122+
:id => "authentications.default.password",
123+
:name => "authentications.default.password",
124+
:label => _("Password"),
125+
:type => "password",
126+
:isRequired => true,
127+
:validate => [{:type => "required"}],
128+
},
129+
],
130+
},
131+
],
132+
},
133+
{
134+
:component => 'tab-item',
135+
:id => 'remote-tab',
136+
:name => 'remote-tab',
137+
:title => _('Remote Login'),
138+
:fields => [
139+
{
140+
:component => 'validate-host-credentials',
141+
:id => 'endpoints.remote.valid',
142+
:name => 'endpoints.remote.valid',
143+
:skipSubmit => true,
144+
:isRequired => true,
145+
:fields => [
146+
{
147+
:component => "text-field",
148+
:id => "authentications.remote.userid",
149+
:name => "authentications.remote.userid",
150+
:label => _("Username"),
151+
:isRequired => true,
152+
:validate => [{:type => "required"}],
153+
},
154+
{
155+
:component => "password-field",
156+
:id => "authentications.remote.password",
157+
:name => "authentications.remote.password",
158+
:label => _("Password"),
159+
:type => "password",
160+
:isRequired => true,
161+
:validate => [{:type => "required"}],
162+
:helperText => _('Required if SSH login is disabled for the Default account.')
163+
},
164+
],
165+
},
166+
],
167+
},
168+
{
169+
:component => 'tab-item',
170+
:id => 'ssh_keypair-tab',
171+
:name => 'ssh_keypair-tab',
172+
:title => _('SSH Keypair'),
173+
:fields => [
174+
{
175+
:component => 'validate-host-credentials',
176+
:id => 'endpoints.ssh_keypair.valid',
177+
:name => 'endpoints.ssh_keypair.valid',
178+
:skipSubmit => true,
179+
:isRequired => true,
180+
:fields => [
181+
{
182+
:component => "text-field",
183+
:id => "authentications.ssh_keypair.userid",
184+
:name => "authentications.ssh_keypair.userid",
185+
:label => _("Username"),
186+
:isRequired => true,
187+
:validate => [{:type => "required"}],
188+
},
189+
{
190+
:component => "password-field",
191+
:id => "authentications.ssh_keypair.password",
192+
:name => "authentications.ssh_keypair.password",
193+
:label => _("Password"),
194+
:type => "password",
195+
:isRequired => true,
196+
:validate => [{:type => "required"}],
197+
},
198+
],
199+
},
200+
],
201+
},
202+
{
203+
:component => 'tab-item',
204+
:id => 'ws-tab',
205+
:name => 'ws-tab',
206+
:title => _('Web Service'),
207+
:fields => [
208+
{
209+
:component => 'validate-host-credentials',
210+
:id => 'endpoints.ws.valid',
211+
:name => 'endpoints.ws.valid',
212+
:skipSubmit => true,
213+
:isRequired => true,
214+
:fields => [
215+
{
216+
:component => "text-field",
217+
:id => "authentications.ws.userid",
218+
:name => "authentications.ws.userid",
219+
:label => _("Username"),
220+
:isRequired => true,
221+
:validate => [{:type => "required"}],
222+
},
223+
{
224+
:component => "password-field",
225+
:id => "authentications.ws.password",
226+
:name => "authentications.ws.password",
227+
:label => _("Password"),
228+
:type => "password",
229+
:isRequired => true,
230+
:validate => [{:type => "required"}],
231+
:helperText => _('Used for access to Web Services.')
232+
},
233+
],
234+
},
235+
],
236+
},
237+
]
238+
]
239+
},
240+
]
241+
}
242+
end
243+
86244
def update_ssh_auth_status!
87245
# Creating just Auth status placeholder, the credentials are stored in parent or this auth, parent is
88246
# EmsOpenstackInfra in this case. We will create Auth per Host where we will store state, if it not exists

0 commit comments

Comments
 (0)