|
30 | 30 | |
31 | 31 | w = WorkspaceClient() |
32 | 32 | |
33 | | - credential = w.storage_credentials.create( |
| 33 | + storage_credential = w.storage_credentials.create( |
34 | 34 | name=f"sdk-{time.time_ns()}", |
35 | 35 | aws_iam_role=catalog.AwsIamRoleRequest(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), |
| 36 | + comment="created via SDK", |
36 | 37 | ) |
37 | 38 | |
38 | 39 | # cleanup |
39 | | - w.storage_credentials.delete(name=credential.name) |
| 40 | + w.storage_credentials.delete(name=storage_credential.name) |
40 | 41 |
|
41 | 42 | Creates a new storage credential. |
42 | 43 |
|
|
98 | 99 | |
99 | 100 | created = w.storage_credentials.create( |
100 | 101 | name=f"sdk-{time.time_ns()}", |
101 | | - aws_iam_role=catalog.AwsIamRole(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), |
| 102 | + aws_iam_role=catalog.AwsIamRoleRequest(role_arn=os.environ["TEST_METASTORE_DATA_ACCESS_ARN"]), |
102 | 103 | ) |
103 | 104 | |
104 | | - by_name = w.storage_credentials.get(get=created.name) |
| 105 | + by_name = w.storage_credentials.get(name=created.name) |
105 | 106 | |
106 | 107 | # cleanup |
107 | | - w.storage_credentials.delete(delete=created.name) |
| 108 | + w.storage_credentials.delete(name=created.name) |
108 | 109 |
|
109 | 110 | Gets a storage credential from the metastore. The caller must be a metastore admin, the owner of the |
110 | 111 | storage credential, or have some permission on the storage credential. |
|
123 | 124 | .. code-block:: |
124 | 125 |
|
125 | 126 | from databricks.sdk import WorkspaceClient |
| 127 | + from databricks.sdk.service import catalog |
126 | 128 | |
127 | 129 | w = WorkspaceClient() |
128 | 130 | |
129 | | - all = w.storage_credentials.list() |
| 131 | + all = w.storage_credentials.list(catalog.ListStorageCredentialsRequest()) |
130 | 132 |
|
131 | 133 | Gets an array of storage credentials (as __StorageCredentialInfo__ objects). The array is limited to |
132 | 134 | only those storage credentials the caller has permission to access. If the caller is a metastore |
|
0 commit comments