From a23adb994e0148027c591252d172015275e57274 Mon Sep 17 00:00:00 2001
From: 35529110 <jonas@granel.dev>
Date: Sun, 15 Jan 2023 18:12:11 +0100
Subject: [PATCH] remove irs direct connect functionality and update docs

---
 docs/ahs.rst                                  |  3 --
 docs/methods                                  |  3 --
 hpilo.py                                      | 28 ---------------
 .../dc_registration_complete-97d170e1.args    |  1 -
 .../dc_registration_complete-97d170e1.request | 21 ------------
 .../set_ers_direct_connect-1e661dd8.args      |  1 -
 .../set_ers_direct_connect-1e661dd8.request   | 34 -------------------
 .../set_ers_web_proxy-19ea4c7b.args           |  1 -
 .../set_ers_web_proxy-19ea4c7b.request        | 28 ---------------
 tests/xml/generate_requests                   |  2 --
 10 files changed, 122 deletions(-)
 delete mode 100644 tests/xml/ProLiant BL460c G7 - iLO3 1.82/dc_registration_complete-97d170e1.args
 delete mode 100644 tests/xml/ProLiant BL460c G7 - iLO3 1.82/dc_registration_complete-97d170e1.request
 delete mode 100644 tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_direct_connect-1e661dd8.args
 delete mode 100644 tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_direct_connect-1e661dd8.request
 delete mode 100644 tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_web_proxy-19ea4c7b.args
 delete mode 100644 tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_web_proxy-19ea4c7b.request

diff --git a/docs/ahs.rst b/docs/ahs.rst
index 24b9c2d4..88b5c668 100644
--- a/docs/ahs.rst
+++ b/docs/ahs.rst
@@ -16,9 +16,6 @@ let you inspect and manipulate the AHS and ERS configuration and submit data.
    .. automethod:: get_ers_settings
    .. ilo_output:: get_ers_settings
    .. automethod:: set_ers_irs_connect
-   .. automethod:: set_ers_direct_connect
-   .. automethod:: dc_registration_complete
-   .. automethod:: set_ers_web_proxy
    .. automethod:: ers_ahs_submit
    .. automethod:: trigger_l2_collection
    .. automethod:: trigger_test_event
diff --git a/docs/methods b/docs/methods
index b4a2d37f..5440ca95 100644
--- a/docs/methods
+++ b/docs/methods
@@ -8,7 +8,6 @@ clear_ilo_event_log
 clear_server_event_log
 clear_server_power_on_time
 computer_lock_config
-dc_registration_complete
 delete_federation_group
 delete_user
 disable_ers
@@ -95,9 +94,7 @@ reset_rib
 reset_server
 set_ahs_status
 set_asset_tag
-set_ers_direct_connect
 set_ers_irs_connect
-set_ers_web_proxy
 set_federation_multicast
 set_language
 set_host_power
diff --git a/hpilo.py b/hpilo.py
index 78c5b31f..6460ce99 100644
--- a/hpilo.py
+++ b/hpilo.py
@@ -904,11 +904,6 @@ def computer_lock_config(self, computer_lock=None, computer_lock_key=None):
             elements.append(etree.Element('COMPUTER_LOCK_KEY', VALUE=computer_lock_key))
         return self._control_tag('RIB_INFO', 'COMPUTER_LOCK_CONFIG', elements=elements)
 
-    def dc_registration_complete(self):
-        """Complete the ERS registration of your device after calling
-           set_ers_direct_connect"""
-        return self._control_tag('RIB_INFO', 'DC_REGISTRATION_COMPLETE')
-
     def delete_federation_group(self, group_name):
         """Delete the specified federation group membership"""
         return self._control_tag('RIB_INFO', 'DELETE_FEDERATION_GROUP', attrib={'GROUP_NAME': group_name})
@@ -1843,19 +1838,6 @@ def set_critical_temp_remain_off(self, value):
         status = {True: 'Yes', False: 'No'}[value]
         return self._control_tag('SERVER_INFO', 'SET_CRITICAL_TEMP_REMAIN_OFF', attrib={'VALUE': value})
 
-    def set_ers_direct_connect(self, user_id, password, proxy_url=None,
-            proxy_port=None, proxy_username=None, proxy_password=None):
-        """Register your iLO with HP Insigt Online using Direct Connect. Note
-           that you must also call dc_registration_complete"""
-        elements = [
-            etree.Element('ERS_HPP_USER_ID', attrib={'VALUE': str(user_id)}),
-            etree.Element('ERS_HPP_PASSWORD', attrib={'VALUE': str(password)}),
-        ]
-        for key, value in locals().items():
-            if key.startswith('proxy_') and value is not None:
-                elements.append(etree.Element('ERS_WEB_' + key, attrib={'VALUE': str(value)}))
-        return self._control_tag('RIB_INFO', 'SET_ERS_DIRECT_CONNECT', elements=elements)
-
     def set_ers_irs_connect(self, ers_destination_url, ers_destination_port):
         """Connect to an Insight Remote Support server"""
         elements = [
@@ -1864,16 +1846,6 @@ def set_ers_irs_connect(self, ers_destination_url, ers_destination_port):
         ]
         return self._control_tag('RIB_INFO', 'SET_ERS_IRS_CONNECT', elements=elements)
 
