Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
aws
GitHub Repository: aws/aws-cli
Path: blob/develop/awscli/customizations/emr/emr.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
from awscli.customizations.emr import hbase
15
from awscli.customizations.emr import ssh
16
from awscli.customizations.emr.addsteps import AddSteps
17
from awscli.customizations.emr.createcluster import CreateCluster
18
from awscli.customizations.emr.addinstancegroups import AddInstanceGroups
19
from awscli.customizations.emr.createdefaultroles import CreateDefaultRoles
20
from awscli.customizations.emr.modifyclusterattributes import ModifyClusterAttr
21
from awscli.customizations.emr.installapplications import InstallApplications
22
from awscli.customizations.emr.describecluster import DescribeCluster
23
from awscli.customizations.emr.terminateclusters import TerminateClusters
24
from awscli.customizations.emr.addtags import modify_tags_argument
25
from awscli.customizations.emr.listclusters \
26
import modify_list_clusters_argument
27
from awscli.customizations.emr.command import override_args_required_option
28
29
30
def emr_initialize(cli):
31
"""
32
The entry point for EMR high level commands.
33
"""
34
cli.register('building-command-table.emr', register_commands)
35
cli.register('building-argument-table.emr.add-tags', modify_tags_argument)
36
cli.register(
37
'building-argument-table.emr.list-clusters',
38
modify_list_clusters_argument)
39
cli.register('before-building-argument-table-parser.emr.*',
40
override_args_required_option)
41
42
43
def register_commands(command_table, session, **kwargs):
44
"""
45
Called when the EMR command table is being built. Used to inject new
46
high level commands into the command list. These high level commands
47
must not collide with existing low-level API call names.
48
"""
49
command_table['terminate-clusters'] = TerminateClusters(session)
50
command_table['describe-cluster'] = DescribeCluster(session)
51
command_table['modify-cluster-attributes'] = ModifyClusterAttr(session)
52
command_table['install-applications'] = InstallApplications(session)
53
command_table['create-cluster'] = CreateCluster(session)
54
command_table['add-steps'] = AddSteps(session)
55
command_table['restore-from-hbase-backup'] = \
56
hbase.RestoreFromHBaseBackup(session)
57
command_table['create-hbase-backup'] = hbase.CreateHBaseBackup(session)
58
command_table['schedule-hbase-backup'] = hbase.ScheduleHBaseBackup(session)
59
command_table['disable-hbase-backups'] = \
60
hbase.DisableHBaseBackups(session)
61
command_table['create-default-roles'] = CreateDefaultRoles(session)
62
command_table['add-instance-groups'] = AddInstanceGroups(session)
63
command_table['ssh'] = ssh.SSH(session)
64
command_table['socks'] = ssh.Socks(session)
65
command_table['get'] = ssh.Get(session)
66
command_table['put'] = ssh.Put(session)
67
68