2020-10-02 06:37:50 +00:00
|
|
|
#
|
|
|
|
# Copyright (C) 2020 GNS3 Technologies Inc.
|
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
|
2021-04-15 08:42:08 +00:00
|
|
|
from . import Category, TemplateBase
|
|
|
|
from gns3server.schemas.compute.cloud_nodes import (
|
|
|
|
EthernetPort,
|
|
|
|
TAPPort,
|
|
|
|
UDPPort,
|
|
|
|
CloudConsoleType
|
|
|
|
)
|
2020-10-02 06:37:50 +00:00
|
|
|
|
|
|
|
from pydantic import Field
|
|
|
|
from typing import Optional, Union, List
|
|
|
|
|
|
|
|
|
2020-10-31 04:37:12 +00:00
|
|
|
class CloudTemplate(TemplateBase):
|
2020-10-02 06:37:50 +00:00
|
|
|
|
|
|
|
category: Optional[Category] = "guest"
|
|
|
|
default_name_format: Optional[str] = "Cloud{0}"
|
|
|
|
symbol: Optional[str] = ":/symbols/cloud.svg"
|
2021-04-02 07:15:16 +00:00
|
|
|
ports_mapping: List[Union[EthernetPort, TAPPort, UDPPort]] = Field(default_factory=list)
|
2020-10-02 06:37:50 +00:00
|
|
|
remote_console_host: Optional[str] = Field("127.0.0.1", description="Remote console host or IP")
|
|
|
|
remote_console_port: Optional[int] = Field(23, gt=0, le=65535, description="Remote console TCP port")
|
2020-10-31 04:37:12 +00:00
|
|
|
remote_console_type: Optional[CloudConsoleType] = Field("none", description="Remote console type")
|
|
|
|
remote_console_http_path: Optional[str] = Field("/", description="Path of the remote web interface")
|
2021-10-23 05:53:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
class CloudTemplateUpdate(CloudTemplate):
|
|
|
|
|
|
|
|
pass
|