-
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 #8 from dell/release_1.6.0
release 1.6.0 for PyPowerStore python library
- Loading branch information
Showing
38 changed files
with
1,691 additions
and
31 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,26 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright: (c) 2022, Dell EMC | ||
|
||
""" DNS operations""" | ||
|
||
from PyPowerStore import powerstore_conn | ||
|
||
CONN = powerstore_conn.PowerStoreConn(username="<username>", | ||
password="<password>", | ||
server_ip="<server_ip>", | ||
verify=False, | ||
timeout=180.0) | ||
|
||
# Getting DNS list | ||
dns_list = CONN.config_mgmt.get_dns_list() | ||
print(dns_list) | ||
|
||
# Getting DNS instance details | ||
dns_details = CONN.config_mgmt.get_dns_details(dns_id=dns_list[0]['id']) | ||
print(dns_details) | ||
|
||
# Modifying the DNS addresses | ||
modify_dict = { "addresses": ["XX.XX.XX.XX","XX.XX.XX.YY"] } | ||
|
||
resp_modify = CONN.config_mgmt.modify_dns_details(dns_id=dns_list[0]['id'], modify_parameters=modify_dict) | ||
print(resp_modify) |
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,45 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright: (c) 2022, Dell EMC | ||
|
||
""" Email 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) | ||
|
||
# Getting destination email addresses | ||
email_list = CONN.config_mgmt.get_destination_emails() | ||
print(email_list) | ||
|
||
# Getting destination email instance details | ||
email_details = CONN.config_mgmt.get_destination_email_details(email_id=email_list[0]['id']) | ||
print(email_details) | ||
|
||
# Getting destination email instance details using address | ||
email_details = CONN.config_mgmt.get_destination_email_by_address(email_address=email_details['email_address']) | ||
print(email_details) | ||
|
||
# Adding a destination email address | ||
create_dict = { "email_address": "abc_xyz@dell.com", "notify_critical": True } | ||
|
||
resp_create = CONN.config_mgmt.create_destination_email(create_params=create_dict) | ||
print(resp_create) | ||
|
||
# Modifying the destination email details | ||
modify_dict = { "notify_major": True } | ||
|
||
resp_modify = CONN.config_mgmt.modify_destination_email_details(email_id=resp_create['id'], modify_parameters=modify_dict) | ||
print(resp_modify) | ||
|
||
# Sending test mail to a destination email instance | ||
resp_test = CONN.config_mgmt.test_destination_email(email_id=resp_create['id']) | ||
print(resp_test) | ||
|
||
# Delete a destination email instance | ||
resp_delete = CONN.config_mgmt.delete_destination_email(email_id=resp_create['id']) | ||
print(resp_delete) |
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,26 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright: (c) 2022, Dell EMC | ||
|
||
""" NTP operations""" | ||
|
||
from PyPowerStore import powerstore_conn | ||
|
||
CONN = powerstore_conn.PowerStoreConn(username="<username>", | ||
password="<password>", | ||
server_ip="<server_ip>", | ||
verify=False, | ||
timeout=180.0) | ||
|
||
# Getting NTP list | ||
ntp_list = CONN.config_mgmt.get_ntp_list() | ||
print(ntp_list) | ||
|
||
# Getting NTP instance details | ||
ntp_details = CONN.config_mgmt.get_ntp_details(ntp_id=ntp_list[0]['id']) | ||
print(ntp_details) | ||
|
||
# Modifying the NTP addresses | ||
modify_dict = {"addresses": ["XX.XX.XX.XX","XX.XX.XX.YY"]} | ||
|
||
resp_modify = CONN.config_mgmt.modify_ntp_details(ntp_id=ntp_list[0]['id'], modify_parameters=modify_dict) | ||
print(resp_modify) |
31 changes: 31 additions & 0 deletions
31
ProgrammersGuideExamples/remote_support_contact_examples.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,31 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright: (c) 2022, Dell EMC | ||
|
||
""" Remote Support Contact operations""" | ||
|
||
from PyPowerStore import powerstore_conn | ||
|
||
CONN = powerstore_conn.PowerStoreConn(username="<username>", | ||
password="<password>", | ||
server_ip="<server_ip>", | ||
verify=False, | ||
timeout=180.0) | ||
|
||
# Getting Remote Support Contact configurations | ||
remote_support_contact_list = CONN.config_mgmt.get_remote_support_contact_list() | ||
print(remote_support_contact_list) | ||
|
||
# Getting Remote Support Contact instance details | ||
remote_support_contact_details = CONN.config_mgmt.get_remote_support_contact_details(remote_support_contact_id=remote_support_contact_list[0]['id']) | ||
print(remote_support_contact_details) | ||
|
||
# Modifying the Remote Support Contact details | ||
modify_dict = { | ||
"first_name": "abc", | ||
"last_name": "xyz", | ||
"email": "abc_xyz@dell.com", | ||
"phone": "111-222-333-444" | ||
} | ||
|
||
resp_modify = CONN.config_mgmt.modify_remote_support_contact_details(remote_support_contact_id=remote_support_contact_list[0]['id'], modify_parameters=modify_dict) | ||
print(resp_modify) |
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,45 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright: (c) 2022, Dell EMC | ||
|
||
""" Remote Support operations""" | ||
|
||
from PyPowerStore import powerstore_conn | ||
|
||
CONN = powerstore_conn.PowerStoreConn(username="<username>", | ||
password="<Password>", | ||
server_ip="<server_ip>", | ||
verify=False, | ||
timeout=180.0) | ||
|
||
# Getting Remote Support configurations | ||
remote_support_list = CONN.config_mgmt.get_remote_support_list() | ||
print(remote_support_list) | ||
|
||
# Getting Remote Support configuration instance details | ||
remote_support_details = CONN.config_mgmt.get_remote_support_details(remote_support_id=remote_support_list[0]['id']) | ||
print(remote_support_details) | ||
|
||
# Modifying the Remote Support configuration details | ||
modify_dict = { | ||
"type": "SRS_Integrated_Tier2", | ||
"proxy_address": "10.10.10.10", | ||
"proxy_port": 3128, | ||
"proxy_username": "user", | ||
"proxy_password": "pass123" | ||
} | ||
|
||
resp_modify = CONN.config_mgmt.modify_remote_support_details(remote_support_id=remote_support_list[0]['id'], modify_parameters=modify_dict) | ||
print(resp_modify) | ||
|
||
verify_dict = { | ||
"type": "SRS_Gateway_Tier3", | ||
"address": "10.10.10.10", | ||
"port": 9443 | ||
} | ||
|
||
resp_verify = CONN.config_mgmt.verify_remote_support_config(remote_support_id=remote_support_list[0]['id'], verify_parameters=verify_dict) | ||
print(resp_verify) | ||
|
||
# Sending test mail for Remote Support | ||
resp_test = CONN.config_mgmt.test_remote_support_config(remote_support_id=remote_support_list[0]['id']) | ||
print(resp_test) |
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,32 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright: (c) 2022, Dell EMC | ||
|
||
""" SMTP Config operations""" | ||
|
||
from PyPowerStore import powerstore_conn | ||
|
||
CONN = powerstore_conn.PowerStoreConn(username="<username>", | ||
password="<password>", | ||
server_ip="<server_ip>", | ||
verify=False, | ||
timeout=180.0) | ||
|
||
# Getting SMTP configurations | ||
smtp_config_list = CONN.config_mgmt.get_smtp_configs() | ||
print(smtp_config_list) | ||
|
||
# Getting SMTP configuration instance details | ||
smtp_config_details = CONN.config_mgmt.get_smtp_config_details(smtp_id=smtp_config_list[0]['id']) | ||
print(smtp_config_details) | ||
|
||
# Modifying the SMTP configuration details | ||
modify_dict = { "address": "sample.smtp.com", "port": 25,"source_email": "def@dell.com" } | ||
|
||
resp_modify = CONN.config_mgmt.modify_smtp_config_details(smtp_id=smtp_config_list[0]['id'], modify_parameters=modify_dict) | ||
print(resp_modify) | ||
|
||
# Sending test mail through an SMTP configuration | ||
test_dict = { "email_address": "xyz@dell.com" } | ||
|
||
resp_test = CONN.config_mgmt.test_smtp_config(smtp_id=smtp_config_list[0]['id'], test_parameters=test_dict) | ||
print(resp_test) |
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
Oops, something went wrong.