Skip to content

Commit 0864163

Browse files
committed
[LIB-837] add possibility to directly point instance name when getting all endpoints;
1 parent d982fd0 commit 0864163

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

syncano/models/custom_sockets.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,10 +140,12 @@ def run(self, method='GET', data=None):
140140
return response
141141

142142
@classmethod
143-
def get_all_endpoints(cls):
143+
def get_all_endpoints(cls, instance_name=None):
144144
connection = cls._meta.connection
145-
all_endpoints_path = Instance._meta.resolve_endpoint('endpoints',
146-
{'name': cls.please.properties.get('instance_name')})
145+
all_endpoints_path = Instance._meta.resolve_endpoint(
146+
'endpoints',
147+
{'name': cls.please.properties.get('instance_name') or instance_name}
148+
)
147149
response = connection.request('GET', all_endpoints_path)
148150
return [cls(**endpoint) for endpoint in response['objects']]
149151

0 commit comments

Comments
 (0)