Skip to content

Commit

Permalink
Merge branch 'master' into firmware_update_sh
Browse files Browse the repository at this point in the history
  • Loading branch information
alisha-k-kalladassery authored Feb 15, 2023
2 parents 5973100 + 62920c7 commit 1bdddc4
Show file tree
Hide file tree
Showing 10 changed files with 247 additions and 276 deletions.
26 changes: 21 additions & 5 deletions endpoints-support.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
| <sub>/rest/connection-templates/defaultConnectionTemplate</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark:|:white_check_mark: |:white_check_mark: |:white_check_mark:|:white_check_mark:|
| <sub>/rest/connection-templates/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark:|:white_check_mark: |:white_check_mark: |:white_check_mark:|:white_check_mark:|
| <sub>/rest/connection-templates/{id}</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark:|:white_check_mark: |:white_check_mark: |:white_check_mark:|:white_check_mark:|
| **Drive Enclosures**
| <sub>/rest/drive-enclosures</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark:|:white_check_mark: |:white_check_mark: |:white_check_mark:|:white_check_mark:|
| <sub>/rest/drive-enclosures/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark:|:white_check_mark: |:white_check_mark: |:white_check_mark:|:white_check_mark:|
| <sub>/rest/drive-enclosures/{id}</sub> | PATCH | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark:|:white_check_mark: |:white_check_mark: |:white_check_mark:|:white_check_mark:|
| <sub>/rest/drive-enclosures/{id}/port-map</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark:|:white_check_mark: |:white_check_mark: |:white_check_mark:|:white_check_mark:|
| <sub>/rest/drive-enclosures/{id}/refreshState</sub> | PUT | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark:|:white_check_mark: |:white_check_mark: |:white_check_mark:|:white_check_mark:|
| **Enclosure Groups** |
| <sub>/rest/enclosure-groups</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark:|:white_check_mark: |:white_check_mark: |:white_check_mark:|:white_check_mark:|
| <sub>/rest/enclosure-groups</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark:|:white_check_mark: |:white_check_mark: |:white_check_mark:|:white_check_mark:|
Expand Down Expand Up @@ -333,15 +339,25 @@
| <sub>/rest/sas-logical-interconnect-groups/{id}</sub> | PUT
| <sub>/rest/sas-logical-interconnect-groups/{id}</sub> | DELETE
| **SAS Logical Interconnects** |
| <sub>/rest/sas-logical-interconnects</sub> | GET :
| <sub>/rest/sas-logical-interconnects</sub> | GET
| <sub>/rest/sas-logical-interconnects/{id}</sub> | GET
| <sub>/rest/sas-logical-interconnects/{id}/firmware</sub> | GET
| <sub>/rest/sas-logical-interconnects/{id}/firmware</sub> | PUT
| <sub>/rest/sas-logical-interconnects/compliance</sub> | PUT
| <sub>/rest/sas-logical-interconnects/{id}/compliance</sub> | PUT
| <sub>/rest/sas-logical-interconnects/{lsId}/configuration</sub> | PUT
| <sub>/rest/sas-logical-interconnects/{id}/replaceDriveEnclosure</sub> | POST
| **Scopes** |
| <sub>/rest/sas-logical-interconnects/{id}/replaceDriveEnclosure</sub> | POST
| **SAS Logical JBODs**
| <sub>/rest/sas-logical-jbods</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign: |:heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign:|
| <sub>/rest/sas-logical-jbods</sub> | POST | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign: |:heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign:|
| <sub>/rest/sas-logical-jbods/{id}</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign: |:heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign:|
| <sub>/rest/sas-logical-jbods/{id}</sub> | PATCH | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign: |:heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign:|
| <sub>/rest/sas-logical-jbods/{id}</sub> | DELETE | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign: |:heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign:|
| <sub>/rest/sas-logical-jbods/{id}/drives</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign: |:heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign:|
| **SAS Logical JBOD Attachments**
| <sub>/rest/sas-logical-jbod-attachments</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign: |:heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign:|
| <sub>/rest/sas-logical-jbod-attachments/{id}</sub> | GET | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: | :heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign: |:heavy_minus_sign: |:heavy_minus_sign:|:heavy_minus_sign:|
| **Scopes**
| <sub>/rest/scopes</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark:|:white_check_mark: |:white_check_mark: |:white_check_mark:|:white_check_mark:|
| <sub>/rest/scopes/{id}</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark:|:white_check_mark: |:white_check_mark: |:white_check_mark:|:white_check_mark:|
| <sub>/rest/scopes</sub> | POST | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark:|:white_check_mark: |:white_check_mark: |:white_check_mark:|:white_check_mark:|
Expand Down Expand Up @@ -488,11 +504,11 @@
| <sub>/rest/version</sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |:white_check_mark:|:white_check_mark: |:white_check_mark: |:white_check_mark:|:white_check_mark:|

