Пример #1
0
    def orchestration_restore(self, context, saved_artifact_info,
                              custom_params):
        """

        :param ResourceCommandContext context: ResourceCommandContext object with all Resource Attributes inside
        :param saved_artifact_info: OrchestrationSavedArtifactInfo json
        :param custom_params: json with custom restore parameters
        """

        logger = get_logger_with_thread_id(context)
        api = get_api(context)

        resource_config = create_networking_resource_from_context(
            shell_name=self.SHELL_NAME,
            supported_os=self.SUPPORTED_OS,
            context=context)

        cli_handler = CliHandler(self._cli, resource_config, logger, api)
        configuration_operations = ConfigurationRunner(
            cli_handler=cli_handler,
            logger=logger,
            resource_config=resource_config,
            api=api)

        logger.info('Orchestration restore started')
        configuration_operations.orchestration_restore(
            saved_artifact_info=saved_artifact_info,
            custom_params=custom_params)
        logger.info('Orchestration restore completed')
Пример #2
0
    def orchestration_restore(self, context, saved_artifact_info,
                              custom_params):
        """

        :param ResourceCommandContext context: ResourceCommandContext object with all Resource Attributes inside
        :param saved_artifact_info: OrchestrationSavedArtifactInfo json
        :param custom_params: json with custom restore parameters
        """

        logger = get_logger_with_thread_id(context)
        api = get_api(context)

        configuration_operations = ConfigurationRunner(logger=logger,
                                                       api=api,
                                                       cli=self._cli,
                                                       context=context)
        logger.info('Orchestration restore started, request is: {}'.format(
            saved_artifact_info))
        configuration_operations.orchestration_restore(
            saved_artifact_info=saved_artifact_info,
            custom_params=custom_params)
        logger.info('Orchestration restore completed')