FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
aws-cli/awscli/customizations/s3/s3.py at develop · ProGamerCode/aws-cli · GitHub
ProGamerCode
/
aws-cli
Public
forked from
aws/aws-cli
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
aws-cli
/
awscli
/
customizations
/
s3
/
s3.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
69 lines (60 loc) · 2.68 KB
Breadcrumbs
aws-cli
/
awscli
/
customizations
/
s3
/
s3.py
Copy path
File metadata and controls
69 lines (60 loc) · 2.68 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Copyright 2014 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompanying this file. This file is
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from
awscli
.
customizations
import
utils
from
awscli
.
customizations
.
commands
import
BasicCommand
from
awscli
.
customizations
.
s3
.
subcommands
import
ListCommand
,
WebsiteCommand
, \
CpCommand
,
MvCommand
,
RmCommand
,
SyncCommand
,
MbCommand
,
RbCommand
, \
PresignCommand
from
awscli
.
customizations
.
s3
.
syncstrategy
.
register
import
\
register_sync_strategies
def
awscli_initialize
(
cli
):
"""
This function is require to use the plugin. It calls the functions
required to add all neccessary commands and parameters to the CLI.
This function is necessary to install the plugin using a configuration
file
"""
cli
.
register
(
"building-command-table.main"
,
add_s3
)
cli
.
register
(
'building-command-table.sync'
,
register_sync_strategies
)
def
s3_plugin_initialize
(
event_handlers
):
"""
This is a wrapper to make the plugin built-in to the cli as opposed
to specifiying it in the configuration file.
"""
awscli_initialize
(
event_handlers
)
def
add_s3
(
command_table
,
session
,
**
kwargs
):
"""
This creates a new service object for the s3 plugin. It sends the
old s3 commands to the namespace ``s3api``.
"""
utils
.
rename_command
(
command_table
,
's3'
,
's3api'
)
command_table
[
's3'
]
=
S3
(
session
)
class
S3
(
BasicCommand
):
NAME
=
's3'
DESCRIPTION
=
BasicCommand
.
FROM_FILE
(
's3/_concepts.rst'
)
SYNOPSIS
=
"aws s3 <Command> [<Arg> ...]"
SUBCOMMANDS
=
[
{
'name'
:
'ls'
,
'command_class'
:
ListCommand
},
{
'name'
:
'website'
,
'command_class'
:
WebsiteCommand
},
{
'name'
:
'cp'
,
'command_class'
:
CpCommand
},
{
'name'
:
'mv'
,
'command_class'
:
MvCommand
},
{
'name'
:
'rm'
,
'command_class'
:
RmCommand
},
{
'name'
:
'sync'
,
'command_class'
:
SyncCommand
},
{
'name'
:
'mb'
,
'command_class'
:
MbCommand
},
{
'name'
:
'rb'
,
'command_class'
:
RbCommand
},
{
'name'
:
'presign'
,
'command_class'
:
PresignCommand
},
]
def
_run_main
(
self
,
parsed_args
,
parsed_globals
):
if
parsed_args
.
subcommand
is
None
:
raise
ValueError
(
"usage: aws [options] <command> <subcommand> "
"[parameters]
\n
aws: error: too few arguments"
)
Back
|
FazBrowse Home
|
New Git URL