## HPE Synergy Image Streamer|
## HPE Synergy Image Streamer

| Endpoints | Verb | V800 | V1000 | V1020 | V1600 | V2000 | V2010 | V2020 |
| ----------------------------------------------------------- | ------------- | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: | :----------------: |
| **Artifact Bundles** |:white_check_mark:|
| **Artifact Bundles**
| <sub> /rest/artifact-bundles </sub> | GET | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| <sub> /rest/artifact-bundles </sub> | POST {create} | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| <sub> /rest/artifact-bundles </sub> | POST {upload} | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
Expand Down
34 changes: 29 additions & 5 deletions examples/drive_enclosures.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
drive_enclosure_uri = first_drive_enclosure["uri"]

print("\nGet the drive enclosure by URI")
drive_enclosure_by_uri = oneview_client.drive_enclosures.get(drive_enclosure_uri)
drive_enclosure_by_uri = oneview_client.drive_enclosures.get_by_uri(drive_enclosure_uri)
pprint(drive_enclosure_by_uri)

product_name = first_drive_enclosure['productName']
Expand All @@ -52,20 +52,44 @@
drive_enclosure_by_product_name = oneview_client.drive_enclosures.get_by('productName', product_name)
pprint(drive_enclosure_by_product_name)

if drive_enclosure_by_uri:
print("\nGet the drive enclosure port map")
port_map = oneview_client.drive_enclosures.get_port_map(drive_enclosure_uri)
port_map = drive_enclosure_by_uri.get_port_map()
pprint(port_map)

print("\nRefresh the drive enclosure")
refresh_config = dict(refreshState="RefreshPending")
refreshed_drive_enclosure = oneview_client.drive_enclosures.refresh_state(drive_enclosure_uri, refresh_config)
refreshed_drive_enclosure = drive_enclosure_by_uri.refresh_state(refresh_config)
pprint(refreshed_drive_enclosure)

print("\nPower off a drive enclosure")
drive_enclosure_powered_off = oneview_client.drive_enclosures.patch(
id_or_uri=drive_enclosure_uri,
drive_enclosure_powered_off = drive_enclosure_by_uri.patch(
operation="replace",
path="/powerState",
value="Off"
)
pprint(drive_enclosure_powered_off)

print("\nPower on a drive enclosure")
drive_enclosure_powered_on = drive_enclosure_by_uri.patch(
operation="replace",
path="/powerState",
value="On"
)
pprint(drive_enclosure_powered_on)

print("\nChange Uid state of a drive enclosure")
drive_enclosure_uid_on = drive_enclosure_by_uri.patch(
operation="replace",
path="/uidState",
value="On"
)
pprint(drive_enclosure_uid_on)

print("\nHard Reset of a drive enclosure")
drive_enclosure_hard_reset = drive_enclosure_by_uri.patch(
operation="replace",
path="/hardResetState",
value="Reset"
)
pprint(drive_enclosure_hard_reset)
4 changes: 2 additions & 2 deletions examples/sas_logical_jbod_attachments.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
# Get by URI
print("\nGet a SAS logical JBOD attachment by URI")
uri = sas_logical_jbod_attachments[0]['uri']
sas_logical_jbod_attachment_by_uri = oneview_client.sas_logical_jbod_attachments.get(uri)
sas_logical_jbod_attachment_by_uri = oneview_client.sas_logical_jbod_attachments.get_by_uri(uri)
pprint(sas_logical_jbod_attachment_by_uri)

# Get by name
print("\nGet a SAS logical JBOD attachment by name")
name = sas_logical_jbod_attachments[0]['name']
sas_logical_jbod_attachment_by_name = oneview_client.sas_logical_jbod_attachments.get_by('name', name)
sas_logical_jbod_attachment_by_name = oneview_client.sas_logical_jbod_attachments.get_by_name(name)
pprint(sas_logical_jbod_attachment_by_name)
83 changes: 78 additions & 5 deletions examples/sas_logical_jbods.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,96 @@
}
}


