OLD | NEW |
(Empty) | |
| 1 # Copyright 2011 Google Inc. All Rights Reserved. |
| 2 # |
| 3 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 # you may not use this file except in compliance with the License. |
| 5 # You may obtain a copy of the License at |
| 6 # |
| 7 # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 # |
| 9 # Unless required by applicable law or agreed to in writing, software |
| 10 # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 # See the License for the specific language governing permissions and |
| 13 # limitations under the License. |
| 14 |
| 15 from gslib.command import Command |
| 16 from gslib.command import COMMAND_NAME |
| 17 from gslib.command import COMMAND_NAME_ALIASES |
| 18 from gslib.command import CONFIG_REQUIRED |
| 19 from gslib.command import FILE_URIS_OK |
| 20 from gslib.command import MAX_ARGS |
| 21 from gslib.command import MIN_ARGS |
| 22 from gslib.command import PROVIDER_URIS_OK |
| 23 from gslib.command import SUPPORTED_SUB_ARGS |
| 24 from gslib.command import URIS_START_ARG |
| 25 from gslib.help_provider import HELP_NAME |
| 26 from gslib.help_provider import HELP_NAME_ALIASES |
| 27 from gslib.help_provider import HELP_ONE_LINE_SUMMARY |
| 28 from gslib.help_provider import HELP_TEXT |
| 29 from gslib.help_provider import HelpType |
| 30 from gslib.help_provider import HELP_TYPE |
| 31 |
| 32 _detailed_help_text = (""" |
| 33 <B>SYNOPSIS</B> |
| 34 gsutil getacl uri |
| 35 |
| 36 <B>DESCRIPTION</B> |
| 37 Gets ACL XML for a bucket or object, which you can save and edit for the |
| 38 setacl command. |
| 39 """) |
| 40 |
| 41 |
| 42 class GetAclCommand(Command): |
| 43 """Implementation of gsutil getacl command.""" |
| 44 |
| 45 # Command specification (processed by parent class). |
| 46 command_spec = { |
| 47 # Name of command. |
| 48 COMMAND_NAME : 'getacl', |
| 49 # List of command name aliases. |
| 50 COMMAND_NAME_ALIASES : [], |
| 51 # Min number of args required by this command. |
| 52 MIN_ARGS : 1, |
| 53 # Max number of args required by this command, or NO_MAX. |
| 54 MAX_ARGS : 1, |
| 55 # Getopt-style string specifying acceptable sub args. |
| 56 SUPPORTED_SUB_ARGS : 'v', |
| 57 # True if file URIs acceptable for this command. |
| 58 FILE_URIS_OK : False, |
| 59 # True if provider-only URIs acceptable for this command. |
| 60 PROVIDER_URIS_OK : False, |
| 61 # Index in args of first URI arg. |
| 62 URIS_START_ARG : 0, |
| 63 # True if must configure gsutil before running command. |
| 64 CONFIG_REQUIRED : True, |
| 65 } |
| 66 help_spec = { |
| 67 # Name of command or auxiliary help info for which this help applies. |
| 68 HELP_NAME : 'getacl', |
| 69 # List of help name aliases. |
| 70 HELP_NAME_ALIASES : [], |
| 71 # Type of help: |
| 72 HELP_TYPE : HelpType.COMMAND_HELP, |
| 73 # One line summary of this help. |
| 74 HELP_ONE_LINE_SUMMARY : 'Get ACL XML for a bucket or object', |
| 75 # The full help text. |
| 76 HELP_TEXT : _detailed_help_text, |
| 77 } |
| 78 |
| 79 # Command entry point. |
| 80 def RunCommand(self): |
| 81 self.GetAclCommandHelper() |
| 82 return 0 |
OLD | NEW |