// Module included in the following assemblies:
//
// * backup_and_restore/application_backup_and_restore/cli-tools/oadp-cli-plugin.adoc

:_mod-docs-content-type: REFERENCE
[id="oadp-cli-admin-bsl_{context}"]
= Backup storage location management commands

[role="_abstract"]
You can use the {oadp-short} command-line interface (CLI) to create, view, set, and delete backup storage locations (BSLs). Backup storage locations define where backup data is stored, such as an object storage bucket.

[id="oadp-cli-admin-bsl-prereqs_{context}"]
== Prerequisites

* The {oadp-short} CLI plugin is installed and configured in admin mode.
* You are logged in to the {product-title} cluster as a user with `cluster-admin` privileges.

[id="oadp-cli-admin-bsl-create_{context}"]
== Backup storage location creation command

To create a backup storage location, use the following command:

[source,terminal]
----
$ oc oadp backup-location create <bsl_name> [flags]
----

.Flags for the `oc oadp backup-location create` command
[cols="1,3",options="header"]
|===
|Flag |Description

|`--provider`
|The name of the cloud provider, for example, `aws`, `gcp`, or `azure`.

|`--bucket`
|The name of the object storage bucket.

|`--prefix`
|The path prefix within the bucket.

|`--credential`
|The secret and key for the provider credentials in the format `SECRET_NAME=KEY`.

|`--config`
|The provider-specific configuration as `key=value` pairs.

|`--backup-sync-period`
|The frequency at which to synchronize the backup contents from object storage.

|`--request-timeout`
|The timeout for the request to the Kubernetes API server.
|===

.Example of the backup storage location creation command
[source,terminal]
----
$ oc oadp backup-location create my-bsl \
    --provider aws \
    --bucket my-velero-bucket \
    --prefix velero \
    --credential cloud-credentials=cloud
----

[id="oadp-cli-admin-bsl-list_{context}"]
== Backup storage location listing command

To list all backup storage locations, use the following command:

[source,terminal]
----
$ oc oadp backup-location get [<bsl_name>] [flags]
----

.Flags for the `oc oadp backup-location get` command
[cols="1,3",options="header"]
|===
|Flag |Description

|`-o`
|The output format. Supported values are `json` and `yaml`.
|===

[id="oadp-cli-admin-bsl-set-default_{context}"]
== Default backup storage location command

To set the default backup storage location, use the following command:

[source,terminal]
----
$ oc oadp backup-location set <bsl_name>
----

[id="oadp-cli-admin-bsl-delete_{context}"]
== Backup storage location deletion command

To delete a backup storage location, use the following command:

[source,terminal]
----
$ oc oadp backup-location delete <bsl_name> [flags]
----

.Flags for the `oc oadp backup-location delete` command
[cols="1,3",options="header"]
|===
|Flag |Description

|`--confirm`
|Specifies whether to confirm the deletion without prompting.
|===