# Try load config from a file (if there is a config file)
config = try_load_from_file(config)

oneview_client = OneViewClient(config)
sas_logical_jbods = oneview_client.sas_logical_jbods

print("\nGet all SAS logical JBODs")
all_sas_logical_jbods = oneview_client.sas_logical_jbods.get_all()
all_sas_logical_jbods = sas_logical_jbods.get_all()
pprint(all_sas_logical_jbods)

if all_sas_logical_jbods:

sas_logical_jbod_uri = all_sas_logical_jbods[0]["uri"]

print("\nGet the SAS logical JBOD by uri")
sas_logical_jbod_by_uri = oneview_client.sas_logical_jbods.get(id_or_uri=sas_logical_jbod_uri)
sas_logical_jbod_by_uri = sas_logical_jbods.get_by_uri(sas_logical_jbod_uri)
pprint(sas_logical_jbod_by_uri)

print("\nGet the list of drives allocated to this SAS logical JBOD")
drives = oneview_client.sas_logical_jbods.get_drives(id_or_uri=sas_logical_jbod_uri)
pprint(drives)
drive_enclosure_uri_list = []
drive_enclosures = oneview_client.drive_enclosures.get_all()
if drive_enclosures:
drive_enclosure_uri_list.append(drive_enclosures[0]['uri'])

options = {
"numPhysicalDrives": 1,
"name": "SasLogicalJBOD1",
"description": "Sas Jbod description",
"minSizeGB": 200,
"maxSizeGB": 600,
"eraseData": "true",
"driveTechnology":
{
"deviceInterface": "SAS",
"driveMedia": "HDD"
},
"driveEnclosureUris": drive_enclosure_uri_list,
}

print("\nCreate a SAS logical JBOD")
sas_logical_jbod1 = sas_logical_jbods.create(options)
pprint(sas_logical_jbod1)

# Ensure that the selected drive bays are not already part of another logical JBOD
drive_bay_uris = []
drive_bays = drive_enclosures[1]['driveBays']
drive_bay_uris.append(drive_bays[0]['uri'])
drive_bay_uris.append(drive_bays[1]['uri'])
options2 = {
"name": "SasLogicalJBOD2",
"description": "Sas Jbod description",
"eraseData": "true",
"driveBayUris": drive_bay_uris
}
print("\nCreates a SAS logical JBOD by providing specific drive bay URIs")
sas_logical_jbod2 = sas_logical_jbods.create(options2)
pprint(sas_logical_jbod2)

if sas_logical_jbod1:
drives_list = sas_logical_jbod1.get_drives()
print("\nList of drives allocated to SAS Logical JBOD: {}".format(drives_list))

print("\nPatch Operations on SAS logical JBOD")
sas_logical_jbod_changed1 = sas_logical_jbod1.patch(
operation="replace",
path="/name",
value="SasLogicalJBOD-Renamed"
)
print("\nChanged SAS logical JBOD name to {}".format(sas_logical_jbod_changed1.data['name']))

sas_logical_jbod_changed2 = sas_logical_jbod_changed1.patch(
operation="replace",
path="/description",
value="New Description"
)
print("\nChanged Description of JBOD {} to {}".format(sas_logical_jbod_changed1.data['name'], sas_logical_jbod_changed1.data['description']))

sas_logical_jbod_changed3 = sas_logical_jbod_changed2.patch(
operation="replace",
path="/eraseData",
value="false"
)
print("\nDisabled drive sanitize option of {}".format(sas_logical_jbod_changed3.data['name']))

sas_logical_jbod_changed4 = sas_logical_jbod_changed3.patch(
operation="replace",
path="/clearMetadata",
value="true"
)
print("\nCleared metadata of {}".format(sas_logical_jbod_changed4.data['name']))

print("\nRemove a SAS logical JBOD")
sas_logical_jbod_changed4.delete()
Loading

0 comments on commit 1bdddc4

Please sign in to comment.