Gizli Diziler CLI (eski)

Önemli

Bu belge kullanımdan kaldırılmıştır ve güncelleştirilmeyebilir.

Bu bilgiler eski Databricks CLI 0.18 ve altındaki sürümler için geçerlidir. Databricks, bunun yerine daha yeni Databricks CLI sürüm 0.205 veya üzerini kullanmanızı önerir. Bkz . Databricks CLI nedir?. Databricks CLI sürümünüzü bulmak için komutunu çalıştırın databricks -v.

Databricks CLI sürüm 0.18 veya altından Databricks CLI sürüm 0.205 veya üzeri sürüme geçiş yapmak için bkz . Databricks CLI geçişi.

Databricks gizli dizileri CLI alt komutlarını öğesine databricks secretsekleyerek çalıştırırsınız. Bu alt komutlar Gizli Diziler API'sini çağırır.

Gizli diziler hakkında daha fazla bilgi için bkz . Gizli dizi yönetimi.

Dekont

Gizli DiziLER CLI'sı Databricks CLI 0.7.1 veya üzerini gerektirir.

databricks secrets --help
Usage: databricks secrets [OPTIONS] COMMAND [ARGS]...

  Utility to interact with secret API.

Options:
  -v, --version   [VERSION]
  --profile TEXT  CLI connection profile to use. The default profile is
                  "DEFAULT".
  -h, --help      Show this message and exit.

Commands:
  create-scope  Creates a secret scope.
    Options:
      --scope SCOPE                  The name of the secret scope.
      --initial-manage-principal     The initial principal that can manage the created secret scope.
                                      If specified, the initial ACL with MANAGE permission applied
                                      to the scope is assigned to the supplied principal (user or group).
                                      The only supported principal is the group
                                      "users", which contains all users in the workspace. If not
                                      specified, the initial ACL with MANAGE permission applied to
                                      the scope is assigned to request issuer's user identity.
  delete        Deletes a secret.
    Options:
      --scope SCOPE                  The name of the secret scope.
      --key KEY                      The name of secret key.
  delete-acl    Deletes an access control rule for a principal.
    Options:
      --scope SCOPE                  The name of the scope.
      --principal PRINCIPAL          The name of the principal.
  delete-scope  Deletes a secret scope.
    Options:
      --scope SCOPE                  The name of the secret scope.
  get-acl       Gets the details for an access control rule.
    Options:
      --scope SCOPE                  The name of the secret scope.
      --principal PRINCIPAL          The name of the principal.
      --output FORMAT                JSON or TABLE. Set to TABLE by default.
  list          Lists all the secrets in a scope.
    Options:
      --scope SCOPE                  The name of the secret scope.
      --output FORMAT                JSON or TABLE. Set to TABLE by default.
  list-acls     Lists all access control rules for a given secret scope.
    Options:
      --scope SCOPE                  The name of the secret scope.
      --output FORMAT                JSON or TABLE. Set to TABLE by default.
  list-scopes   Lists all secret scopes.
      --output FORMAT                JSON or TABLE. Set to TABLE by default.
  put           Puts a secret in a scope.
    Options:
      --scope SCOPE                  The name of the secret scope.
      --key KEY                      The name of the secret key.
      --string-value TEXT            Read value from string and stored in UTF-8 (MB4) form
      --binary-file PATH             Read value from binary-file and stored as bytes.
  put-acl       Creates or overwrites an access control rule for a principal
                applied to a given secret scope.
    Options:
      --scope SCOPE                    The name of the secret scope.
      --principal PRINCIPAL            The name of the principal.
      --permission [MANAGE|WRITE|READ] The permission to apply.
  write         Puts a secret in a scope. "write" is an alias for "put".
    Options:
      --scope SCOPE                  The name of the secret scope.
      --key KEY                      The name of the secret key.
      --string-value TEXT            Read value from string and stored in UTF-8 (MB4) form
      --binary-file PATH             Read value from binary-file and stored as bytes.
  write-acl     Creates or overwrites an access control rule for a principal
                applied to a given secret scope. "write-acl" is an alias for
                "put-acl".
    Options:
      --scope SCOPE                    The name of the secret scope.
      --principal PRINCIPAL            The name of the principal.
      --permission [MANAGE|WRITE|READ] The permission to apply.

Gizli dizi kapsamı oluşturma

Kullanım belgelerini görüntülemek için komutunu çalıştırın databricks secrets create-scope --help.

databricks secrets create-scope --scope my-scope

Başarılı olursa, hiçbir çıkış görüntülenmez.

Databricks CLI kullanarak Azure Key Vault destekli gizli dizi kapsamı oluşturmak için komutunu çalıştırarak databricks secrets create-scope --help ek --scope-backend-type, --resource-idve --dns-name seçenekleri hakkındaki bilgileri görüntüleyin. Daha fazla bilgi için bkz . Gizli diziler.

