ó
ôBQc @ sH d d l Z d d l Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m
Z
d d
l m Z d d l m Z d d l
m Z d d
l m Z d d l m Z d d l m Z d d l m Z d d l m Z d d l m Z d Z d e f d „ ƒ YZ d S( iÿÿÿÿN( t Command( t COMMAND_NAME( t COMMAND_NAME_ALIASES( t CONFIG_REQUIRED( t FILE_URIS_OK( t MAX_ARGS( t MIN_ARGS( t PROVIDER_URIS_OK( t SUPPORTED_SUB_ARGS( t URIS_START_ARG( t CommandException( t HELP_NAME( t HELP_NAME_ALIASES( t HELP_ONE_LINE_SUMMARY( t HELP_TEXT( t HelpType( t HELP_TYPEs
SYNOPSIS
gsutil getcors uri
DESCRIPTION
Gets the Cross-Origin Resource Sharing (CORS) configuration for a given
bucket. This command is supported for buckets only, not objects and you
can get the CORS settings for only one bucket at a time. The output from
getcors can be redirected into a file, edited and then updated via the
setcors sub-command. The CORS configuration is expressed by an XML document
with the following structure:
origin1.example.com
GET
Content-Type
For more info about CORS, see http://www.w3.org/TR/cors/.
t GetCorsCommandc B sˆ e Z d Z i d e 6g e 6d e 6d e 6d e 6e e 6e e
6d e 6e e
6Z i d e 6g e 6e j e 6d e 6e e 6Z d „ Z RS( s) Implementation of gsutil getcors command.t getcorsi t i s Get a bucket's CORS XML documentc C sı t | j | j d ƒ j ƒ ƒ } t | ƒ d k rC t d ƒ ‚ n t | ƒ d k rx t d | j d | j f ƒ ‚ n | d } | j ƒ s¤ t d | j ƒ ‚ n | j t | j
ƒ } t j j
j | j ƒ j d ƒ ƒ } t j j | j d d ƒ ƒ d S( Ni s No URIs matchedi sD %s matched more than one URI, which is not
allowed by the %s commands" "%s" command must specify a buckets utf-8t indents ( t listt WildcardIteratort argst IterUrist lenR
t command_namet names_buckett get_corst Falset headerst xmlt domt minidomt parseStringt to_xmlt encodet syst stdoutt writet toprettyxml( t selft urist urit corst
parsed_xml( ( s4 /tmp/tmp.yUYbTOKr8o/gsutil/gslib/commands/getcors.pyt
RunCommandi s "
$( t __name__t
__module__t __doc__R R R R R R R R R t TrueR t command_specR R R t COMMAND_HELPR R
t _detailed_help_textR t help_specR. ( ( ( s4 /tmp/tmp.yUYbTOKr8o/gsutil/gslib/commands/getcors.pyR C s$
( R% R t
gslib.commandR R R R R R R R R R t gslib.exceptionR
t gslib.help_providerR R R
R R R R5 R ( ( ( s4 /tmp/tmp.yUYbTOKr8o/gsutil/gslib/commands/getcors.pyt s(