Commit d4ec6eea authored by Cool Fire's avatar Cool Fire

Add API endpoint to get configured i2am tunnels

parent 31c5d7cd
Pipeline #1397 failed with stage
in 2 minutes and 25 seconds
......@@ -2,6 +2,7 @@ API to allow limited access to puppet configuration and LDAP
## Quick function reference
### Function: `POST /v1/apache/vhost/list`:
List configured vhosts
- Requires API key in `key` parameter to access
......@@ -32,6 +33,10 @@ Create a new vhost
- Allows optional parameter to be set: `strongtls`
- Allows optional parameter to be set: `documentroot`
### Function: `POST /v1/i2am/tunnels/list`:
List configured tunnels
- Requires API key in `key` parameter to access
### Function: `POST /v1/limit/list`:
List configured limites
- Requires API key in `key` parameter to access
......
......@@ -41,6 +41,7 @@ require_relative 'helpers/requests'
require_relative 'helpers/users'
require_relative 'helpers/v1'
require_relative 'routes/v1/apache'
require_relative 'routes/v1/i2am'
require_relative 'routes/v1/limit'
require_relative 'routes/v1/mysql'
require_relative 'routes/v1/package'
......
# frozen_string_literal: true
# Functions for i2am project
class Manager2Api < Sinatra::Base
# List configured tunnels
post '/v1/i2am/tunnels/list' do
check_key(params)
result = git_get_full['profile::sshtunnel::destination::tunnels']
erb :result, locals: { message: 'Retreived configured tunnels', result: result }
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment