Available in Classic and VPC
Change the metadata for an account, container (bucket), or object. If the container does not exist, it will be created automatically.
Syntax
The post syntax is as follows:
-
Account
swift post \ [--meta <name:value>] \ [--header <header:value>] -
Container
swift post \ <container> \ [--read-acl <acl>] \ [--write-acl <acl>] \ [--meta <name:value>] \ [--header <header:value>] -
Object
swift post \ <container> <object> \ [--meta <name:value>] \ [--header <header:value>]
Options
This section describes the options available when running post.
Required options
The following options are required for post.
| Options | Type | Required | Description |
|---|---|---|---|
<container> |
String | Conditional | Container name
|
Optional options
These are the optional options for post. Options that are not specified will use their default values.
| Options | Type | Required | Description |
|---|---|---|---|
<object> |
String | Optional | Object name
|
--read-acl |
String | Optional | Container's read ACL
|
--write-acl |
String | Optional | Container's write ACL
|
--meta |
String | Optional | Metadata entry
|
--header |
String | Optional | Custom header to use in the request
|
Common options
For information about the options common to all swift subcommands, see Archive Storage options.
Examples
The following is an example of using the post command to create a container or set metadata.
Command
The following is an example command for creating a container.
swift post test-container-01
The following is an example command for setting metadata for a container.
swift post test-container-01 --meta Purpose:Documentation
Output
If the request is successful, no output is displayed. You can verify the updated metadata at stat.