ajout de la config xml et la gestion de l'état de la VM.
This commit is contained in:
parent
9d7c516245
commit
a88e7672f8
|
@ -0,0 +1,5 @@
|
|||
from . import cluster as cluster_schema
|
||||
from . import datacenter as datacenter_schema
|
||||
from . import network as network_schema
|
||||
from . import storage as storage_schema
|
||||
from . import vm as vm_schema
|
|
@ -1,9 +1,11 @@
|
|||
from enum import Enum
|
||||
from typing import List, Optional
|
||||
from uuid import uuid4
|
||||
from pydantic import UUID4, Field, ConfigDict
|
||||
from pydantic import BaseModel as _BaseModel
|
||||
|
||||
from ..libvirt.dom import config as configDom
|
||||
from deevirt_schema.libvirt.dom.events import LifeCycle
|
||||
|
||||
class BaseModel(_BaseModel):
|
||||
class Config:
|
||||
|
@ -193,6 +195,18 @@ class VMGetDevices(Devices):
|
|||
interfaces:Optional[List[VMGetDevicesInterface]] = Field(default=None, description="Interfaces réseau")
|
||||
|
||||
class VMGet(VM):
|
||||
class StateEnum(Enum):
|
||||
NOSTATE = 0
|
||||
RUNNING = 1
|
||||
BLOCKED = 2
|
||||
PAUSED = 3
|
||||
SHUTDOWN = 4
|
||||
SHUTOFF = 5
|
||||
CRASHED = 6
|
||||
PMSUSPENDED = 7
|
||||
LAST = 8
|
||||
|
||||
state:StateEnum = Field(default=None)
|
||||
vcpu:VMGetVCPU = Field()
|
||||
gen_id:Optional[UUID4] = Field(default=None)
|
||||
os:VMGetOS = Field(default=VMGetOS(), description="Options VM: Options de démarrage.")
|
||||
|
|
|
@ -3,6 +3,13 @@ from typing import List, Optional
|
|||
from uuid import UUID
|
||||
from pydantic import UUID4, BaseModel, Field
|
||||
|
||||
class HostAlive(BaseModel):
|
||||
class Status(Enum):
|
||||
UP = 1
|
||||
DOWN = 2
|
||||
|
||||
status:Status = Field(default=Status.DOWN)
|
||||
|
||||
class LifeCycle(BaseModel):
|
||||
|
||||
class EventType(Enum):
|
||||
|
@ -71,6 +78,7 @@ class LifeCycle(BaseModel):
|
|||
datacenter_id:UUID4 = Field()
|
||||
vm_id:UUID = Field()
|
||||
action:EventType = Field()
|
||||
config:Optional[str] = Field()
|
||||
|
||||
class GraphicsAddr(BaseModel):
|
||||
family:int = Field()
|
||||
|
|
Loading…
Reference in New Issue