Пример #1
0
    def _validate_unsupported_commands_for_release_based_clusters(
            self, parsed_args, parsed_globals):
        command = self.NAME

        if (command in self.UNSUPPORTED_COMMANDS_FOR_RELEASE_BASED_CLUSTERS
                and hasattr(parsed_args, 'cluster_id')):
            release_label = emrutils.get_release_label(
                parsed_args.cluster_id, self._session, self.region,
                parsed_globals.endpoint_url, parsed_globals.verify_ssl)
            if release_label:
                raise exceptions.UnsupportedCommandWithReleaseError(
                    command=command,
                    release_label=release_label)
    def _run_main_command(self, parsed_args, parsed_globals):
        parsed_steps = parsed_args.steps

        release_label = emrutils.get_release_label(parsed_args.cluster_id,
                                                   self._session, self.region,
                                                   parsed_globals.endpoint_url,
                                                   parsed_globals.verify_ssl)

        step_list = steputils.build_step_config_list(
            parsed_step_list=parsed_steps,
            region=self.region,
            release_label=release_label)
        parameters = {'JobFlowId': parsed_args.cluster_id, 'Steps': step_list}

        emrutils.call_and_display_response(self._session, 'AddJobFlowSteps',
                                           parameters, parsed_globals)
        return 0
Пример #3
0
    def _run_main_command(self, parsed_args, parsed_globals):
        parsed_steps = parsed_args.steps

        release_label = emrutils.get_release_label(
            parsed_args.cluster_id, self._session, self.region,
            parsed_globals.endpoint_url, parsed_globals.verify_ssl)

        step_list = steputils.build_step_config_list(
            parsed_step_list=parsed_steps, region=self.region,
            release_label=release_label)
        parameters = {
            'JobFlowId': parsed_args.cluster_id,
            'Steps': step_list
        }

        emrutils.call_and_display_response(self._session, 'AddJobFlowSteps',
                                           parameters, parsed_globals)
        return 0