Skip to content

Commit

Permalink
Merge pull request #192 from HewlettPackard/doc/update_doc_i3s
Browse files Browse the repository at this point in the history
I3S - Update of the documentation
  • Loading branch information
aalexmonteiro committed Feb 23, 2017
2 parents 5c57e2a + d0eb7a1 commit 60b611f
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 12 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,17 @@ Then you can leave out these options from your config, enabling you to just do:
```ruby
require 'oneview-sdk'
client = OneviewSDK::Client.new
# and/or
i3s_client = OneviewSDK::ImageStreamer::Client.new
```

You can create the i3s client with environment variables in the following ways:
```ruby
require 'oneview-sdk'
# Uses this way when you set ONEVIEWSDK_USER and ONEVIEWSDK_PASSWORD to create Oneview client
# Note: Both options require the I3S_URL environment variable to be set.
# This way uses the ONEVIEWSDK_URL, ONEVIEWSDK_USER and ONEVIEWSDK_PASSWORD environment variables to generate a token:
client = OneviewSDK::Client.new
i3s_client = client.new_i3s_client # Returns an instance of i3s client
# or uses this way when you set ONEVIEWSDK_TOKEN
i3s_client = client.new_i3s_client

# This way uses the ONEVIEWSDK_TOKEN environment variable directly:
i3s_client = OneviewSDK::ImageStreamer::Client.new
```

Expand Down Expand Up @@ -180,7 +180,7 @@ OneviewSDK.api_version = 300
OneviewSDK.api_version # 300
OneviewSDK.api_version_updated? # true

# The API200 module has only 1 variant, but API300 has 2 (C7000 & Synergy):
# The API200 module has no variants, but API300 has 2 (C7000 & Synergy):
OneviewSDK::API300::SUPPORTED_VARIANTS # ['C7000', 'Synergy']
OneviewSDK::API300::DEFAULT_VARIANT # 'C7000'
OneviewSDK::API300.variant # 'C7000'
Expand Down
56 changes: 50 additions & 6 deletions spec/integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,15 @@ First, there's some setup you'll need to do. Do **EITHER** of the following:

### Option 1: Use default config file locations

Copy the [one_view_config.json.example](one_view_config.json.example) and
[one_view_secrets.json.example](one_view_secrets.json.example) files into the same directory (spec/integration) and drop the `.example` part of the filename on the new coppies. You should now have the following files:
Copy the [one_view_config.json.example](one_view_config.json.example),
[one_view_secrets.json.example](one_view_secrets.json.example), [one_view_synergy_config.json.example](one_view_synergy_config.json.example) and
[one_view_synergy_secrets.json.example](one_view_synergy_secrets.json.example) files into the same directory (spec/integration) and drop the `.example` part of the filename on the new copies. You should now have the following files:

```bash
spec/integration/one_view_config.json
spec/integration/one_view_secrets.json
spec/integration/one_view_synergy_config.json
spec/integration/one_view_synergy_secrets.json
spec/integration/one_view_config.json # Tests for API v200 and API v300 C7000
spec/integration/one_view_secrets.json # Tests for API v200 and API v300 C7000
spec/integration/one_view_synergy_config.json # Tests for API v300 Synergy
spec/integration/one_view_synergy_secrets.json # Tests for API v300 Synergy
```

### Option 2: Use environment variables to specify config file locations:**
Expand Down Expand Up @@ -51,6 +52,40 @@ These config files get loaded and create the following global variables:
- `$client_300`: Client object pinned to API v300 C7000
- `$client_300_synergy`: Client object pinned to API v300 Synergy


## Setup for Image Streamer
First, there's some setup you'll need to do. Do **EITHER** of the following:

### Option 1: Use default config file locations

Copy the [one_view_synergy_config.json.example](one_view_synergy_config.json.example) and [i3s_config.json.example](i3s_config.json.example)
files into the same directory (spec/integration) and drop the `.example` part of the filename on the new copies.
You should now have the following files:

```bash
spec/integration/one_view_synergy_config.json
spec/integration/i3s_config.json # Tests for API v300 Image Streamer
```

### Option 2: Use environment variables to specify config file locations:**

1. Copy the [one_view_synergy_config.json.example](one_view_synergy_config.json.example) and [i3s_config.json.example](i3s_config.json.example)
files to a secure location **outside** this repo. When you do so, drop the `.example` part of the filename.

- [one_view_synergy_config.json.example](one_view_synergy_config.json.example):
- [i3s_config.json.example](i3s_config.json.example): Tests for API v300 Image Streamer

2. Then set the following environment variables with the paths to the files you just created:

```bash
export ONEVIEWSDK_INTEGRATION_CONFIG_SYNERGY='/path/to/one_view_synergy_config.json'
export I3S_INTEGRATION_CONFIG='/path/to/i3s_config.json'
```



These config files get loaded and create the global variables `$client_i3s_300`.

## Running the tests
The following command must run in your Ruby SDK root directory:

Expand All @@ -66,4 +101,13 @@ $ rake spec:integration:delete
$ rake spec:integration:api_version[ver] # eg, spec:integration:api_version[300]
$ rake spec:integration:api[version,model] # eg, spec:integration:api_version[300,c7000]
$ rake spec:integration:delete:api_version[ver] # eg, spec:integration:delete:api_version[300]
$ rake test:path[path] # eg, test:path['spec/integration/resource/api200/connection_template']

# Tests for Image Streamer
$ rake spec:integration:i3s
$ rake spec:integration:i3s:create
$ rake spec:integration:i3s:update
$ rake spec:integration:i3s:delete
$ rake spec:integration:i3s:api_version[ver] # eg, spec:integration:i3s:api_version[300]
$ rake test:i3s:path[path] # eg, test:i3s:path['spec/integration/image-streamer/api300/os_volume']
```

0 comments on commit 60b611f

Please sign in to comment.