Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aws
GitHub Repository: aws/aws-cli
Path: blob/develop/awscli/customizations/emr/terminateclusters.py
1567 views
1
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
#
3
# Licensed under the Apache License, Version 2.0 (the "License"). You
4
# may not use this file except in compliance with the License. A copy of
5
# the License is located at
6
#
7
# http://aws.amazon.com/apache2.0/
8
#
9
# or in the "license" file accompanying this file. This file is
10
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
# ANY KIND, either express or implied. See the License for the specific
12
# language governing permissions and limitations under the License.
13
14
15
from awscli.customizations.emr import emrutils
16
from awscli.customizations.emr import helptext
17
from awscli.customizations.emr.command import Command
18
19
20
class TerminateClusters(Command):
21
NAME = 'terminate-clusters'
22
DESCRIPTION = helptext.TERMINATE_CLUSTERS
23
ARG_TABLE = [{
24
'name': 'cluster-ids', 'nargs': '+', 'required': True,
25
'help_text': '<p>A list of clusters to terminate.</p>',
26
'schema': {'type': 'array', 'items': {'type': 'string'}},
27
}]
28
29
def _run_main_command(self, parsed_args, parsed_globals):
30
parameters = {'JobFlowIds': parsed_args.cluster_ids}
31
emrutils.call_and_display_response(self._session,
32
'TerminateJobFlows', parameters,
33
parsed_globals)
34
return 0
35
36