docstr: Deploy or update an API.
  
  Args:
      api_spec: A dictionary defining a single Cortex API. See https://docs.cortexlabs.com/v/master/ for schema.
      force: Override any in-progress api updates.
      wait: Block until the API is ready.
  
  Returns:
      Deployment status, API specification, and endpoint for each API.
docstr_tok: ["Deploy","or","update","an","API",".","Args",":","api_spec",":","A","dictionary","defining","a","single","Cortex","API",".","See","https",":","\/\/docs.cortexlabs.com\/v\/master\/","for","schema",".","force",":","Override","any","in-progress","api","updates",".","wait",":","Block","until","the","API","is","ready",".","Returns",":","Deployment","status",",","API","specification",",","and","endpoint","for","each","API","."]
code: def deploy(
      self,
      api_spec: Dict[str, Any],
      force: bool = True,
      wait: bool = False,
  ):
      """
      Deploy or update an API.
  
      Args:
          api_spec: A dictionary defining a single Cortex API. See https://docs.cortexlabs.com/v/master/ for schema.
          force: Override any in-progress api updates.
          wait: Block until the API is ready.
  
      Returns:
          Deployment status, API specification, and endpoint for each API.
      """
  
      temp_deploy_dir = (
          util.cli_config_dir() / "deployments" / api_spec["name"]
      )
      if temp_deploy_dir.exists():
          shutil.rmtree(str(temp_deploy_dir))
      temp_deploy_dir.mkdir(parents=True)
  
      cortex_yaml_path = os.path.join(temp_deploy_dir, "cortex.yaml")
  
      with util.open_temporarily(
          cortex_yaml_path, "w", delete_parent_if_empty=True
      ) as f:
          yaml.dump([api_spec], f)  # write a list
          return self.deploy_from_file(
              cortex_yaml_path, force=force, wait=wait
          )
  
file_path: cortex/python/client/cortex/client.py
imports: import json
  import os
  import shutil
  import time
  import yaml
  from typing import List, Dict, Any
  from cortex import util
  from cortex.binary import run_cli
  from cortex.telemetry import sentry_wrapper
label_desc: Use image node_id 2 for calling the Client obj's underlying member method code with example usage: obj.deploy(api_spec, force, wait) and returns: self