# blob

Blob storage operations

## Usage

```bash
apolo blob [OPTIONS] COMMAND [ARGS]...
```

Blob storage operations.

**Commands:**

| Usage                                           | Description                                 |
| ----------------------------------------------- | ------------------------------------------- |
| [*cp*](#cp)                                     | Copy blobs into and from Blob Storage       |
| [*du*](#du)                                     | Get storage usage for BUCKET                |
| [*glob*](#glob)                                 | List resources that match PATTERNS          |
| [*importbucket*](#importbucket)                 | Import an existing bucket                   |
| [*ls*](#ls)                                     | List buckets or bucket contents             |
| [*lsbucket*](#lsbucket)                         | List buckets                                |
| [*lscredentials*](#lscredentials)               | List bucket credentials                     |
| [*mkbucket*](#mkbucket)                         | Create a new bucket                         |
| [*mkcredentials*](#mkcredentials)               | Create a new bucket credential              |
| [*rm*](#rm)                                     | Remove blobs from bucket                    |
| [*rmbucket*](#rmbucket)                         | Remove bucket BUCKET                        |
| [*rmcredentials*](#rmcredentials)               | Remove bucket credential BUCKET\_CREDENTIAL |
| [*set-bucket-publicity*](#set-bucket-publicity) | Change public access settings for BUCKET    |
| [*sign-url*](#sign-url)                         | Make signed url for blob in bucket          |
| [*statbucket*](#statbucket)                     | Get bucket BUCKET                           |
| [*statcredentials*](#statcredentials)           | Get bucket credential BUCKET\_CREDENTIAL    |

### cp

Copy blobs into and from Blob Storage

#### Usage

```bash
apolo blob cp [OPTIONS] [SOURCES]... [DESTINATION]
```

Copy blobs into and from Blob Storage.

Either `SOURCES` or `DESTINATION` should have `blob://` scheme. If scheme is omitted, file:// scheme is assumed. It is currently not possible to copy files between Blob Storage (`blob://`) destination, nor with `storage://` scheme paths.

Use `/dev/stdin` and `/dev/stdout` file names to upload a file from standard input or output to stdout.

Any number of --exclude and --include options can be passed. The filters that appear later in the command take precedence over filters that appear earlier in the command. If neither --exclude nor --include options are specified the default can be changed using the storage.cp-exclude configuration variable documented in "apolo help user-config".

File permissions, modification times and other attributes will not be passed to Blob Storage metadata during upload.

#### Options

| Name                                 | Description                                                                                                                                                                                                                               |
| ------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *--help*                             | Show this message and exit.                                                                                                                                                                                                               |
| *--continue*                         | Continue copying partially-copied files. Only for copying from Blob Storage.                                                                                                                                                              |
| *--exclude-from-files FILES*         | A list of file names that contain patterns for exclusion files and directories. Used only for uploading. The default can be changed using the storage.cp-exclude-from-files configuration variable documented in "apolo help user-config" |
| *--exclude TEXT*                     | Exclude files and directories that match the specified pattern.                                                                                                                                                                           |
| *--include TEXT*                     | Don't exclude files and directories that match the specified pattern.                                                                                                                                                                     |
| *--glob / --no-glob*                 | Expand glob patterns in SOURCES with explicit scheme. *\[default: glob]*                                                                                                                                                                  |
| *-T, --no-target-directory*          | Treat DESTINATION as a normal file.                                                                                                                                                                                                       |
| *-p, --progress / -P, --no-progress* | Show progress, on by default.                                                                                                                                                                                                             |
| *-r, --recursive*                    | Recursive copy, off by default                                                                                                                                                                                                            |
| *-t, --target-directory DIRECTORY*   | Copy all SOURCES into DIRECTORY.                                                                                                                                                                                                          |
| *-u, --update*                       | Copy only when the SOURCE file is newer than the destination file or when the destination file is missing.                                                                                                                                |

### du

Get storage usage for BUCKET

#### Usage

```bash
apolo blob du [OPTIONS] BUCKET
```

Get storage usage for `BUCKET`.

#### Options

| Name                | Description                                                   |
| ------------------- | ------------------------------------------------------------- |
| *--help*            | Show this message and exit.                                   |
| *--cluster CLUSTER* | Look on a specified cluster (the current cluster by default). |
| *--org ORG*         | Look on a specified org (the current org by default).         |
| *--project PROJECT* | Look on a specified project (the current project by default). |

### glob

List resources that match PATTERNS

#### Usage

```bash
apolo blob glob [OPTIONS] [PATTERNS]...
```

List resources that match `PATTERNS`.

#### Options

| Name         | Description                 |
| ------------ | --------------------------- |
| *--help*     | Show this message and exit. |
| *--full-uri* | Output full bucket URI.     |

### importbucket

Import an existing bucket

#### Usage

```bash
apolo blob importbucket [OPTIONS]
```

Import an existing bucket.

#### Options

| Name                                                       | Description                                                                                                                                               |
| ---------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- |
| *--help*                                                   | Show this message and exit.                                                                                                                               |
| *--aws-access-key-id AWS\_ACCESS\_KEY\_ID*                 | AWS access\_key\_id to use to access the bucket. Required when PROVIDER is 'aws'                                                                          |
| *--aws-endpoint-url AWS\_ENDPOINT*                         | AWS endpoint to use to access the bucket. Usually you need to set this if you use non-AWS S3 compatible provider                                          |
| *--aws-region-name AWS\_REGION*                            | AWS region to use to access the bucket.                                                                                                                   |
| *--aws-secret-access-key AWS\_SECRET\_ACCESS\_KEY*         | AWS secret\_access\_key to use to access the bucket. Required when PROVIDER is 'aws'                                                                      |
| *--azure-storage-account-url AZURE\_STORAGE\_ACCOUNT\_URL* | Azure account url. Usually it has following format: https\://\<account\_id>.blob.core.windows.net Required when PROVIDER is 'azure'                       |
| *--azure-storage-credential AZURE\_STORAGE\_CREDENTIAL*    | Azure storage credential that grants access to imported bucket. Either this or AZURE\_SAS is required when PROVIDER is 'azure'                            |
| *--azure-storage-sas-token AZURE\_SAS*                     | Azure shared access signature token that grants access to imported bucket. Either this or AZURE\_STORAGE\_CREDENTIAL is required when PROVIDER is 'azure' |
| *--cluster CLUSTER*                                        | Perform in a specified cluster (the current cluster by default).                                                                                          |
| *--gcp-sa-credential GCP\_SA\_CREDNETIAL*                  | GCP service account credential in form of base64 encoded json string that grants access to imported bucket. Required when PROVIDER is 'gcp'               |
| *--name NAME*                                              | Optional bucket name                                                                                                                                      |
| *--org ORG*                                                | Perform in a specified org (the current org by default).                                                                                                  |
| *--project PROJECT*                                        | Perform in a specified project (the current project by default).                                                                                          |
| *--provider PROVIDER*                                      | Bucket provider that hosts bucket *\[required]*                                                                                                           |
| *--provider-bucket-name EXTERNAL\_NAME*                    | Name of bucket (or container in case of Azure) inside the provider *\[required]*                                                                          |

### ls

List buckets or bucket contents

#### Usage

```bash
apolo blob ls [OPTIONS] [PATHS]...
```

List buckets or bucket contents.

#### Options

| Name                   | Description                                                         |
| ---------------------- | ------------------------------------------------------------------- |
| *--help*               | Show this message and exit.                                         |
| *-l*                   | use a long listing format.                                          |
| *--full-uri*           | Output full bucket URI.                                             |
| *-h, --human-readable* | with -l print human readable sizes (e.g., 2K, 540M).                |
| *-r, --recursive*      | List all keys under the URL path provided, not just 1 level depths. |

### lsbucket

List buckets

#### Usage

```bash
apolo blob lsbucket [OPTIONS]
```

List buckets.

#### Options

| Name                | Description                                                   |
| ------------------- | ------------------------------------------------------------- |
| *--help*            | Show this message and exit.                                   |
| *--all-orgs*        | Show buckets in all orgs.                                     |
| *--all-projects*    | Show buckets in all projects.                                 |
| *--cluster CLUSTER* | Look on a specified cluster (the current cluster by default). |
| *--full-uri*        | Output full bucket URI.                                       |
| *--long-format*     | Output all info about bucket.                                 |
| *--org ORG*         | Look on a specified org (the current org by default).         |
| *--project PROJECT* | Look on a specified project (the current project by default). |

### lscredentials

List bucket credentials

#### Usage

```bash
apolo blob lscredentials [OPTIONS]
```

List bucket credentials.

#### Options

| Name                | Description                                                   |
| ------------------- | ------------------------------------------------------------- |
| *--help*            | Show this message and exit.                                   |
| *--cluster CLUSTER* | Look on a specified cluster (the current cluster by default). |

### mkbucket

Create a new bucket

#### Usage

```bash
apolo blob mkbucket [OPTIONS]
```

Create a new bucket.

#### Options

| Name                | Description                                                      |
| ------------------- | ---------------------------------------------------------------- |
| *--help*            | Show this message and exit.                                      |
| *--cluster CLUSTER* | Perform in a specified cluster (the current cluster by default). |
| *--name NAME*       | Optional bucket name                                             |
| *--org ORG*         | Perform in a specified org (the current org by default).         |
| *--project PROJECT* | Perform in a specified project (the current project by default). |

### mkcredentials

Create a new bucket credential

#### Usage

```bash
apolo blob mkcredentials [OPTIONS] BUCKETS...
```

Create a new bucket credential.

#### Options

| Name                | Description                                                      |
| ------------------- | ---------------------------------------------------------------- |
| *--help*            | Show this message and exit.                                      |
| *--cluster CLUSTER* | Perform in a specified cluster (the current cluster by default). |
| *--name NAME*       | Optional bucket credential name                                  |
| *--org ORG*         | Perform in a specified org (the current org by default).         |
| *--project PROJECT* | Perform in a specified project (the current project by default). |
| *--read-only*       | Make read-only credential                                        |

### rm

Remove blobs from bucket

#### Usage

```bash
apolo blob rm [OPTIONS] PATHS...
```

Remove blobs from bucket.

#### Options

| Name                                 | Description                                              |
| ------------------------------------ | -------------------------------------------------------- |
| *--help*                             | Show this message and exit.                              |
| *--glob / --no-glob*                 | Expand glob patterns in PATHS *\[default: glob]*         |
| *-p, --progress / -P, --no-progress* | Show progress, on by default in TTY mode, off otherwise. |
| *-r, --recursive*                    | remove directories and their contents recursively        |

### rmbucket

Remove bucket BUCKET

#### Usage

```bash
apolo blob rmbucket [OPTIONS] BUCKETS...
```

Remove bucket `BUCKET`.

#### Options

| Name                | Description                                                      |
| ------------------- | ---------------------------------------------------------------- |
| *--help*            | Show this message and exit.                                      |
| *--cluster CLUSTER* | Perform on a specified cluster (the current cluster by default). |
| *-f, --force*       | Force removal of all blobs inside bucket                         |
| *--org ORG*         | Perform on a specified org (the current org by default).         |
| *--project PROJECT* | Perform on a specified project (the current project by default). |

### rmcredentials

Remove bucket credential BUCKET\_CREDENTIAL

#### Usage

```bash
apolo blob rmcredentials [OPTIONS] CREDENTIALS...
```

Remove bucket credential `BUCKET`\_`CREDENTIAL`.

#### Options

| Name                | Description                                                      |
| ------------------- | ---------------------------------------------------------------- |
| *--help*            | Show this message and exit.                                      |
| *--cluster CLUSTER* | Perform on a specified cluster (the current cluster by default). |

### set-bucket-publicity

Change public access settings for BUCKET

#### Usage

```bash
apolo blob set-bucket-publicity [OPTIONS] BUCKET {public|private}
```

Change public access settings for `BUCKET`

#### Examples

```bash

$ apolo blob set-bucket-publicity my-bucket public
$ apolo blob set-bucket-publicity my-bucket private
```

#### Options

| Name                | Description                                                      |
| ------------------- | ---------------------------------------------------------------- |
| *--help*            | Show this message and exit.                                      |
| *--cluster CLUSTER* | Perform on a specified cluster (the current cluster by default). |
| *--org ORG*         | Perform on a specified org (the current org by default).         |
| *--project PROJECT* | Perform on a specified project (the current project by default). |

### sign-url

Make signed url for blob in bucket

#### Usage

```bash
apolo blob sign-url [OPTIONS] PATH
```

Make signed url for blob in bucket.

#### Options

| Name                  | Description                                                                   |
| --------------------- | ----------------------------------------------------------------------------- |
| *--help*              | Show this message and exit.                                                   |
| *--expires TIMEDELTA* | Duration this signature will be valid in the format '1h2m3s' *\[default: 1h]* |

### statbucket

Get bucket BUCKET

#### Usage

```bash
apolo blob statbucket [OPTIONS] BUCKET
```

Get bucket `BUCKET`.

#### Options

| Name                | Description                                                   |
| ------------------- | ------------------------------------------------------------- |
| *--help*            | Show this message and exit.                                   |
| *--cluster CLUSTER* | Look on a specified cluster (the current cluster by default). |
| *--full-uri*        | Output full bucket URI.                                       |
| *--org ORG*         | Look on a specified org (the current org by default).         |
| *--project PROJECT* | Look on a specified project (the current project by default). |

### statcredentials

Get bucket credential BUCKET\_CREDENTIAL

#### Usage

```bash
apolo blob statcredentials [OPTIONS] BUCKET_CREDENTIAL
```

Get bucket credential `BUCKET`\_`CREDENTIAL`.

#### Options

| Name                | Description                                                   |
| ------------------- | ------------------------------------------------------------- |
| *--help*            | Show this message and exit.                                   |
| *--cluster CLUSTER* | Look on a specified cluster (the current cluster by default). |
