Skip to content

Commit

Permalink
Updating README and messages on startup
Browse files Browse the repository at this point in the history
  • Loading branch information
victorhugorodrigues committed Oct 18, 2018
1 parent 7a23227 commit 93e5418
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 15 deletions.
29 changes: 20 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,28 +12,35 @@ HPE OneView 4.0 version or above is required.

> In order to integrate properly with OneView, the OneView API 600 is required to be supported by OneView instance.
## Installation
# Getting started

### Requirements
## Requirements

HPE OneView Redfish Toolkit service relies on Python 3.5 or newer (as long as python3 executable is available) to run and [pip3](https://pip.pypa.io/en/stable/installing/) for dependencies management. A full list of dependencies is available at [requirements.txt](requirements.txt) file. For pyOpenSSL module please make sure to have OpenSSL lib installed in your system.
* Ubuntu 16.04
* Python >=3.5
* pip >=8.1.2

> There should be not problem in using Python 3.4 if your system does not have Python 3.5 available, but we do not guarantee complete compatibility as the test environment is set up on version 3.5.
## Dependencies

In order to run tests and documentation generation `tox` is also needed. General instructions on how to install are available [here](https://tox.readthedocs.io/en/latest/install.html).
All dependecies will be installed with the application. A full list of dependencies is available at [requirements.txt](requirements.txt) file. For pyOpenSSL module please make sure to have OpenSSL lib installed in your system.

### Production Environment
In order to run tests and documentation generation `tox` is also needed. General instructions on how to install are available [here](https://tox.readthedocs.io/en/latest/install.html).

Install the application:
## Installing the application

```bash
$ pip install git+https://github.com/HewlettPackard/oneview-redfish-toolkit.git
```

Run the application:
## Running the application

```bash
$ oneview-redfish-toolkit
Welcome to oneview-redfish-toolkit. Please enter a comma separated list of OneView IPs you want to connect to.
Oneview IP(s): <ENTER_ONEVIEW_IP>
Using configuration file: /root/.config/oneview-redfish-toolkit/redfish.conf
Using logging configuration file: /root/.config/oneview-redfish-toolkit/logging.conf
oneview-redfish-toolkit service is now available at 0.0.0.0:5000
```

The first time the application is run, it will create all the needed configuration files under user's home directory. It will also prompt for the OneView IP that you wish to connect to the redfish toolkit. This can either be a single IP address, or a comma seperated list of IP addresses. This modify the `redfish.conf` file with the entered IP addresses.
Expand All @@ -56,9 +63,13 @@ You can customize the configuration files created under the user directory, or i
$ oneview-redfish-toolkit --config redfish.conf --log-config logging.conf
```

# Additional information about the toolkit

## Toolkit Configuration

In order to start up oneview-redfish-toolkit service, there is some mandatory configuration at `redfish.conf` file to provide as explained below:
The toolkit configuration resides on `redfish.conf` file. All required properties have default values that will work just fine. The only empty required property, OneView IP, will be prompted for user at the first execution and will update this file with inputed value. If OneView IP change or if you want add more OneViews you can manually update the property. In the same way you can edit the `redfish.conf` file to tuning other available properties.

You can check all properties listed below:

* `redfish` section

Expand Down
17 changes: 11 additions & 6 deletions scripts/oneview-redfish-toolkit
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ def get_path_redfish_conf():
save_file = not (ov_ip and certs_dir)

if not ov_ip:
ov_ip = str(input('Set Oneview IP: '))
print('Welcome to oneview-redfish-toolkit. Please enter a comma '
'separated list of OneView IPs you want to connect to.')
ov_ip = str(input('Oneview IP(s): '))
config['oneview_config']['ip'] = ov_ip

if not certs_dir:
Expand All @@ -117,7 +119,6 @@ def get_path_redfish_conf():
if save_file:
with open(config_path, 'w') as configfile:
config.write(configfile)
print('Configuration file saved: ' + config_path)

return config_path

Expand Down Expand Up @@ -166,8 +167,6 @@ def get_path_logging_conf():
with open(logging_path, 'w') as configfile:
logging.write(configfile)

print('Logging file saved: ' + logging_path)

return logging_path


Expand Down Expand Up @@ -209,9 +208,15 @@ if __name__ == '__main__':
if args.stop:
stop_application()

config_logging_path = args.log_config or get_path_logging_conf()

config_path = args.config or get_path_redfish_conf()
print('Using configuration file: ' + config_path)

config_logging_path = args.log_config or get_path_logging_conf()
print('Using logging configuration file: ' + config_logging_path)

config = get_config_file(config_path)
print('oneview-redfish-toolkit service is now available at ' +
config['redfish']['redfish_host'] + ':' +
config['redfish']['redfish_port'])

oneview_redfish_toolkit.app.main(config_path, config_logging_path)

0 comments on commit 93e5418

Please sign in to comment.