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

        :param ResourceCommandContext context: ResourceCommandContext object with all Resource Attributes inside
        :param mode: mode
        :param custom_params: json with custom save parameters
        :return str response: response json
        """

        if not mode:
            mode = 'shallow'

        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 save started, request is: {}'.format(custom_params))
        response = configuration_operations.orchestration_save(
            mode=mode, custom_params=custom_params)
        logger.info(
            'Orchestration save completed, response is: {}'.format(response))
        return response
Пример #2
0
    def orchestration_save(self, context, mode, custom_params):
        """

        :param ResourceCommandContext context: ResourceCommandContext object with all Resource Attributes inside
        :param mode: mode
        :param custom_params: json with custom save parameters
        :return str response: response json
        """

        if not mode:
            mode = 'shallow'

        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 save started')
        response = configuration_operations.orchestration_save(
            mode=mode, custom_params=custom_params)
        logger.info('Orchestration save completed')
        return response