Beispiel #1
0
    def stop_server(self, server_id):
        """Stop the Baremetal Server associated with server_id.
        This request will be accepted only when the task_state is None.

        :param string server_id: ID for the server.
        :return: ``None``
        """
        server = _server.ServerAction()
        return server.stop(self.session, server_id)
Beispiel #2
0
    def media_detach(self, server_id, image):
        """Detach media from the Baremetal Server associated with server_id.
        This request will be accepted only when the task_state is None.

        :param string server_id: ID for the server.
        :param string image: ID of the image you want to detach.
        :return: ``None``
        """
        server = _server.ServerAction()
        return server.media_detach(self.session, server_id, image)
Beispiel #3
0
    def start_server(self, server_id, boot_mode):
        """Power on the Baremetal Server associated with server_id.
        This request will be accepted only when the task_state is None.

        :param string server_id: ID for the server.
        :param string boot_mode: Baremetal Server boot mode.
            A valid value is DISK, PXE, LEGACY or ISO.
        :return: ``None``
        """
        server = _server.ServerAction()
        return server.start(self.session, server_id, boot_mode)
Beispiel #4
0
    def stop_server(self, server_id, shutdown_type=None):
        """Stop the Baremetal Server associated with server_id.
        This request will be accepted only when the task_state is None.

        :param string server_id: ID for the server.
        :param string shutdown_type: Baremetal Server shutdown mode.
            A valid value is HARD or SOFT.
        :return: ``None``
        """
        server = _server.ServerAction()
        return server.stop(self.session, server_id, shutdown_type)
Beispiel #5
0
    def get_management_console(self, server_id):
        """Gets information to access the remote console of Baremetal
        Server. This request will be accepted only when the task_state
        is None.
        This API response console parameters are used at Remote Console
        Access - Get Started. To access your Baremetal Server, you have
        to create VPN user and connect to VPN.

        :param string server_id: ID for the server.
        :return: :class:`~ecl.baremetal.v2.server.ServerAction`
        """
        server = _server.ServerAction()
        return server.get_management_console(self.session, server_id)
Beispiel #6
0
    def reboot_server(self, server_id, shutdown_type):
        """Reboot the Baremetal Server associated with server_id.
        This request will be accepted only when the task_state is None.

        :param string server_id: ID for the server.
        :param string shutdown_type: Baremetal Server shutdown mode.
            A valid value is HARD or SOFT. HARD is force restart by IPMI.
            This operations is equal to power down.
            SOFT is restated by ACPI.
        :return: ``None``
        """
        server = _server.ServerAction()
        return server.reboot(self.session, server_id, shutdown_type)
Beispiel #7
0
    def change_boot_mode(self, server_id, shutdown_type, boot_mode):
        """Change the Baremetal Server boot mode.
        This request will be accepted only when the task_state is None.

        :param string server_id: ID for the server.
        :param string shutdown_type: Baremetal Server shutdown mode.
            A valid value is HARD or SOFT. HARD is force restart by IPMI.
            This operations is equal to power down.
            SOFT is restated by ACPI.
        :param string boot_mode: Baremetal Server boot mode.
            A valid value is DISK, PXE, LEGACY or ISO.
        :return: ``None``
        """
        server = _server.ServerAction()
        return server.change_boot_mode(self.session, server_id, shutdown_type,
                                       boot_mode)