コード例 #1
0
def terminate_replica(master_host, namespace, target, exit_code=0):
    """Issue a request to terminate the requested TF replica running test_app.

  Args:
    master_host: The IP address of the master e.g. https://35.188.37.10
    namespace: The namespace
    target: The K8s service corresponding to the pod to terminate.
    exit_code: What exit code to terminate the pod with.
  """
    params = {
        "exitCode": exit_code,
    }
    util.send_request(master_host, namespace, target, "exit", params)
コード例 #2
0
def get_runconfig(master_host, namespace, target):
  """Issue a request to get the runconfig of the specified replica running test_server.
    Args:
    master_host: The IP address of the master e.g. https://35.188.37.10
    namespace: The namespace
    target: The K8s service corresponding to the pod to call.
  """
  response = tf_operator_util.send_request(master_host, namespace, target, "runconfig", {})
  return yaml.load(response)