OXIESEC PANEL
- Current Dir:
/
/
opt
/
gsutil
/
gslib
/
commands
/
__pycache__
Server IP: 2a02:4780:11:1594:0:ef5:22d7:a
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/11/2025 08:19:49 AM
rwxr-xr-x
📄
__init__.cpython-39.pyc
323 bytes
02/11/2025 08:19:49 AM
rw-r--r--
📄
acl.cpython-39.pyc
18.76 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
autoclass.cpython-39.pyc
6.01 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
bucketpolicyonly.cpython-39.pyc
6.75 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
cat.cpython-39.pyc
4.17 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
compose.cpython-39.pyc
4.57 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
config.cpython-39.pyc
40.97 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
cors.cpython-39.pyc
6.56 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
cp.cpython-39.pyc
42.21 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
defacl.cpython-39.pyc
11.25 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
defstorageclass.cpython-39.pyc
5.78 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
du.cpython-39.pyc
8.47 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
hash.cpython-39.pyc
7.87 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
help.cpython-39.pyc
6.41 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
hmac.cpython-39.pyc
12.39 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
iam.cpython-39.pyc
24.6 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
kms.cpython-39.pyc
14.88 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
label.cpython-39.pyc
10.46 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
lifecycle.cpython-39.pyc
6.37 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
logging.cpython-39.pyc
9.04 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
ls.cpython-39.pyc
18.81 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
mb.cpython-39.pyc
12.23 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
mv.cpython-39.pyc
5.06 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
notification.cpython-39.pyc
25.47 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
pap.cpython-39.pyc
6.53 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
perfdiag.cpython-39.pyc
62.18 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rb.cpython-39.pyc
3.78 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
requesterpays.cpython-39.pyc
5.53 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
retention.cpython-39.pyc
20.02 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rewrite.cpython-39.pyc
16.12 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rm.cpython-39.pyc
10.86 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rpo.cpython-39.pyc
5.96 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
rsync.cpython-39.pyc
53.86 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
setmeta.cpython-39.pyc
11.25 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
signurl.cpython-39.pyc
20.99 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
stat.cpython-39.pyc
5.04 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
test.cpython-39.pyc
17.73 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
ubla.cpython-39.pyc
6.96 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
update.cpython-39.pyc
12.26 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
version.cpython-39.pyc
5.25 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
versioning.cpython-39.pyc
5.51 KB
02/11/2025 08:19:49 AM
rw-r--r--
📄
web.cpython-39.pyc
7.63 KB
02/11/2025 08:19:49 AM
rw-r--r--
Editing: setmeta.cpython-39.pyc
Close
a +(Wgs? � @ s� d Z ddlmZ ddlmZ ddlmZ ddlmZ ddlZddlmZ ddl m Z dd l mZ dd l mZ ddl mZ ddlmZ dd lmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlmZ ddlm Z ddlm!Z! ddl"m#Z# ddl$m%Z% ddl&m'Z' ddl(m)Z) ddl(m*Z* ddl+m,Z, ddl+m-Z- ddl.m/Z/ ddl.m0Z0 ddl.m1Z1 e!j2Z3d Z4d!e4 d" Z5g d#�Z6g d$�Z7d%d&� Z8d+d'd(�Z9G d)d*� d*e�Z:dS ),zDImplementation of setmeta command for setting cloud object metadata.� )�absolute_import)�print_function)�division)�unicode_literalsN)�encoding)�AccessDeniedException)�PreconditionException)� Preconditions)�Command)�CommandArgument)�ApiSelector)�CommandException)�NameExpansionIterator)�SeekAheadNameExpansionIterator)�StorageUrlFromString)�storage_v1_messages)�MetadataMessage)� constants)�parallelism_framework_util)�GetCloudApiInstance)�IsCustomMetadataHeader)�Retry)�GcloudStorageFlag)�GcloudStorageMap)�InsistAsciiHeader)�InsistAsciiHeaderValue)�CopyObjectMetadata)�ObjectMetadataFromHeaders)�PreconditionsFromHeadersz6 gsutil setmeta -h [header:value|header] ... url... z <B>SYNOPSIS</B> u� <B>DESCRIPTION</B> The gsutil setmeta command allows you to set or remove the metadata on one or more objects. It takes one or more header arguments followed by one or more URLs, where each header argument is in one of two forms: - If you specify ``header:value``, it sets the provided value for the given header on all applicable objects. - If you specify ``header`` (with no value), it removes the given header from all applicable objects. For example, the following command sets the ``Content-Type`` and ``Cache-Control`` headers while also removing the ``Content-Disposition`` header on the specified objects: gsutil setmeta -h "Content-Type:text/html" \ -h "Cache-Control:public, max-age=3600" \ -h "Content-Disposition" gs://bucket/*.html If you have a large number of objects to update you might want to use the gsutil -m option, to perform a parallel (multi-threaded/multi-processing) update: gsutil -m setmeta -h "Content-Type:text/html" \ -h "Cache-Control:public, max-age=3600" \ -h "Content-Disposition" gs://bucket/*.html You can also use the setmeta command to set custom metadata on an object: gsutil setmeta -h "x-goog-meta-icecreamflavor:vanilla" gs://bucket/object Custom metadata is always prefixed in gsutil with ``x-goog-meta-``. This distinguishes it from standard request headers. Other tools that send and receive object metadata by using the request body do not use this prefix. While gsutil supports custom metadata with arbitrary Unicode values, note that when setting metadata using the XML API, which sends metadata as HTTP headers, Unicode characters are encoded using UTF-8, then url-encoded to ASCII. For example: gsutil setmeta -h "x-goog-meta-foo: ã" gs://bucket/object stores the custom metadata key-value pair of ``foo`` and ``%C3%A3``. Subsequently, running ``ls -L`` using the JSON API to list the object's metadata prints ``%C3%A3``, while ``ls -L`` using the XML API url-decodes this value automatically, printing the character ``ã``. The setmeta command reads each object's current generation and metageneration and uses those as preconditions unless they are otherwise specified by top-level arguments. For example, the following command sets the custom metadata ``icecreamflavor:vanilla`` if the current live object has a metageneration of 2: gsutil -h "x-goog-if-metageneration-match:2" setmeta -h "x-goog-meta-icecreamflavor:vanilla" See `Object metadata <https://cloud.google.com/storage/docs/metadata>`_ for more information about object metadata. <B>OPTIONS</B> -h Specifies a header:value to be added, or header to be removed, from each named object. )z cache-controlzcontent-dispositionzcontent-encodingzcontent-languagezcontent-typezcustom-time)�storage�objects�updatec C s | j �|� d| _dS )zDException handler that maintains state about post-completion status.FN)�logger�error�everything_set_okay)�cls�e� r'