2.1.2
This commit is contained in:
1 parent
ea196f03a0
commit
68064479d2
78 files changed
+1834
-31
No files matched your search
@@ -1,7 +1,19 @@
|
||||
import dynamix_sdk.base as _base
|
||||
from .add_ssh_identity import *
|
||||
from .apply_ipmi_action import CloudbrokerNodeApplyIpmiActionImpl
|
||||
from .autostart import CloudbrokerNodeAutostartImpl
|
||||
from .consumption import CloudbrokerNodeConsumptionImpl
|
||||
from .decommission import CloudbrokerNodeDecommissionImpl
|
||||
from .enable import CloudbrokerNodeEnableImpl
|
||||
from .enable_nodes import CloudbrokerNodeEnableNodesImpl
|
||||
from .get_network_info import CloudbrokerNodeGetNetworkInfoImpl
|
||||
from .get_ssh_identity import *
|
||||
from .install import CloudbrokerNodeInstallImpl
|
||||
from .list import *
|
||||
from .maintenance import CloudbrokerNodeMaintenanceImpl
|
||||
from .restrict import CloudbrokerNodeRestrictImpl
|
||||
from .set_huge_pages import CloudbrokerNodeSetHugePagesImpl
|
||||
from .update import CloudbrokerNodeUpdateImpl
|
||||
from .update_description import *
|
||||
|
||||
|
||||
@@ -9,6 +21,18 @@ class CloudbrokerNodeAPI(
|
||||
_base.BaseAPI,
|
||||
):
|
||||
add_ssh_identity: CloudbrokerNodeAddSshIdentityImpl
|
||||
apply_ipmi_action: CloudbrokerNodeApplyIpmiActionImpl
|
||||
autostart: CloudbrokerNodeAutostartImpl
|
||||
consumption: CloudbrokerNodeConsumptionImpl
|
||||
decommission: CloudbrokerNodeDecommissionImpl
|
||||
enable: CloudbrokerNodeEnableImpl
|
||||
enable_nodes: CloudbrokerNodeEnableNodesImpl
|
||||
get_network_info: CloudbrokerNodeGetNetworkInfoImpl
|
||||
get_ssh_identity: CloudbrokerNodeGetSshIdentityImpl
|
||||
install: CloudbrokerNodeInstallImpl
|
||||
list: CloudbrokerNodeListImpl
|
||||
maintenance: CloudbrokerNodeMaintenanceImpl
|
||||
restrict: CloudbrokerNodeRestrictImpl
|
||||
set_huge_pages: CloudbrokerNodeSetHugePagesImpl
|
||||
update: CloudbrokerNodeUpdateImpl
|
||||
update_description: CloudbrokerNodeUpdateDescriptionImpl
|
||||
@@ -0,0 +1,23 @@
|
||||
from enum import StrEnum
|
||||
|
||||
import dynamix_sdk.base as _base
|
||||
|
||||
|
||||
class Action(StrEnum):
|
||||
IS_POWERED = 'is_powered'
|
||||
POWER_ON = 'power_on'
|
||||
SHUTDOWN = 'shutdown'
|
||||
FORCE_SHUTDOWN = 'force_shutdown'
|
||||
REBOOT = 'reboot'
|
||||
|
||||
|
||||
class CloudbrokerNodeApplyIpmiActionImpl(_base.APIFunctionImpl):
|
||||
http_method = _base.HTTPMethod.POST
|
||||
|
||||
def __call__(
|
||||
self,
|
||||
*,
|
||||
nid: int,
|
||||
action: Action,
|
||||
) -> bool:
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,15 @@
|
||||
from pydantic import Field
|
||||
|
||||
import dynamix_sdk.base as _base
|
||||
|
||||
|
||||
class CloudbrokerNodeAutostartImpl(_base.APIFunctionImpl):
|
||||
http_method = _base.HTTPMethod.POST
|
||||
|
||||
def __call__(
|
||||
self,
|
||||
*,
|
||||
node_id: int = Field(serialization_alias='node_id'),
|
||||
autostart: bool,
|
||||
) -> bool:
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,43 @@
|
||||
from pydantic import Field
|
||||
|
||||
import dynamix_sdk.base as _base
|
||||
|
||||
|
||||
class Total(_base.ResultModel):
|
||||
ram: int = Field(validation_alias='RAM')
|
||||
v_cpus: int = Field(validation_alias='vCPUs')
|
||||
|
||||
|
||||
class Reserved(_base.ResultModel):
|
||||
ram: int = Field(validation_alias='RAM')
|
||||
|
||||
|
||||
class Consumed(_base.ResultModel):
|
||||
ram: int = Field(validation_alias='RAM')
|
||||
v_cpu: int = Field(validation_alias='vCPU')
|
||||
computes: int
|
||||
routers: int
|
||||
|
||||
|
||||
class Free(_base.ResultModel):
|
||||
ram: int = Field(validation_alias='RAM')
|
||||
v_cpus: int = Field(validation_alias='vCPUs')
|
||||
|
||||
|
||||
class CloudbrokerNodeConsumptionResult(_base.ResultModel):
|
||||
total: Total
|
||||
reserved: Reserved = Field(validation_alias='reserved')
|
||||
consumed: Consumed = Field(validation_alias='consumed')
|
||||
free: Free
|
||||
hostname: str
|
||||
|
||||
|
||||
class CloudbrokerNodeConsumptionImpl(_base.APIFunctionImpl):
|
||||
http_method = _base.HTTPMethod.POST
|
||||
|
||||
def __call__(
|
||||
self,
|
||||
*,
|
||||
nid: int,
|
||||
) -> CloudbrokerNodeConsumptionResult:
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,13 @@
|
||||
import dynamix_sdk.base as _base
|
||||
|
||||
|
||||
class CloudbrokerNodeDecommissionImpl(_base.APIFunctionImpl):
|
||||
http_method = _base.HTTPMethod.POST
|
||||
|
||||
def __call__(
|
||||
self,
|
||||
*,
|
||||
nid: int,
|
||||
force: bool = False,
|
||||
) -> bool:
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,15 @@
|
||||
import dynamix_sdk.base as _base
|
||||
|
||||
|
||||
class CloudbrokerNodeEnableImpl(_base.APIFunctionImpl):
|
||||
http_method = _base.HTTPMethod.POST
|
||||
|
||||
def __call__(
|
||||
self,
|
||||
*,
|
||||
nid: int,
|
||||
reason: str | None = None,
|
||||
force: bool = False,
|
||||
async_mode: bool = True,
|
||||
) -> bool | str:
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,13 @@
|
||||
import dynamix_sdk.base as _base
|
||||
|
||||
|
||||
class CloudbrokerNodeEnableNodesImpl(_base.APIFunctionImpl):
|
||||
http_method = _base.HTTPMethod.POST
|
||||
|
||||
def __call__(
|
||||
self,
|
||||
*,
|
||||
nids: list[int],
|
||||
reason: str | None = None,
|
||||
) -> str:
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,146 @@
|
||||
from pydantic import Field
|
||||
|
||||
import dynamix_sdk.base as _base
|
||||
from dynamix_sdk.utils import AutoNameEnum as _AutoNameEnum
|
||||
|
||||
|
||||
class SystemNetworksInfo(_base.ResultModel):
|
||||
mtu: int | None = None
|
||||
speed: int | None = None
|
||||
bridge_id: str | None = None
|
||||
bport_id: str | None = None
|
||||
mac: str | None = None
|
||||
|
||||
|
||||
class OvsNetworksInfoItem(_base.ResultModel):
|
||||
bridge_name: str | None = None
|
||||
bridge_tag: str | None = None
|
||||
interface_uuid: str | None = None
|
||||
interface_name: str | None = None
|
||||
interface_type: str | None = None
|
||||
interface_mtu: int | None = None
|
||||
interface_ip: str | None = None
|
||||
interface_mac: str | None = None
|
||||
interface_peer: str | None = None
|
||||
|
||||
|
||||
class LibvirtNetworksInfoItem(_base.ResultModel):
|
||||
vm_name: str | None = None
|
||||
interface: str | None = None
|
||||
interface_type: str | None = None
|
||||
interface_source: str | None = None
|
||||
|
||||
|
||||
class InterfaceType(str, _AutoNameEnum):
|
||||
PHYSICAL = 'physical'
|
||||
VIRTUAL = 'virtual'
|
||||
INTERNAL = 'internal'
|
||||
VXLAN = 'vxlan'
|
||||
PATCH = 'patch'
|
||||
BRIDGE = 'bridge'
|
||||
SYSTEM = 'system'
|
||||
|
||||
|
||||
class BridgeType(str, _AutoNameEnum):
|
||||
LINUX_BRIDGE = 'linux_bridge'
|
||||
OVS_BRIDGE = 'ovs_bridge'
|
||||
|
||||
|
||||
class Via(str, _AutoNameEnum):
|
||||
BPORT_ID = 'bport_id'
|
||||
OVS_PORT = 'ovs_port'
|
||||
|
||||
|
||||
class ConnectionType(str, _AutoNameEnum):
|
||||
DIRECT = 'direct'
|
||||
VIA_BRIDGE = 'via_bridge'
|
||||
|
||||
|
||||
class BridgeInfoType(str, _AutoNameEnum):
|
||||
OVS = 'ovs'
|
||||
|
||||
|
||||
class PortInfo(_base.ResultModel):
|
||||
name: str
|
||||
type: str
|
||||
mtu: int | None = None
|
||||
vlan: str | None = None
|
||||
uuid: str
|
||||
|
||||
|
||||
class BridgesItem(_base.ResultModel):
|
||||
name: str
|
||||
type: BridgeType
|
||||
via: Via
|
||||
bport_id: str | None = None
|
||||
port_info: PortInfo | None = None
|
||||
|
||||
|
||||
class VmsItem(_base.ResultModel):
|
||||
name: str
|
||||
vm_interface: str
|
||||
vm_interface_type: str
|
||||
connection_type: ConnectionType
|
||||
via_bridge: str | None = None
|
||||
|
||||
|
||||
class Connections(_base.ResultModel):
|
||||
vms: list[VmsItem] | None = None
|
||||
bridges: list[BridgesItem] | None = None
|
||||
|
||||
|
||||
class BridgeConnectionsItem(_base.ResultModel):
|
||||
name: str
|
||||
via: str
|
||||
vlan: str | None = None
|
||||
|
||||
|
||||
class PortsItem(_base.ResultModel):
|
||||
name: str
|
||||
type: str
|
||||
mtu: int | None = None
|
||||
vlan: str | None = None
|
||||
uuid: str
|
||||
ip: str | None = None
|
||||
mac: str | None = None
|
||||
|
||||
|
||||
class BridgeInfo(_base.ResultModel):
|
||||
type: BridgeInfoType
|
||||
ports: list[PortsItem] | None = None
|
||||
|
||||
|
||||
class Interfaces(_base.ResultModel):
|
||||
type: InterfaceType
|
||||
mtu: int | None = None
|
||||
speed: int | None = None
|
||||
connections: Connections | None = None
|
||||
vlans: list[str | None] | None = None
|
||||
connected_interfaces: list[str] | None = None
|
||||
bridge_connections: list[BridgeConnectionsItem] | None = None
|
||||
bridge_info: BridgeInfo | None = None
|
||||
bridge_id: str | None = None
|
||||
peer: str | None = None
|
||||
uuid: str | None = None
|
||||
|
||||
|
||||
class Topology(_base.ResultModel):
|
||||
interfaces: dict[str, Interfaces]
|
||||
|
||||
|
||||
class CloudbrokerNodeGetNetworkInfoResult(_base.ResultModel):
|
||||
system_networks_info: dict[str, SystemNetworksInfo]
|
||||
ovs_networks_info: list[OvsNetworksInfoItem]
|
||||
libvirt_networks_info: list[LibvirtNetworksInfoItem]
|
||||
topology: Topology
|
||||
|
||||
|
||||
class CloudbrokerNodeGetNetworkInfoImpl(_base.APIFunctionImpl):
|
||||
http_method = _base.HTTPMethod.GET
|
||||
|
||||
def __call__(
|
||||
self,
|
||||
*,
|
||||
node_id: int = Field(serialization_alias='node_id'),
|
||||
) -> CloudbrokerNodeGetNetworkInfoResult:
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,39 @@
|
||||
from enum import StrEnum
|
||||
|
||||
import dynamix_sdk.base as _base
|
||||
|
||||
|
||||
class OsVersion(StrEnum):
|
||||
VAL_18 = '18'
|
||||
VAL_22 = '22'
|
||||
VAL_24 = '24'
|
||||
ASTRA1_7 = 'astra1.7'
|
||||
ASTRA1_8 = 'astra1.8'
|
||||
ALT10SP = 'alt10sp'
|
||||
VCORE = 'vcore'
|
||||
|
||||
|
||||
class RolesItem(StrEnum):
|
||||
CPU_DES = 'cpu_des'
|
||||
|
||||
|
||||
class CloudbrokerNodeInstallImpl(_base.APIFunctionImpl):
|
||||
http_method = _base.HTTPMethod.POST
|
||||
|
||||
def __call__(
|
||||
self,
|
||||
*,
|
||||
name: str,
|
||||
roles: list[RolesItem],
|
||||
os_version: OsVersion,
|
||||
os_user_password: str,
|
||||
backplane_ip: str,
|
||||
management_ip: str,
|
||||
vxbackend_ip: str,
|
||||
gw_mgmt_ip: str,
|
||||
ipmi_address: str,
|
||||
ipmi_user: str,
|
||||
ipmi_password: str,
|
||||
os_user: str = 'root',
|
||||
) -> str:
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,23 @@
|
||||
from enum import StrEnum
|
||||
|
||||
import dynamix_sdk.base as _base
|
||||
|
||||
|
||||
class Vmaction(StrEnum):
|
||||
STOP = 'stop'
|
||||
MOVE = 'move'
|
||||
|
||||
|
||||
class CloudbrokerNodeMaintenanceImpl(_base.APIFunctionImpl):
|
||||
http_method = _base.HTTPMethod.POST
|
||||
|
||||
def __call__(
|
||||
self,
|
||||
*,
|
||||
nid: int,
|
||||
reason: str | None = None,
|
||||
vmaction: Vmaction = Vmaction.STOP,
|
||||
autostart: bool = False,
|
||||
offline: bool = False,
|
||||
) -> bool:
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,13 @@
|
||||
import dynamix_sdk.base as _base
|
||||
|
||||
|
||||
class CloudbrokerNodeRestrictImpl(_base.APIFunctionImpl):
|
||||
http_method = _base.HTTPMethod.POST
|
||||
|
||||
def __call__(
|
||||
self,
|
||||
*,
|
||||
nid: int,
|
||||
migrate: bool = False,
|
||||
) -> bool:
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,16 @@
|
||||
from pydantic import Field
|
||||
|
||||
import dynamix_sdk.base as _base
|
||||
|
||||
|
||||
class CloudbrokerNodeSetHugePagesImpl(_base.APIFunctionImpl):
|
||||
http_method = _base.HTTPMethod.POST
|
||||
|
||||
def __call__(
|
||||
self,
|
||||
*,
|
||||
nid: int,
|
||||
hugepages2_m: int = Field(serialization_alias='hugepages2M'),
|
||||
hugepages1_g: int = Field(serialization_alias='hugepages1G'),
|
||||
) -> bool:
|
||||
raise NotImplementedError
|
||||
@@ -0,0 +1,12 @@
|
||||
import dynamix_sdk.base as _base
|
||||
|
||||
|
||||
class CloudbrokerNodeUpdateImpl(_base.APIFunctionImpl):
|
||||
http_method = _base.HTTPMethod.POST
|
||||
|
||||
def __call__(
|
||||
self,
|
||||
*,
|
||||
nid: int,
|
||||
) -> bool:
|
||||
raise NotImplementedError
|
||||
Reference in new issue
Block a user