Code Monkey home page Code Monkey logo

catalog-api's Introduction

Catalog API

Build Status Maintainability Test Coverage Security

Build history for master branch

OpenAPI for Rails 5

This is a project to provide OpenAPI support inside the Ruby on Rails framework.

Prerequisites

You need to install ruby >= 2.2.2 and run:

bundle install

Getting started with Catalog

Environmental variables

export CATALOG_DATABASE_USERNAME=<<database_user>>
export CATALOG_DATABASE_PASSSWORD=<<database_password>>
or
export DATABASE_URL=postgres://pguser:pgpass@localhost/somedatabase
export MANAGEIQ_USER=admin
export MANAGEIQ_PASSWORD=smartvm
export MANAGEIQ_HOST=localhost
export MANAGEIQ_PORT=3000

If the topology inventory requires authentication (ie in dev), basic authentication is supported via these variables. They won't be read in unless :

export DEV_USERNAME=myuser
export DEV_PASSWORD=password
bin/rake db:create db:migrate
bin/rails s

Force Puma to use another port

Puma ignores the -p flag with bin/rails s

env PORT=4000 rails s

Rails server with SSL

Example uses port 3000

bin/rails s -b 'ssl://localhost:3000?key=config/ssl/localhost.key&cert=config/ssl/localhost.crt'

Routes

To list all your routes, use:

bin/rake routes

Testing with Dev Insights UI

If you want to run the catalog locally on your dev machine but access the UI on the dev cluster you would need to do the following

Install Docker in your machine

Clone the following repo to your dev machine

Insights Proxy

Follow the setup instructions in README.md

In the catalog-api repository the config directory contains a JavaScript file (spandx.config.js) which can be used with Insights Proxy to route the catalog requests to your dev machine

The Insights Proxy runs a docker container and it can be tailored using config files

You would need 2 terminals for this setup

  1. Running your catalog app

Includes the RBAC_URL and `APPROVAL_URL environment variables to be able to use RBAC

You can also remove the RBAC_URL environment variable and pass in the BYPASS_RBAC environment variable instead if you want to test without RBAC

APP_NAME=catalog PATH_PREFIX=/api RBAC_URL=https://<url>/api/rbac/v1/ APPROVAL_URL=https://<url>/api/approval/v1/ TOPOLOGICAL_INVENTORY_URL=https://<url>/api/topological-inventory/v1/ SOURCES_URL=https://<url>/api/sources/v1/ DEV_USERNAME=<username> DEV_PASSWORD=<password> bin/rails s -p 5000
  1. Run the insights proxy based on Linux or Mac
SPANDX_CONFIG=/path/to/catalog-api/config/spandx.config.js bash /path/to/insights-proxy/scripts/run.sh
  1. Login to the Dev cluster to access the UI

    Using this URL which connects to the insights proxy running in the docker container https://ci.foo.redhat.com:1337/ansible/catalog

License

This project is available as open source under the terms of the Apache License 2.0.

catalog-api's People

Contributors

abellotti avatar agrare avatar bdunne avatar brahmanim avatar bzwei avatar carbonin avatar cbudz avatar clacroix12 avatar eclarizio avatar epwinchell avatar fryguy avatar gmcculloug avatar hsong-rh avatar hyperkid123 avatar lgalis avatar lpichler avatar mkanoor avatar pkomanek avatar syncrou avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.