2018-09-17 17:46:28 +00:00
|
|
|
---
|
|
|
|
title: Bucket Commands
|
2019-06-28 17:51:30 +00:00
|
|
|
summary: Bucket commands help you to manage the life cycle of a volume.
|
|
|
|
weight: 2
|
2018-09-17 17:46:28 +00:00
|
|
|
---
|
2018-09-17 23:21:10 +00:00
|
|
|
<!---
|
|
|
|
Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
contributor license agreements. See the NOTICE file distributed with
|
|
|
|
this work for additional information regarding copyright ownership.
|
|
|
|
The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
(the "License"); you may not use this file except in compliance with
|
|
|
|
the License. You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License 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.
|
|
|
|
-->
|
2018-09-17 17:46:28 +00:00
|
|
|
|
|
|
|
Ozone shell supports the following bucket commands.
|
|
|
|
|
|
|
|
* [create](#create)
|
|
|
|
* [delete](#delete)
|
|
|
|
* [info](#info)
|
|
|
|
* [list](#list)
|
|
|
|
|
|
|
|
### Create
|
|
|
|
|
2019-01-25 06:47:36 +00:00
|
|
|
The bucket create command allows users to create a bucket.
|
2018-09-17 17:46:28 +00:00
|
|
|
|
|
|
|
***Params:***
|
|
|
|
|
|
|
|
| Arguments | Comment |
|
|
|
|
|--------------------------------|-----------------------------------------|
|
|
|
|
| Uri | The name of the bucket in **/volume/bucket** format.
|
|
|
|
|
|
|
|
{{< highlight bash >}}
|
|
|
|
ozone sh bucket create /hive/jan
|
|
|
|
{{< /highlight >}}
|
|
|
|
|
|
|
|
The above command will create a bucket called _jan_ in the _hive_ volume.
|
|
|
|
Since no scheme was specified this command defaults to O3 (RPC) protocol.
|
|
|
|
|
|
|
|
### Delete
|
|
|
|
|
2019-01-25 06:47:36 +00:00
|
|
|
The bucket delete command allows users to delete a bucket. If the
|
2018-09-17 17:46:28 +00:00
|
|
|
bucket is not empty then this command will fail.
|
|
|
|
|
|
|
|
***Params:***
|
|
|
|
|
|
|
|
| Arguments | Comment |
|
|
|
|
|--------------------------------|-----------------------------------------|
|
|
|
|
| Uri | The name of the bucket
|
|
|
|
|
|
|
|
{{< highlight bash >}}
|
2019-01-25 06:47:36 +00:00
|
|
|
ozone sh bucket delete /hive/jan
|
2018-09-17 17:46:28 +00:00
|
|
|
{{< /highlight >}}
|
|
|
|
|
|
|
|
The above command will delete _jan_ bucket if it is empty.
|
|
|
|
|
|
|
|
### Info
|
|
|
|
|
|
|
|
The bucket info commands returns the information about the bucket.
|
|
|
|
***Params:***
|
|
|
|
|
|
|
|
| Arguments | Comment |
|
|
|
|
|--------------------------------|-----------------------------------------|
|
|
|
|
| Uri | The name of the bucket.
|
|
|
|
|
|
|
|
{{< highlight bash >}}
|
|
|
|
ozone sh bucket info /hive/jan
|
|
|
|
{{< /highlight >}}
|
|
|
|
|
|
|
|
The above command will print out the information about _jan_ bucket.
|
|
|
|
|
|
|
|
### List
|
|
|
|
|
2019-01-25 06:47:36 +00:00
|
|
|
The bucket list command allows users to list the buckets in a volume.
|
2018-09-17 17:46:28 +00:00
|
|
|
|
|
|
|
***Params:***
|
|
|
|
|
|
|
|
| Arguments | Comment |
|
|
|
|
|--------------------------------|-----------------------------------------|
|
|
|
|
| -l, --length | Maximum number of results to return. Default: 100
|
|
|
|
| -p, --prefix | Optional, Only buckets that match this prefix will be returned.
|
|
|
|
| -s, --start | The listing will start from key after the start key.
|
|
|
|
| Uri | The name of the _volume_.
|
|
|
|
|
|
|
|
{{< highlight bash >}}
|
|
|
|
ozone sh bucket list /hive
|
|
|
|
{{< /highlight >}}
|
|
|
|
|
2019-01-25 06:47:36 +00:00
|
|
|
This command will list all buckets on the volume _hive_.
|
2018-09-17 17:46:28 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-01-07 21:06:45 +00:00
|
|
|
### path
|
2019-03-15 04:16:59 +00:00
|
|
|
The bucket command to provide ozone mapping for s3 bucket (Created via aws cli)
|
2019-01-07 21:06:45 +00:00
|
|
|
|
|
|
|
{{< highlight bash >}}
|
2019-03-15 04:16:59 +00:00
|
|
|
ozone s3 path <<s3Bucket>>
|
2019-01-07 21:06:45 +00:00
|
|
|
{{< /highlight >}}
|
|
|
|
|
|
|
|
The above command will print VolumeName and the mapping created for s3Bucket.
|
|
|
|
|
2018-09-17 17:46:28 +00:00
|
|
|
You can try out these commands from the docker instance of the [Alpha
|
|
|
|
Cluster](runningviadocker.html).
|