mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Add pyVmomi stubs (#3921)
This commit is contained in:
0
third_party/2and3/pyVmomi/__init__.pyi
vendored
Normal file
0
third_party/2and3/pyVmomi/__init__.pyi
vendored
Normal file
67
third_party/2and3/pyVmomi/vim/__init__.pyi
vendored
Normal file
67
third_party/2and3/pyVmomi/vim/__init__.pyi
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
from datetime import datetime
|
||||
from enum import Enum
|
||||
from typing import Any, List
|
||||
|
||||
from . import event
|
||||
from . import fault
|
||||
from . import view
|
||||
from ..vmodl.query import PropertyCollector
|
||||
from .event import EventManager
|
||||
from .option import OptionManager
|
||||
from .view import ViewManager
|
||||
|
||||
class ManagedObject: ...
|
||||
|
||||
class ManagedEntity(ManagedObject):
|
||||
_moId: str
|
||||
obj: None
|
||||
name: str
|
||||
|
||||
class ServiceInstanceContent:
|
||||
setting: OptionManager
|
||||
propertyCollector: PropertyCollector
|
||||
rootFolder: Folder
|
||||
viewManager: ViewManager
|
||||
perfManager: PerformanceManager
|
||||
eventManager: EventManager
|
||||
|
||||
class ServiceInstance:
|
||||
content: ServiceInstanceContent
|
||||
def CurrentTime(self) -> Any: ...
|
||||
|
||||
class PerformanceManager:
|
||||
class MetricId:
|
||||
def __init__(self, counterId: Any, instance: Any): ...
|
||||
|
||||
class PerfCounterInfo:
|
||||
key: int
|
||||
groupInfo: Any
|
||||
nameInfo: Any
|
||||
rollupType: Any
|
||||
class QuerySpec:
|
||||
entity: ManagedEntity
|
||||
metricId: List[PerformanceManager.MetricId]
|
||||
intervalId: int
|
||||
maxSample: int
|
||||
startTime: datetime
|
||||
|
||||
class EntityMetricBase:
|
||||
value: Any
|
||||
entity: ManagedEntity
|
||||
|
||||
def QueryPerfCounterByLevel(self, collection_level: int) -> List[PerformanceManager.PerfCounterInfo]: ...
|
||||
|
||||
def QueryPerf(self, querySpec: List[PerformanceManager.QuerySpec]) -> List[PerformanceManager.EntityMetricBase]: ...
|
||||
|
||||
class ClusterComputeResource(ManagedEntity): ...
|
||||
class ComputeResource(ManagedEntity): ...
|
||||
class Datacenter(ManagedEntity): ...
|
||||
class Datastore(ManagedEntity): ...
|
||||
class Folder(ManagedEntity): ...
|
||||
class HostSystem(ManagedEntity): ...
|
||||
class VirtualMachine(ManagedEntity): ...
|
||||
|
||||
class VirtualMachinePowerState(Enum):
|
||||
poweredOff: int
|
||||
poweredOn: int
|
||||
suspended: int
|
||||
14
third_party/2and3/pyVmomi/vim/event.pyi
vendored
Normal file
14
third_party/2and3/pyVmomi/vim/event.pyi
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
from datetime import datetime
|
||||
from typing import List
|
||||
|
||||
class Event:
|
||||
createdTime: datetime
|
||||
|
||||
class EventFilterSpec:
|
||||
class ByTime:
|
||||
def __init__(self, beginTime: datetime): ...
|
||||
time: EventFilterSpec.ByTime
|
||||
|
||||
class EventManager:
|
||||
latestEvent: Event
|
||||
def QueryEvents(self, filer: EventFilterSpec) -> List[Event]: ...
|
||||
2
third_party/2and3/pyVmomi/vim/fault.pyi
vendored
Normal file
2
third_party/2and3/pyVmomi/vim/fault.pyi
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
class InvalidName(Exception): ...
|
||||
class RestrictedByAdministrator(Exception): ...
|
||||
7
third_party/2and3/pyVmomi/vim/option.pyi
vendored
Normal file
7
third_party/2and3/pyVmomi/vim/option.pyi
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
from typing import Any, List
|
||||
|
||||
class OptionManager:
|
||||
def QueryOptions(self, name: str) -> List[OptionValue]: ...
|
||||
|
||||
class OptionValue:
|
||||
value: Any
|
||||
15
third_party/2and3/pyVmomi/vim/view.pyi
vendored
Normal file
15
third_party/2and3/pyVmomi/vim/view.pyi
vendored
Normal file
@@ -0,0 +1,15 @@
|
||||
from typing import List, Type
|
||||
|
||||
from pyVmomi.vim import ManagedEntity
|
||||
|
||||
class ContainerView:
|
||||
def Destroy(self) -> None: ...
|
||||
|
||||
class ViewManager:
|
||||
# Doc says the `type` parameter of CreateContainerView is a `List[str]`,
|
||||
# but in practice it seems to be `List[Type[ManagedEntity]]`
|
||||
# Source: https://pubs.vmware.com/vi-sdk/visdk250/ReferenceGuide/vim.view.ViewManager.html
|
||||
@staticmethod
|
||||
def CreateContainerView(
|
||||
container: ManagedEntity, type: List[Type[ManagedEntity]], recursive: bool
|
||||
) -> ContainerView: ...
|
||||
8
third_party/2and3/pyVmomi/vmodl/__init__.pyi
vendored
Normal file
8
third_party/2and3/pyVmomi/vmodl/__init__.pyi
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
from typing import Any
|
||||
|
||||
from . import fault
|
||||
from . import query
|
||||
|
||||
class DynamicProperty:
|
||||
name: str
|
||||
val: Any
|
||||
1
third_party/2and3/pyVmomi/vmodl/fault.pyi
vendored
Normal file
1
third_party/2and3/pyVmomi/vmodl/fault.pyi
vendored
Normal file
@@ -0,0 +1 @@
|
||||
class InvalidArgument(Exception): ...
|
||||
41
third_party/2and3/pyVmomi/vmodl/query.pyi
vendored
Normal file
41
third_party/2and3/pyVmomi/vmodl/query.pyi
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
from typing import Any, List, Optional, Type
|
||||
|
||||
from pyVmomi.vim import ManagedEntity
|
||||
from pyVmomi.vim.view import ContainerView
|
||||
from pyVmomi.vmodl import DynamicProperty
|
||||
|
||||
class PropertyCollector:
|
||||
class PropertySpec:
|
||||
type: Type[ManagedEntity]
|
||||
pathSet: List[str]
|
||||
|
||||
class TraversalSpec:
|
||||
path: str
|
||||
skip: bool
|
||||
type: Type[ContainerView]
|
||||
|
||||
class RetrieveOptions:
|
||||
maxObjects: int
|
||||
|
||||
class ObjectSpec:
|
||||
skip: bool
|
||||
selectSet: List[PropertyCollector.TraversalSpec]
|
||||
obj: Any
|
||||
|
||||
class FilterSpec:
|
||||
propSet: List[PropertyCollector.PropertySpec]
|
||||
objectSet: List[PropertyCollector.ObjectSpec]
|
||||
|
||||
class ObjectContent:
|
||||
obj: ManagedEntity
|
||||
propSet: List[DynamicProperty]
|
||||
|
||||
class RetrieveResult:
|
||||
objects: List[PropertyCollector.ObjectContent]
|
||||
token: Optional[str]
|
||||
|
||||
def RetrievePropertiesEx(
|
||||
self, specSet: List[PropertyCollector.FilterSpec], options: PropertyCollector.RetrieveOptions
|
||||
) -> PropertyCollector.RetrieveResult: ...
|
||||
|
||||
def ContinueRetrievePropertiesEx(self, token: str) -> PropertyCollector.RetrieveResult: ...
|
||||
Reference in New Issue
Block a user