Secrets CLI (eski sürüm)
Ö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 bilgileri CLI alt komutlarını databricks secrets
öğesine ekleyerek çalıştırırsınız. Bu alt komutlar Secrets API'yi çağırır.
Sırlar hakkında daha fazla bilgi için bkz. Gizli Bilgi Yönetimi.
Not
Secrets CLI, 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 kapsam oluştur
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 kapsam oluşturmak için databricks secrets create-scope --help
çalıştırarak ek --scope-backend-type
, --resource-id
, ve --dns-name
seçenekleri hakkındaki bilgileri görüntüleyin. Daha fazla bilgi için bkz Gizlilik yönetimi.
Gizli bilgiyi sil
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 kapsamı sil
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.
Yetkili 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 kapsamda depolanan gizli anahtarları listele
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
}
]
}
Not
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.
Bir gizli kapsam için ACL'leri listele
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 mevcut tüm gizli kapsamları listeleyin
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 anahtar oluşturma veya güncelleme
Kullanım belgelerini görüntülemek için databricks secrets put --help
veya databricks secrets write --help
komutunu çalıştırın.
Bir sırrı saklamanın üç yolu vardır. En kolay yol seçeneği kullanmaktır --string-value
; gizli dizi UTF-8 (MB4) biçiminde depolanır. Dikkatli olmanız gereken bir seçenek, çünkü gizli bilginiz komut satırı geçmişinizde düz metin olarak depolanabilir.
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 saklanan gizli bilgiyi sağlamak için --binary-file
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çeneği belirtmezseniz, gizli bilginizi girmeniz için bir düzenleyici açılır. Şifrenizi girmek için editörde 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 databricks secrets put-acl --help
veya databricks secrets write-acl --help
komutunu çalıştırın.
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.