Gizli anahtarı silme

Kullanım belgelerini görüntülemek için komutunu çalıştırın databricks secrets delete --help.

databricks secrets delete --scope my-scope --key my-key

Başarılı olursa, hiçbir çıkış görüntülenmez.

Sorumlu için ACL'yi iptal etme

Kullanım belgelerini görüntülemek için komutunu çalıştırın databricks secrets delete-acl --help.

databricks secrets delete-acl --scope my-scope --principal someone@example.com

Başarılı olursa, hiçbir çıkış görüntülenmez.

Gizli dizi kapsamını silme

Kullanım belgelerini görüntülemek için komutunu çalıştırın databricks secrets delete-scope --help.

databricks secrets delete-scope --scope my-scope

Başarılı olursa, hiçbir çıkış görüntülenmez.

Sorumlu için ACL alma

Kullanım belgelerini görüntülemek için komutunu çalıştırın databricks secrets get-acl --help.

databricks secrets get-acl --scope my-scope --principal someone@example.com --output JSON
{
  "principal": "sonmeone@example.com",
  "permission": "MANAGE"
}

Gizli dizi kapsamında depolanan gizli anahtarları listeleme

Kullanım belgelerini görüntülemek için komutunu çalıştırın databricks secrets list --help.

databricks secrets list --scope my-scope --output JSON
{
  "secrets": [
    {
      "key": "my-key",
      "last_updated_timestamp": 1621284092605
    }
  ]
}

Dekont

Databricks CLI kullanarak gizli dizi değerlerine erişemezsiniz. Gizli dizi değerlerine erişmek için Databricks not defterindeki Databricks Utilities gizli dizileri yardımcı programını kullanmanız gerekir.

Gizli dizi kapsamı için ACL'leri listeleme

Kullanım belgelerini görüntülemek için komutunu çalıştırın databricks secrets list-acls --help.

databricks secrets list-acls --scope my-scope --output JSON
{
  "items": [
    {
      "principal": "someone@example.com",
      "permission": "MANAGE"
    }
  ]
}

Çalışma alanında kullanılabilir tüm gizli dizi kapsamlarını listeleme

Kullanım belgelerini görüntülemek için komutunu çalıştırın databricks secrets list-scopes --help.

databricks secrets list-scopes --output JSON
{
  "scopes": [
    {
      "name": "my-scope",
      "backend_type": "DATABRICKS"
    }
  ]
}

Gizli dizi oluşturma veya güncelleştirme

Kullanım belgelerini görüntülemek için veya databricks secrets write --helpkomutunu çalıştırındatabricks secrets put --help.

Gizli dizi depolamanın üç yolu vardır. En kolay yol seçeneği kullanmaktır --string-value ; gizli dizi UTF-8 (MB4) biçiminde depolanır. Gizli diziniz komut satırı geçmişinizde düz metin olarak depolanabileceği için bu seçeneğe dikkat etmelisiniz.

databricks secrets put --scope my-scope --key my-key --string-value my-value

Veya:

databricks secrets write --scope my-scope --key my-key --string-value my-value

Başarılı olursa, hiçbir çıkış görüntülenmez.

Bir dosyada --binary-file depolanan gizli diziyi sağlamak için seçeneğini de kullanabilirsiniz. Dosya içeriği olduğu gibi okunur ve bayt olarak depolanır.

databricks secrets put --scope my-scope --key my-key --binary-file my-secret.txt

Veya:

databricks secrets write --scope my-scope --key my-key --binary-file my-secret.txt

Başarılı olursa, hiçbir çıkış görüntülenmez.

Bir seçenek belirtmezseniz gizli dizinizi girmeniz için bir düzenleyici açılır. Gizli dizinizi girmek için düzenleyicide gösterilen yönergeleri izleyin.

databricks secrets put --scope my-scope --key my-key

Veya:

databricks secrets write --scope my-scope --key my-key

# ----------------------------------------------------------------------
# Do not edit the above line. Everything below it will be ignored.
# Please input your secret value above the line. Text will be stored in
# UTF-8 (MB4) form and any trailing new line will be stripped.
# Exit without saving will abort writing secret.

ACL'yi sorumlu için gizli kapsam olarak verme veya değiştirme

Kullanım belgelerini görüntülemek için veya databricks secrets write-acl --helpkomutunu çalıştırındatabricks secrets put-acl --help.

databricks secrets put-acl --scope my-scope --principal someone@example.com --permission MANAGE

Veya:

databricks secrets write-acl --scope my-scope --principal someone@example.com --permission MANAGE

Başarılı olursa, hiçbir çıkış görüntülenmez.