appmesh 1.3.1__py3-none-any.whl → 1.3.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
appmesh/appmesh_client.py CHANGED
@@ -312,18 +312,18 @@ class AppRun(object):
312
312
  """process_uuid from run_async()"""
313
313
  self._client = client
314
314
  """AppMeshClient object"""
315
- self._delegate_host = client.delegate_host
316
- """delegate host indicates the target server for this app run"""
315
+ self._forwarding_host = client.forwarding_host
316
+ """forward host indicates the target server for this app run"""
317
317
 
318
318
  @contextmanager
319
- def delegate_host(self):
320
- """context manager for delegate host override to self._client"""
321
- original_value = self._client.delegate_host
322
- self._client.delegate_host = self._delegate_host
319
+ def forwarding_host(self):
320
+ """context manager for forward host override to self._client"""
321
+ original_value = self._client.forwarding_host
322
+ self._client.forwarding_host = self._forwarding_host
323
323
  try:
324
324
  yield
325
325
  finally:
326
- self._client.delegate_host = original_value
326
+ self._client.forwarding_host = original_value
327
327
 
328
328
  def wait(self, stdout_print: bool = True, timeout: int = 0) -> int:
329
329
  """Wait for an async run to be finished
@@ -335,7 +335,7 @@ class AppRun(object):
335
335
  Returns:
336
336
  int: return exit code if process finished, return None for timeout or exception.
337
337
  """
338
- with self.delegate_host():
338
+ with self.forwarding_host():
339
339
  return self._client.run_async_wait(self, stdout_print, timeout)
340
340
 
341
341
 
@@ -380,7 +380,7 @@ class AppMeshClient(metaclass=abc.ABCMeta):
380
380
  self.ssl_verify = rest_ssl_verify
381
381
  self.ssl_client_cert = rest_ssl_client_cert
382
382
  self.rest_timeout = rest_timeout
383
- self._delegate_host = None
383
+ self._forwarding_host = None
384
384
 
385
385
  @property
386
386
  def jwt_token(self) -> str:
@@ -401,22 +401,22 @@ class AppMeshClient(metaclass=abc.ABCMeta):
401
401
  self._jwt_token = token
402
402
 
403
403
  @property
404
- def delegate_host(self) -> str:
405
- """property for delegate_host
404
+ def forwarding_host(self) -> str:
405
+ """property for forwarding_host
406
406
 
407
407
  Returns:
408
- str: delegate request to target host (host:port)
408
+ str: forward request to target host (host:port)
409
409
  """
410
- return self._delegate_host
410
+ return self._forwarding_host
411
411
 
412
- @delegate_host.setter
413
- def delegate_host(self, host: str) -> None:
414
- """setter for delegate_host
412
+ @forwarding_host.setter
413
+ def forwarding_host(self, host: str) -> None:
414
+ """setter for forwarding_host
415
415
 
416
416
  Args:
417
- host (str): delegate request to target host (host:port)
417
+ host (str): forward request to target host (host:port)
418
418
  """
419
- self._delegate_host = host
419
+ self._forwarding_host = host
420
420
 
421
421
  ########################################
422
422
  # Security
@@ -1335,11 +1335,11 @@ class AppMeshClient(metaclass=abc.ABCMeta):
1335
1335
  header = {} if header is None else header
1336
1336
  if self.jwt_token:
1337
1337
  header["Authorization"] = "Bearer " + self.jwt_token
1338
- if self.delegate_host and len(self.delegate_host) > 0:
1339
- if ":" in self.delegate_host:
1340
- header[HTTP_HEADER_KEY_X_TARGET_HOST] = self.delegate_host
1338
+ if self.forwarding_host and len(self.forwarding_host) > 0:
1339
+ if ":" in self.forwarding_host:
1340
+ header[HTTP_HEADER_KEY_X_TARGET_HOST] = self.forwarding_host
1341
1341
  else:
1342
- header[HTTP_HEADER_KEY_X_TARGET_HOST] = self.delegate_host + ":" + str(parse.urlsplit(self.server_url).port)
1342
+ header[HTTP_HEADER_KEY_X_TARGET_HOST] = self.forwarding_host + ":" + str(parse.urlsplit(self.server_url).port)
1343
1343
  header[HTTP_USER_AGENT_HEADER_NAME] = HTTP_USER_AGENT
1344
1344
 
1345
1345
  if method is AppMeshClient.Method.GET:
@@ -1503,8 +1503,8 @@ class AppMeshClientTCP(AppMeshClient):
1503
1503
  appmesh_requst = RequestMsg()
1504
1504
  if super().jwt_token:
1505
1505
  appmesh_requst.headers["Authorization"] = "Bearer " + super().jwt_token
1506
- if super().delegate_host and len(super().delegate_host) > 0:
1507
- raise Exception("Not support delegate request in TCP mode")
1506
+ if super().forwarding_host and len(super().forwarding_host) > 0:
1507
+ raise Exception("Not support forward request in TCP mode")
1508
1508
  appmesh_requst.headers[HTTP_USER_AGENT_HEADER_NAME] = HTTP_USER_AGENT_TCP
1509
1509
  appmesh_requst.uuid = str(uuid.uuid1())
1510
1510
  appmesh_requst.http_method = method.value
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: appmesh
3
- Version: 1.3.1
3
+ Version: 1.3.2
4
4
  Summary: Client SDK for App Mesh
5
5
  Home-page: https://github.com/laoshanxi/app-mesh
6
6
  Author: laoshanxi
@@ -0,0 +1,6 @@
1
+ appmesh/__init__.py,sha256=xRdXeFHEieRauuJZElbEBASgXG0ZzU1a5_0isAhM7Gw,11
2
+ appmesh/appmesh_client.py,sha256=Ev0MMq7nu02pFbmTCLvPdxK3P-NmOeQQXiIYAibSYjQ,62923
3
+ appmesh-1.3.2.dist-info/METADATA,sha256=pp8AVbBvK6naixdn039eaqy49JFa9dX6Qs7XS7mD7-0,11031
4
+ appmesh-1.3.2.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
5
+ appmesh-1.3.2.dist-info/top_level.txt,sha256=-y0MNQOGJxUzLdHZ6E_Rfv5_LNCkV-GTmOBME_b6pg8,8
6
+ appmesh-1.3.2.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.0.0)
2
+ Generator: setuptools (75.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,6 +0,0 @@
1
- appmesh/__init__.py,sha256=xRdXeFHEieRauuJZElbEBASgXG0ZzU1a5_0isAhM7Gw,11
2
- appmesh/appmesh_client.py,sha256=BHgPST7m4vFbGCzHfg_kaqFZZyP9dW-h2M8mEurfyt0,62882
3
- appmesh-1.3.1.dist-info/METADATA,sha256=qtqT4-GC1-PwliFwBHf-7Ixbt-UjgHiZ5DxO2JGkGfQ,11031
4
- appmesh-1.3.1.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
5
- appmesh-1.3.1.dist-info/top_level.txt,sha256=-y0MNQOGJxUzLdHZ6E_Rfv5_LNCkV-GTmOBME_b6pg8,8
6
- appmesh-1.3.1.dist-info/RECORD,,