Skip to content

Commit

Permalink
Expose the verify_credentials action for /api/providers
Browse files Browse the repository at this point in the history
  • Loading branch information
skateman committed Oct 2, 2019
1 parent 2382951 commit 5b61ddf
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions app/controllers/api/providers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ def change_password_resource(type, id, data = {})
end
end

def verify_credentials_resource(_type, _id, data = {})
klass = fetch_provider_klass(collection_class(:providers), data)
zone_name = fetch_zone(data).name
task_id = klass.verify_credentials_task(current_user, zone_name, data)
action_result(true, 'Credentials sent for verification', :task_id => task_id)
rescue => err
action_result(false, err.to_s)
end

private

def provider_options(type)
Expand Down
2 changes: 2 additions & 0 deletions config/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2297,6 +2297,8 @@
:identifier: ems_infra_edit
- :name: resume
:identifier: ems_infra_edit
- :name: verify_credentials
:identifier: ems_infra_new
:resource_actions:
:get:
- :name: read
Expand Down

0 comments on commit 5b61ddf

Please sign in to comment.