|
27 | 27 | from config_loader import try_load_from_file |
28 | 28 |
|
29 | 29 | config = { |
30 | | - "ip": "16.124.133.232", |
| 30 | + "ip": "172.16.102.59", |
31 | 31 | "credentials": { |
32 | 32 | "userName": "administrator", |
33 | | - "password": "ecosystem" |
34 | | - }, |
35 | | - "api_version": 500 |
| 33 | + "password": "" |
| 34 | + } |
36 | 35 | } |
37 | 36 |
|
38 | 37 | # Try load config from a file (if there is a config file) |
39 | 38 | config = try_load_from_file(config) |
40 | 39 |
|
41 | 40 | oneview_client = OneViewClient(config) |
42 | 41 |
|
| 42 | +networks = "/rest/fcoe-networks/7f0f74a0-4957-47ac-81c1-f573aa6d83de" |
| 43 | +scope_uris = "/rest/scopes/63d1ca81-95b3-41f1-a1ee-f9e1bc2d635f" |
| 44 | + |
43 | 45 | # Request body for create operation |
44 | 46 | # Supported from API version >= 500 |
45 | 47 | options = { |
|
117 | 119 | "Full", |
118 | 120 | "Thin Deduplication" |
119 | 121 | ], |
120 | | - "meta": { |
| 122 | + "meta": { |
121 | 123 | "locked": "true", |
122 | 124 | "createOnly": "true" |
123 | 125 | }, |
|
219 | 221 | print(" Found '{name}' at uri: {uri}".format(**volume_template_byname)) |
220 | 222 |
|
221 | 223 | # Gets the storage templates that are connected on the specified networks |
| 224 | +# scoper_uris and private_allowed_only parameters supported only with API version > 600 |
222 | 225 | print("Get torage templates that are connected on the specified networks") |
223 | | -storage_templates=oneview_client.storage_volume_templates.get_reachable_volume_templates( |
224 | | - networks="/rest/fcoe-networks/7f0f74a0-4957-47ac-81c1-f573aa6d83de,", |
225 | | - scope_uris="/rest/scopes/63d1ca81-95b3-41f1-a1ee-f9e1bc2d635f", |
226 | | - private_allowed_only=False) |
| 226 | +storage_templates = oneview_client.storage_volume_templates.get_reachable_volume_templates( |
| 227 | + networks=networks, scope_uris=scope_uris, private_allowed_only=False) |
227 | 228 | print(storage_templates) |
228 | 229 |
|
229 | 230 | # Retrieves all storage systems that is applicable to the storage volume template. |
|
0 commit comments