-    def set_ers_web_proxy(self, proxy_url, proxy_port, proxy_username=None,
-            proxy_password=None):
-        """Register your iLO with HP Insigt Online using Direct Connect. Note
-           that you must also call dc_registration_complete"""
-        elements = []
-        for key, value in locals().items():
-            if key.startswith('proxy_') and value is not None:
-                elements.append(etree.Element('ERS_WEB_' + key, attrib={'VALUE': str(value)}))
-        return self._control_tag('RIB_INFO', 'SET_ERS_WEB_PROXY', elements=elements)
-
     def set_federation_multicast(self, multicast_federation_enabled=True, multicast_discovery_enabled=True,
                                  multicast_announcement_interval=600, ipv6_multicast_scope="Site", multicast_ttl=5):
         """Set the Federation multicast configuration"""
diff --git a/tests/xml/ProLiant BL460c G7 - iLO3 1.82/dc_registration_complete-97d170e1.args b/tests/xml/ProLiant BL460c G7 - iLO3 1.82/dc_registration_complete-97d170e1.args
deleted file mode 100644
index 0637a088..00000000
--- a/tests/xml/ProLiant BL460c G7 - iLO3 1.82/dc_registration_complete-97d170e1.args	
+++ /dev/null
@@ -1 +0,0 @@
-[]
\ No newline at end of file
diff --git a/tests/xml/ProLiant BL460c G7 - iLO3 1.82/dc_registration_complete-97d170e1.request b/tests/xml/ProLiant BL460c G7 - iLO3 1.82/dc_registration_complete-97d170e1.request
deleted file mode 100644
index 52ececf1..00000000
--- a/tests/xml/ProLiant BL460c G7 - iLO3 1.82/dc_registration_complete-97d170e1.request	
+++ /dev/null
@@ -1,21 +0,0 @@
-POST /ribcl HTTP/1.1
-Host: localhost
-Content-Length: 210
-Connection: Close
-
-<?xml version="1.0"?>
-<RIBCL
- VERSION="2.0"
->
-<LOGIN
- PASSWORD="TestPassword"
- USER_LOGIN="Administrator"
->
-<RIB_INFO
- MODE="write"
->
-<DC_REGISTRATION_COMPLETE
- />
-</RIB_INFO>
-</LOGIN>
-</RIBCL>
diff --git a/tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_direct_connect-1e661dd8.args b/tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_direct_connect-1e661dd8.args
deleted file mode 100644
index 7d72199c..00000000
--- a/tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_direct_connect-1e661dd8.args	
+++ /dev/null
@@ -1 +0,0 @@
-['ErsUser', 'ErsPassword', 'ErsProxyHost', 3128]
\ No newline at end of file
diff --git a/tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_direct_connect-1e661dd8.request b/tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_direct_connect-1e661dd8.request
deleted file mode 100644
index f7c778b5..00000000
--- a/tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_direct_connect-1e661dd8.request	
+++ /dev/null
@@ -1,34 +0,0 @@
-POST /ribcl HTTP/1.1
-Host: localhost
-Content-Length: 410
-Connection: Close
-
-<?xml version="1.0"?>
-<RIBCL
- VERSION="2.0"
->
-<LOGIN
- PASSWORD="TestPassword"
- USER_LOGIN="Administrator"
->
-<RIB_INFO
- MODE="write"
->
-<SET_ERS_DIRECT_CONNECT
->
-<ERS_HPP_USER_ID
- VALUE="ErsUser"
- />
-<ERS_HPP_PASSWORD
- VALUE="ErsPassword"
- />
-<ERS_WEB_proxy_host
- VALUE="ErsProxyHost"
- />
-<ERS_WEB_proxy_port
- VALUE="3128"
- />
-</SET_ERS_DIRECT_CONNECT>
-</RIB_INFO>
-</LOGIN>
-</RIBCL>
diff --git a/tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_web_proxy-19ea4c7b.args b/tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_web_proxy-19ea4c7b.args
deleted file mode 100644
index 5a5b3c15..00000000
--- a/tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_web_proxy-19ea4c7b.args	
+++ /dev/null
@@ -1 +0,0 @@
-['ErsProxy', 3128]
\ No newline at end of file
diff --git a/tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_web_proxy-19ea4c7b.request b/tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_web_proxy-19ea4c7b.request
deleted file mode 100644
index 78c50311..00000000
--- a/tests/xml/ProLiant BL460c G7 - iLO3 1.82/set_ers_web_proxy-19ea4c7b.request	
+++ /dev/null
@@ -1,28 +0,0 @@
-POST /ribcl HTTP/1.1
-Host: localhost
-Content-Length: 309
-Connection: Close
-
-<?xml version="1.0"?>
-<RIBCL
- VERSION="2.0"
->
-<LOGIN
- PASSWORD="TestPassword"
- USER_LOGIN="Administrator"
->
-<RIB_INFO
- MODE="write"
->
-<SET_ERS_WEB_PROXY
->
-<ERS_WEB_proxy_host
- VALUE="ErsProxy"
- />
-<ERS_WEB_proxy_port
- VALUE="3128"
- />
-</SET_ERS_WEB_PROXY>
-</RIB_INFO>
-</LOGIN>
-</RIBCL>
diff --git a/tests/xml/generate_requests b/tests/xml/generate_requests
index 1284b99b..b4a6d083 100755
--- a/tests/xml/generate_requests
+++ b/tests/xml/generate_requests
@@ -53,9 +53,7 @@ method_args = {
     'profile_desc_download': [['TestProfileDesc', 'TestProfile', 'Description']],
     'set_ahs_status': [[True]],
     'set_asset_tag': 'NL000001',
-    'set_ers_direct_connect': [['ErsUser', 'ErsPassword', 'ErsProxyHost', 3128]],
     'set_ers_irs_connect': [['ErsUrl', 9999]],
-    'set_ers_web_proxy': [['ErsProxy', 3128]],
     'set_federation_multicast': [[False]],
     'set_language': [['en']],
     'set_host_power': [[False]],