mcsmapi.models package
Submodules
mcsmapi.models.daemon module
- class mcsmapi.models.daemon.CpuMemChart(*, cpu: float = 0, mem: float = 0)[源代码]
基类:
BaseModel
- cpu: float
- mem: float
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mcsmapi.models.daemon.DaemonConfig(*, ip: str = 'localhost', port: int = 24444, prefix: str = '', remarks: str = 'New Daemon', available: bool = True)[源代码]
基类:
BaseModel
- available: bool
- ip: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- port: int
- prefix: str
- remarks: str
- class mcsmapi.models.daemon.DaemonModel(*, version: str = '', process: ProcessInfo = ProcessInfo(cpu=0, memory=0, cwd=''), instance: InstanceInfo = InstanceInfo(running=0, total=0), system: SystemInfo = SystemInfo(type='', hostname='', platform='', release='', uptime=0, cwd='', loadavg=[], freemem=0, cpuUsage=0, memUsage=0, totalmem=0, processCpu=0, processMem=0), cpuMemChart: List[CpuMemChart] = [], uuid: str = '', ip: str = '', port: str = '', prefix: str = '', available: bool = False, remarks: str = '')[源代码]
基类:
BaseModel
- available: bool
- cpuMemChart: List[CpuMemChart]
- createInstance(config: dict[str, Any]) InstanceCreateResult [源代码]
在当前节点创建一个实例。
参数: - config (dict[str, Any]): 实例的配置信息,以字典形式提供,缺失内容由InstanceConfig模型补全。
返回: - InstanceCreateResult: 一个包含新创建实例信息的结果对象,内容由InstanceCreateResult模型定义。
- deleteInstance(uuids: list[str], deleteFile=False) list[str] [源代码]
删除当前节点的一个或多个实例。
参数: - uuids (list[str]): 要删除的实例UUID列表。 - deleteFile (bool, optional): 是否删除关联的文件,默认为False。
返回: - list[str]: 删除操作后返回的UUID列表。
- instance: InstanceInfo
- ip: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- port: str
- prefix: str
- process: ProcessInfo
- remarks: str
- system: SystemInfo
- updateConfig(config: dict[str, Any]) bool [源代码]
更新该节点的配置。
参数: - config (dict[str, Any]): 节点的配置信息,以字典形式提供,缺失内容使用原节点配置填充。
返回: - bool: 更新成功后返回True
- uuid: str
- version: str
- class mcsmapi.models.daemon.InstanceInfo(*, running: int = 0, total: int = 0)[源代码]
基类:
BaseModel
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- running: int
- total: int
- class mcsmapi.models.daemon.ProcessInfo(*, cpu: int = 0, memory: int = 0, cwd: str = '')[源代码]
基类:
BaseModel
- cpu: int
- cwd: str
- memory: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mcsmapi.models.daemon.SystemInfo(*, type: str = '', hostname: str = '', platform: str = '', release: str = '', uptime: float = 0, cwd: str = '', loadavg: List[float] = [], freemem: int = 0, cpuUsage: float = 0, memUsage: float = 0, totalmem: int = 0, processCpu: int = 0, processMem: int = 0)[源代码]
基类:
BaseModel
- cpuUsage: float
- cwd: str
- freemem: int
- hostname: str
- loadavg: List[float]
- memUsage: float
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- platform: str
- processCpu: int
- processMem: int
- release: str
- totalmem: int
- type: str
- uptime: float
mcsmapi.models.file module
- class mcsmapi.models.file.CommonConfig(*, password: str = '', addr: str = '')[源代码]
基类:
BaseModel
- addr: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- password: str
- class mcsmapi.models.file.FileItem(*, name: str = 'New File', size: int = 0, time: str = '', mode: int = 777, type: int = 0, daemonId: str = '', uuid: str = '', target: str = '')[源代码]
基类:
BaseModel
- copy(target: str) bool [源代码]
Returns a copy of the model.
- !!! warning "Deprecated"
This method is now deprecated; use model_copy instead.
If you need include or exclude, use:
`python {test="skip" lint="skip"} data = self.model_dump(include=include, exclude=exclude, round_trip=True) data = {**data, **(update or {})} copied = self.model_validate(data) `
- Args:
include: Optional set or mapping specifying which fields to include in the copied model. exclude: Optional set or mapping specifying which fields to exclude in the copied model. update: Optional dictionary of field-value pairs to override field values in the copied model. deep: If True, the values of fields that are Pydantic models will be deep-copied.
- Returns:
A copy of the model with included, excluded and updated fields as specified.
- daemonId: str
- mode: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- move(target: str) bool [源代码]
移动该文件或文件夹到目标路径。
参数: - target (str): 目标文件或文件夹的路径。
返回: - bool: 移动成功后返回True。
- name: str
- rename(newName: str) bool [源代码]
重命名该文件或文件夹。
参数: - new_name (str): 源文件或文件夹的新名字。
返回: - bool: 重命名成功后返回True。
- size: int
- target: str
- time: str
- type: int
- unzip(target: str, code: str = 'utf-8') bool [源代码]
解压缩该 zip 文件到目标位置。
参数: - target (str): 解压到的目标路径。 - code (str, optional): 压缩文件的编码方式,默认为"utf-8"。
可选值: utf-8, gbk, big5
返回: - bool: 解压成功后返回True。
- uuid: str
- class mcsmapi.models.file.FileList(*, items: List[FileItem], page: int = 0, pageSize: int = 100, total: int = 0, absolutePath: str = '\\', daemonId: str = '', uuid: str = '', target: str = '')[源代码]
基类:
BaseModel
- absolutePath: str
- daemonId: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- page: int
- pageSize: int
- target: str
- total: int
- uuid: str
mcsmapi.models.image module
- class mcsmapi.models.image.DockerConfig(*, containerName: str = '', image: str = 'mcsm-ubuntu:22.04', memory: int = 1024, ports: List[str] = ['25565:25565/tcp'], extraVolumes: List[str] = [], maxSpace: int | None = None, network: str | None = None, io: str | None = None, networkMode: str = 'bridge', networkAliases: List[str] = [], cpusetCpus: str = '', cpuUsage: int = 100, workingDir: str = '', env: List[str] = [])[源代码]
基类:
BaseModel
- containerName: str
- cpuUsage: int
- cpusetCpus: str
- env: List[str]
- extraVolumes: List[str]
- image: str
- io: str | None
- maxSpace: int | None
- memory: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- network: str | None
- networkAliases: List[str]
- networkMode: str
- ports: List[str]
- workingDir: str
- class mcsmapi.models.image.DockerContainerItem(*, Id: str = '', Names: List[str] = [], Image: str = '', ImageID: str = '', Command: str = '', Created: int = 0, State: str = '', Status: str = '', Ports: List[DockerContainerItemPort] = [], Labels: dict[str, str] = {}, SizeRw: int = 0, SizeRootFs: int = 0, HostConfig: DockerContainerItemHostConfig = DockerContainerItemHostConfig(NetworkMode=''), NetworkSettings: DockerContainerItemNetworkSettings = DockerContainerItemNetworkSettings(Networks={}), Mounts: List[DockerContainerItemMount] = [])[源代码]
基类:
BaseModel
- Command: str
- Created: int
- HostConfig: DockerContainerItemHostConfig
- Id: str
- Image: str
- ImageID: str
- Labels: dict[str, str]
- Mounts: List[DockerContainerItemMount]
- Names: List[str]
- NetworkSettings: DockerContainerItemNetworkSettings
- Ports: List[DockerContainerItemPort]
- SizeRootFs: int
- SizeRw: int
- State: str
- Status: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mcsmapi.models.image.DockerContainerItemHostConfig(*, NetworkMode: str = '')[源代码]
基类:
BaseModel
- NetworkMode: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mcsmapi.models.image.DockerContainerItemMount(*, Name: str = '', Source: str = '', Destination: str = '', Driver: str = '', Mode: str = '', RW: bool = False, Propagation: str = '')[源代码]
基类:
BaseModel
- Destination: str
- Driver: str
- Mode: str
- Name: str
- Propagation: str
- RW: bool
- Source: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mcsmapi.models.image.DockerContainerItemNetworkSettings(*, Networks: dict[str, DockerContainerItemNetworkSettingsNetwork] = {})[源代码]
基类:
BaseModel
- Networks: dict[str, DockerContainerItemNetworkSettingsNetwork]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mcsmapi.models.image.DockerContainerItemNetworkSettingsNetwork(*, NetworkID: str = '', EndpointID: str = '', Gateway: str = '', IPAddress: str = '', IPPrefixLen: int = 0, IPv6Gateway: str = '', GlobalIPv6Address: str = '', GlobalIPv6PrefixLen: int = 0, MacAddress: str = '')[源代码]
基类:
BaseModel
- EndpointID: str
- Gateway: str
- GlobalIPv6Address: str
- GlobalIPv6PrefixLen: int
- IPAddress: str
- IPPrefixLen: int
- IPv6Gateway: str
- MacAddress: str
- NetworkID: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mcsmapi.models.image.DockerContainerItemPort(*, PrivatePort: int = 0, PublicPort: int | None = None, Type: str = '')[源代码]
基类:
BaseModel
- PrivatePort: int
- PublicPort: int | None
- Type: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mcsmapi.models.image.DockerImageItem(*, Id: str = '', ParentId: str = '', RepoTags: List[str] = [], RepoDigests: List[str] = [], Created: int = 0, Size: int = 0, VirtualSize: int = 0, SharedSize: int = 0, Labels: dict[str, str] = {}, Containers: int = 0)[源代码]
基类:
BaseModel
- Containers: int
- Created: int
- Id: str
- Labels: dict[str, str]
- ParentId: str
- RepoDigests: List[str]
- RepoTags: List[str]
- Size: int
- VirtualSize: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mcsmapi.models.image.DockerNetworkItem(*, Name: str = '', Id: str = '', Created: str = '', Scope: str = '', Driver: str = '', EnableIPv6: bool = False, Internal: bool = False, Attachable: bool = False, Ingress: bool = False, IPAM: DockerNetworkItemIPAM = DockerNetworkItemIPAM(Driver='', Config=[]), Options: dict[str, str], Containers: dict[str, dict] | None = {})[源代码]
基类:
BaseModel
- Attachable: bool
- Containers: dict[str, dict] | None
- Created: str
- Driver: str
- EnableIPv6: bool
- IPAM: DockerNetworkItemIPAM
- Id: str
- Ingress: bool
- Internal: bool
- Name: str
- Options: dict[str, str]
- Scope: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mcsmapi.models.image.DockerNetworkItemIPAM(*, Driver: str = '', Config: List[DockerNetworkItemIPAMConfig] = [])[源代码]
基类:
BaseModel
- Config: List[DockerNetworkItemIPAMConfig]
- Driver: str
- model_config: ClassVar[ConfigDict] = {'append': <built-in method append of list object>, 'clear': <built-in method clear of list object>, 'copy': <built-in method copy of list object>, 'count': <built-in method count of list object>, 'extend': <built-in method extend of list object>, 'index': <built-in method index of list object>, 'insert': <built-in method insert of list object>, 'pop': <built-in method pop of list object>, 'remove': <built-in method remove of list object>, 'reverse': <built-in method reverse of list object>, 'sort': <built-in method sort of list object>}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
mcsmapi.models.instance module
- class mcsmapi.models.instance.EventTask(*, autoStart: bool = False, autoRestart: bool = True, ignore: bool = False)[源代码]
基类:
BaseModel
- autoRestart: bool
- autoStart: bool
- ignore: bool
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mcsmapi.models.instance.InstanceConfig(*, nickname: str = 'New Name', startCommand: str = 'cmd.exe', stopCommand: str = '^C', cwd: str = '', ie: str = 'gbk', oe: str = 'gbk', createDatetime: int = 0, lastDatetime: int = 0, type: str = 'universal', tag: List[str] = [], endTime: int = 0, fileCode: str = 'gbk', processType: str = 'docker', updateCommand: str = 'shutdown -s', actionCommandList: List[str] = [], crlf: int = 2, docker: DockerConfig = DockerConfig(containerName='', image='mcsm-ubuntu:22.04', memory=1024, ports=['25565:25565/tcp'], extraVolumes=[], maxSpace=None, network=None, io=None, networkMode='bridge', networkAliases=[], cpusetCpus='', cpuUsage=100, workingDir='', env=[]), enableRcon: bool = True, rconPassword: str = '', rconPort: int = 2557, rconIp: str = '', terminalOption: TerminalOption = TerminalOption(haveColor=False, pty=True), eventTask: EventTask = EventTask(autoStart=False, autoRestart=True, ignore=False), pingConfig: PingConfig = PingConfig(ip='', port=25565, type=1))[源代码]
基类:
BaseModel
- actionCommandList: List[str]
- createDatetime: int
- crlf: int
- cwd: str
- docker: DockerConfig
- enableRcon: bool
- endTime: int
- fileCode: str
- ie: str
- lastDatetime: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- nickname: str
- oe: str
- pingConfig: PingConfig
- processType: str
- rconIp: str
- rconPassword: str
- rconPort: int
- startCommand: str
- stopCommand: str
- tag: List[str]
- terminalOption: TerminalOption
- type: str
- updateCommand: str
- class mcsmapi.models.instance.InstanceCreateResult(*, instanceUuid: str = '', config: InstanceConfig = InstanceConfig(nickname='New Name', startCommand='cmd.exe', stopCommand='^C', cwd='', ie='gbk', oe='gbk', createDatetime=0, lastDatetime=0, type='universal', tag=[], endTime=0, fileCode='gbk', processType='docker', updateCommand='shutdown -s', actionCommandList=[], crlf=2, docker=DockerConfig(containerName='', image='mcsm-ubuntu:22.04', memory=1024, ports=['25565:25565/tcp'], extraVolumes=[], maxSpace=None, network=None, io=None, networkMode='bridge', networkAliases=[], cpusetCpus='', cpuUsage=100, workingDir='', env=[]), enableRcon=True, rconPassword='', rconPort=2557, rconIp='', terminalOption=TerminalOption(haveColor=False, pty=True), eventTask=EventTask(autoStart=False, autoRestart=True, ignore=False), pingConfig=PingConfig(ip='', port=25565, type=1)))[源代码]
基类:
BaseModel
- config: InstanceConfig
- instanceUuid: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mcsmapi.models.instance.InstanceDetail(*, config: InstanceConfig = InstanceConfig(nickname='New Name', startCommand='cmd.exe', stopCommand='^C', cwd='', ie='gbk', oe='gbk', createDatetime=0, lastDatetime=0, type='universal', tag=[], endTime=0, fileCode='gbk', processType='docker', updateCommand='shutdown -s', actionCommandList=[], crlf=2, docker=DockerConfig(containerName='', image='mcsm-ubuntu:22.04', memory=1024, ports=['25565:25565/tcp'], extraVolumes=[], maxSpace=None, network=None, io=None, networkMode='bridge', networkAliases=[], cpusetCpus='', cpuUsage=100, workingDir='', env=[]), enableRcon=True, rconPassword='', rconPort=2557, rconIp='', terminalOption=TerminalOption(haveColor=False, pty=True), eventTask=EventTask(autoStart=False, autoRestart=True, ignore=False), pingConfig=PingConfig(ip='', port=25565, type=1)), info: InstanceInfo = InstanceInfo(currentPlayers=-1, fileLock=0, maxPlayers=-1, openFrpStatus=False, playersChart=[], version=''), daemonId: str = '', instanceUuid: str = '', processInfo: ProcessInfo = ProcessInfo(cpu=0, memory=0, ppid=0, pid=0, ctime=0, elapsed=0, timestamp=0), space: int = 0, started: int = 0, status: int = 0)[源代码]
基类:
BaseModel
- config: InstanceConfig
- daemonId: str
- info: InstanceInfo
- instanceUuid: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- processInfo: ProcessInfo
- reinstall(targetUrl: str, title: str = '', description: str = '') bool [源代码]
重装实例。
参数: - targetUrl (str): 重装文件的目标URL。 - title (str): 重装文件的标题。 - description (str, optional): 重装文件的描述,默认为空字符串。
返回: - bool: 返回操作结果,成功时返回True
- space: int
- start() str | bool [源代码]
启动该实例。
返回: - str|bool: str|bool: 返回结果中的 "instanceUuid" 字段值,如果未找到该字段,则默认返回True。
- started: int
- status: int
- class mcsmapi.models.instance.InstanceInfo(*, currentPlayers: int = -1, fileLock: int = 0, maxPlayers: int = -1, openFrpStatus: bool = False, playersChart: List[Dict] = [], version: str = '')[源代码]
基类:
BaseModel
- currentPlayers: int
- fileLock: int
- maxPlayers: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- openFrpStatus: bool
- playersChart: List[Dict]
- version: str
- class mcsmapi.models.instance.InstanceSearchList(*, pageSize: int = 0, maxPage: int = 0, data: List[InstanceDetail] = [], daemonId: str = '')[源代码]
基类:
BaseModel
- daemonId: str
- data: List[InstanceDetail]
- maxPage: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- pageSize: int
- class mcsmapi.models.instance.PingConfig(*, ip: str = '', port: int = 25565, type: int = 1)[源代码]
基类:
BaseModel
- ip: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- port: int
- type: int
- class mcsmapi.models.instance.ProcessInfo(*, cpu: int = 0, memory: int = 0, ppid: int = 0, pid: int = 0, ctime: int = 0, elapsed: int = 0, timestamp: int = 0)[源代码]
基类:
BaseModel
- cpu: int
- ctime: int
- elapsed: int
- memory: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- pid: int
- ppid: int
- timestamp: int
mcsmapi.models.overview module
- class mcsmapi.models.overview.ChartInfo(*, system: List[Dict[str, float]] = [], request: List[Dict[str, int]] = [])[源代码]
基类:
BaseModel
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- request: List[Dict[str, int]]
- system: List[Dict[str, float]]
- class mcsmapi.models.overview.OverviewModel(*, version: str = '', specifiedDaemonVersion: str = '', system: SystemInfo = SystemInfo(user=SystemUser(uid=0, gid=0, username='', homedir='', shell=None), time=0, totalmem=0, freemem=0, type='', version='', node='', hostname='', loadavg=[], platform='', release='', uptime=0, cpu=0), record: RecordInfo = RecordInfo(logined=0, illegalAccess=0, banips=0, loginFailed=0), process: ProcessInfo = ProcessInfo(cpu=0, memory=0, cwd=''), chart: ChartInfo = ChartInfo(system=[], request=[]), remoteCount: RemoteCountInfo = RemoteCountInfo(total=0, available=0), remote: List[DaemonModel] = [])[源代码]
基类:
BaseModel
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- process: ProcessInfo
- record: RecordInfo
- remote: List[DaemonModel]
- remoteCount: RemoteCountInfo
- specifiedDaemonVersion: str
- system: SystemInfo
- version: str
- class mcsmapi.models.overview.ProcessInfo(*, cpu: int = 0, memory: int = 0, cwd: str = '')[源代码]
基类:
BaseModel
- cpu: int
- cwd: str
- memory: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mcsmapi.models.overview.RecordInfo(*, logined: int = 0, illegalAccess: int = 0, banips: int = 0, loginFailed: int = 0)[源代码]
基类:
BaseModel
- banips: int
- illegalAccess: int
- loginFailed: int
- logined: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class mcsmapi.models.overview.RemoteCountInfo(*, total: int = 0, available: int = 0)[源代码]
基类:
BaseModel
- available: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- total: int
- class mcsmapi.models.overview.SystemInfo(*, user: SystemUser = SystemUser(uid=0, gid=0, username='', homedir='', shell=None), time: int = 0, totalmem: int = 0, freemem: int = 0, type: str = '', version: str = '', node: str = '', hostname: str = '', loadavg: List[float] = [], platform: str = '', release: str = '', uptime: int = 0, cpu: float = 0)[源代码]
基类:
BaseModel
- cpu: float
- freemem: int
- hostname: str
- loadavg: List[float]
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- node: str
- platform: str
- release: str
- time: int
- totalmem: int
- type: str
- uptime: int
- user: SystemUser
- version: str
- class mcsmapi.models.overview.SystemUser(*, uid: int = 0, gid: int = 0, username: str = '', homedir: str = '', shell: str | None = None)[源代码]
基类:
BaseModel
- gid: int
- homedir: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- shell: str | None
- uid: int
- username: str
mcsmapi.models.user module
- class mcsmapi.models.user.SearchUserModel(*, total: int = 0, page: int = 0, page_size: int = 0, max_page: int = 0, data: List[UserModel] = [])[源代码]
基类:
BaseModel
- max_page: int
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- page: int
- page_size: int
- total: int
- class mcsmapi.models.user.UserConfig(*, uuid: str, userName: str, loginTime: str, registerTime: str, instances: List[InstanceDetail], permission: int, apiKey: str, isInit: bool, secret: str, open2FA: bool)[源代码]
基类:
BaseModel
- apiKey: str
- instances: List[InstanceDetail]
- isInit: bool
- loginTime: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- open2FA: bool
- permission: int
- registerTime: str
- secret: str
- userName: str
- uuid: str
- class mcsmapi.models.user.UserModel(*, uuid: str = '', userName: str = '', passWord: str = '', passWordType: int = 0, salt: str = '', permission: int = 1, registerTime: str = '', loginTime: str = '', apiKey: str = '', isInit: bool = False, secret: str = '', open2FA: bool = False, instances: List[UserInstancesList] = [])[源代码]
基类:
BaseModel
- apiKey: str
- instances: List[UserInstancesList]
- isInit: bool
- loginTime: str
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- open2FA: bool
- passWord: str
- passWordType: int
- permission: int
- registerTime: str
- salt: str
- secret: str
- update(config: dict[str, Any]) bool [源代码]
更新该用户的信息。
参数: - config (dict[str, Any]): 用户的新信息,以字典形式提供,缺失内容使用原用户信息填充。
返回: - bool: 更新成功后返回True。
- userName: str
- uuid: str