-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #16 from dell/release_2.1.0
Release 2.1.0.0 for PyPowerStore Python Library
- Loading branch information
Showing
19 changed files
with
351 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright: (c) 2023, Dell Technologies | ||
|
||
""" Discovered Appliance operations""" | ||
|
||
from PyPowerStore import powerstore_conn | ||
|
||
CONN = powerstore_conn.PowerStoreConn(username="<username>", | ||
password="<password>", | ||
server_ip="<IP>", | ||
verify=False, | ||
application_type="<Application>", | ||
timeout=180.0) | ||
print(CONN) | ||
|
||
# Get Discovered appliances list | ||
discovered_appliances_list = CONN.config_mgmt.get_discovered_appliances() | ||
print(discovered_appliances_list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
PyPowerStore/tests/unit_tests/data/discovered_appliances.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
class DiscoveredApplianceData: | ||
discovered_appliance_id = '51d0dc86-f0e8-2fdb-81g0-5cd1hgfhhd1e' | ||
discovered_appliance_list = [ | ||
{ | ||
"id": "51d0dc86-f0e8-2fdb-81g0-5cd1hgfhhd1e", | ||
"link_local_address": "xx.xx.xx.xx", | ||
"service_name": "appliance", | ||
"service_tag": "appliance-tag", | ||
"state": "Unconfigured", | ||
"mode": "Unified", | ||
"model": "appliance-model", | ||
"express_service_code": "service-code", | ||
"is_local": True, | ||
"management_service_ready": True, | ||
"software_version_compatibility": "Same", | ||
"build_version": "build-version", | ||
"build_id": "build-id", | ||
"power_score": 0, | ||
"node_count": 1, | ||
"is_unified_capable": True, | ||
"drive_failure_tolerance_level_and_availability": [ | ||
{ | ||
"level": "Single", | ||
"availability": "Available" | ||
} | ||
] | ||
} | ||
] |
24 changes: 24 additions & 0 deletions
24
PyPowerStore/tests/unit_tests/entity/discovered_appliances.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from PyPowerStore.tests.unit_tests.entity.base_abstract import Entity | ||
from PyPowerStore.tests.unit_tests.data.discovered_appliances import DiscoveredApplianceData | ||
|
||
|
||
class DiscoveredApplianceResponse(Entity): | ||
|
||
def __init__(self, method, url, **kwargs): | ||
self.method = method | ||
self.url = url | ||
self.kwargs = kwargs | ||
self.discovered_appliance_data = DiscoveredApplianceData() | ||
self.status_code = 200 | ||
|
||
def get_api_name(self): | ||
if self.method == 'GET': | ||
return self.get_discovered_appliances | ||
|
||
def execute_api(self, api_name): | ||
status_code, response = api_name() | ||
return status_code, response | ||
|
||
def get_discovered_appliances(self): | ||
return self.status_code,\ | ||
self.discovered_appliance_data.discovered_appliance_list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.