// 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-nonadmin-bsl_{context}"]
= NonAdminBackupStorageLocation management commands

[role="_abstract"]
You can use the {oadp-short} command-line interface (CLI) to create and view `NonAdminBackupStorageLocation` (NABSL) objects in your namespace. NABSLs define where your backup data is stored by using object storage that you own and manage.

[NOTE]
====
Updating or deleting NABSLs after creation is not supported for non-administrator users.
====

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

* The {oadp-short} CLI plugin is installed and configured in non-administrator mode.
* You are logged in to the {product-title} cluster and your current namespace context is set to the target namespace.
* You have editor roles for `nonadminbackupstoragelocations.oadp.openshift.io` in your namespace.
* You have a Kubernetes `Secret` object in your namespace that contains the credentials for your object storage provider.

[id="oadp-cli-nonadmin-bsl-create_{context}"]
== NonAdminBackupStorageLocation creation command

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

[source,terminal]
----
$ oc oadp nonadmin bsl create <bsl_name> [flags]
----

where:

`<bsl_name>`:: Specifies the name of the backup storage location.

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

|`--provider`
|The storage provider, for example, `aws`, `azure`, or `gcp`. This flag is required.

|`--bucket`
|The name of the object storage bucket. This flag is required.

|`--credential`
|The credential for this location in the format `SECRET_NAME=KEY`, where `SECRET_NAME` is the name of the Kubernetes `Secret` object and `KEY` is the data key within the secret. This flag is required.

|`--prefix`
|The prefix for backup objects in the bucket.

|`--region`
|The storage region. This flag is required for some providers, such as AWS.

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

If the cluster administrator has enabled the `requireApprovalForBSL` parameter, the NABSL remains in a pending state until an administrator approves the request.

.Example of the NABSL creation command
[source,terminal]
----
$ oc oadp nonadmin bsl create my-storage \
    --provider aws \
    --bucket my-velero-bucket \
    --prefix velero-backups \
    --credential cloud-credentials=cloud \
    --region us-east-1
----

[TIP]
====
After you create a backup storage location (BSL), run the following command to set it as the default and avoid specifying the storage location on each backup:

[source,terminal]
----
$ oc oadp client config set default-nabsl=<bsl_name>
----

where:

`<bsl_name>`:: Specifies the name of the backup storage location.
====

[id="oadp-cli-nonadmin-bsl-list_{context}"]
== NonAdminBackupStorageLocation listing command

To list all non-administrator backup storage locations in your current namespace, use the following command:

[source,terminal]
----
$ oc oadp nonadmin bsl get [<bsl_name>] [flags]
----

where:

`<bsl_name>`:: Specifies the name of the backup storage location. This value is optional.

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

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