Skip to content

Commit

Permalink
Deprecate get_node_info() in favor of get_node_details()
Browse files Browse the repository at this point in the history
  • Loading branch information
iamkubi committed Oct 8, 2022
1 parent 81598e3 commit c5f25de
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion pydactyl/api/nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def list_nodes(self, include=None):
response = self._api_request(endpoint=endpoint, params=params)
return PaginatedResponse(self, endpoint, response)

def get_node_info(self, node_id):
def get_node_details(self, node_id):
"""Get detailed info for the specified node.
Args:
Expand All @@ -29,6 +29,16 @@ def get_node_info(self, node_id):
endpoint='application/nodes/{}'.format(node_id))
return response

def get_node_info(self, node_id):
"""Get detailed info for the specified node.
DEPRECATED: Use get_node_details
Args:
node_id(int): Pterodactyl Node ID.
"""
return self.get_node_details(node_id)

def create_node(self, name, description, location_id, fqdn, memory, disk,
memory_overallocate=0,
disk_overallocate=0, use_ssl=True, behind_proxy=False,
Expand Down Expand Up @@ -165,3 +175,4 @@ def delete_allocation(self, node_id, allocation_id):
response = self._api_request(
endpoint=endpoint, mode='DELETE', json=False)
return response

4 changes: 2 additions & 2 deletions tests/application/nodes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ def test_list_nodes_with_includes(self, mock_api):
mock_api.assert_called_with(**expected)

@mock.patch('pydactyl.api.base.PterodactylAPI._api_request')
def test_get_node_info(self, mock_api):
def test_get_node_details(self, mock_api):
expected = {
'endpoint': 'application/nodes/11',
}
self.client.nodes.get_node_info(11)
self.client.nodes.get_node_details(11)
mock_api.assert_called_with(**expected)

@mock.patch('pydactyl.api.base.PterodactylAPI._api_request')
Expand Down

0 comments on commit c5f25de

Please sign in to comment.