request#

todo: docstring

class acore_soap_agent.request.SoapRequestLoader[source]#

Load SOAPRequest from different sources.

classmethod from_command(command: str) SOAPRequest[source]#

Example:

>>> command = ".server info"
classmethod from_dict(dct: dict) SOAPRequest[source]#

Example:

>>> dct = {"command": ".server info"}
classmethod from_command_or_dict(command_or_dict: Union[str, dict]) SOAPRequest[source]#

Example:

>>> command_or_dict = ".server info"
# or
>>> command_or_dict = {"command": ".server info"}
classmethod from_list(lst: list) List[SOAPRequest][source]#

Example:

>>> lst = [".server info"]
# or
>>> lst = [{"command": ".server info"}]
classmethod from_object(obj: Union[str, dict, list]) List[SOAPRequest][source]#

Combination of from_command(), from_dict() and from_list().

Returns:

list of SOAPRequest.

classmethod from_string(s: str, s3_client: Optional[S3Client] = None, username: Optional[str] = None, password: Optional[str] = None, host: Optional[str] = None, port: Optional[int] = None) List[SOAPRequest][source]#

从字符串中加载 SOAPRequest. 该方法总是返回一个列表. 这个方法常用于 CLI 场景下, 从一个字符串中加载多个 GM 命令.

Parameters:
  • s – 输入的字符串. 如果是以 s3:// 开头, 那么就去 S3 读数据, 此时需要给定 s3_client 参数. 否则就视为单个 GM 命令.

  • username – 默认的用户名, 只有当 request.username 为 None 的时候才会用到.

  • password – 默认的密码, 只有当 request.password 为 None 的时候才会用到.

  • host – 默认的 host, 只有当 request.host 为 None 的时候才会用到.

  • port – 默认的 port, 只有当 request.port 为 None 的时候才会用到.

  • s3_client – boto3.client(“s3”)

class acore_soap_agent.request.SoapResponseDumper[source]#

Dump SOAPResponse to different destinations.

classmethod to_stdout(responses: List[SOAPResponse])[source]#

Dump SOAPResponse to stdout.

classmethod to_s3(responses: List[SOAPResponse], s3_client: S3Client, s3uri: str)[source]#

Dump SOAPResponse to S3.