class_docstr: Nginx keeps track of registered domains, updates nginx config and issues SSL certificates.
  Its internal state could be serialized to a file and restored from it using pydantic.
class_docstr_tok: ["Nginx","keeps","track","of","registered","domains",",","updates","nginx","config","and","issues","SSL","certificates",".","Its","internal","state","could","be","serialized","to","a","file","and","restored","from","it","using","pydantic","."]
code: def reload():
      cmd = ["sudo", "systemctl", "reload", "nginx.service"]
      r = subprocess.run(cmd)
      if r.returncode != 0:
          raise GatewayError("Failed to reload nginx")
  
file_path: dstack/gateway/src/dstack/gateway/services/nginx.py
imports: import logging
  import re
  import subprocess
  import tempfile
  from asyncio import Lock
  from functools import lru_cache
  from pathlib import Path
  from typing import Any, Dict, List, Optional, Set, Tuple, Union
  from pydantic import BaseModel
  from dstack.gateway.common import run_async
  from dstack.gateway.errors import GatewayError
label_desc: Use image node_id 4 for calling the Nginx obj's underlying member method code with example usage: obj.reload() without return types