Skip to content

Commit ce3a055

Browse files
committed
fixed test output
1 parent eb46e0b commit ce3a055

11 files changed

Lines changed: 228 additions & 4 deletions

File tree

acceptance/bundle/refschema/out.fields.txt

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,52 @@ resources.apps.*.permissions.permissions[*].group_name string ALL
208208
resources.apps.*.permissions.permissions[*].permission_level iam.PermissionLevel ALL
209209
resources.apps.*.permissions.permissions[*].service_principal_name string ALL
210210
resources.apps.*.permissions.permissions[*].user_name string ALL
211+
resources.catalogs.*.browse_only bool REMOTE
212+
resources.catalogs.*.catalog_type catalog.CatalogType REMOTE
213+
resources.catalogs.*.comment string ALL
214+
resources.catalogs.*.connection_name string ALL
215+
resources.catalogs.*.created_at int64 REMOTE
216+
resources.catalogs.*.created_by string REMOTE
217+
resources.catalogs.*.effective_predictive_optimization_flag *catalog.EffectivePredictiveOptimizationFlag REMOTE
218+
resources.catalogs.*.effective_predictive_optimization_flag.inherited_from_name string REMOTE
219+
resources.catalogs.*.effective_predictive_optimization_flag.inherited_from_type catalog.EffectivePredictiveOptimizationFlagInheritedFromType REMOTE
220+
resources.catalogs.*.effective_predictive_optimization_flag.value catalog.EnablePredictiveOptimization REMOTE
221+
resources.catalogs.*.enable_predictive_optimization catalog.EnablePredictiveOptimization REMOTE
222+
resources.catalogs.*.full_name string REMOTE
223+
resources.catalogs.*.grants []resources.CatalogGrant INPUT
224+
resources.catalogs.*.grants[*] resources.CatalogGrant INPUT
225+
resources.catalogs.*.grants[*].principal string INPUT
226+
resources.catalogs.*.grants[*].privileges []resources.CatalogGrantPrivilege INPUT
227+
resources.catalogs.*.grants[*].privileges[*] resources.CatalogGrantPrivilege INPUT
228+
resources.catalogs.*.id string INPUT
229+
resources.catalogs.*.isolation_mode catalog.CatalogIsolationMode REMOTE
230+
resources.catalogs.*.lifecycle resources.Lifecycle INPUT
231+
resources.catalogs.*.lifecycle.prevent_destroy bool INPUT
232+
resources.catalogs.*.metastore_id string REMOTE
233+
resources.catalogs.*.modified_status string INPUT
234+
resources.catalogs.*.name string ALL
235+
resources.catalogs.*.options map[string]string ALL
236+
resources.catalogs.*.options.* string ALL
237+
resources.catalogs.*.owner string REMOTE
238+
resources.catalogs.*.properties map[string]string ALL
239+
resources.catalogs.*.properties.* string ALL
240+
resources.catalogs.*.provider_name string ALL
241+
resources.catalogs.*.provisioning_info *catalog.ProvisioningInfo REMOTE
242+
resources.catalogs.*.provisioning_info.state catalog.ProvisioningInfoState REMOTE
243+
resources.catalogs.*.securable_type catalog.SecurableType REMOTE
244+
resources.catalogs.*.share_name string ALL
245+
resources.catalogs.*.storage_location string REMOTE
246+
resources.catalogs.*.storage_root string ALL
247+
resources.catalogs.*.updated_at int64 REMOTE
248+
resources.catalogs.*.updated_by string REMOTE
249+
resources.catalogs.*.url string INPUT
250+
resources.catalogs.*.grants.full_name string ALL
251+
resources.catalogs.*.grants.grants []dresources.GrantAssignment ALL
252+
resources.catalogs.*.grants.grants[*] dresources.GrantAssignment ALL
253+
resources.catalogs.*.grants.grants[*].principal string ALL
254+
resources.catalogs.*.grants.grants[*].privileges []catalog.Privilege ALL
255+
resources.catalogs.*.grants.grants[*].privileges[*] catalog.Privilege ALL
256+
resources.catalogs.*.grants.securable_type string ALL
211257
resources.clusters.*.apply_policy_default_values bool INPUT STATE
212258
resources.clusters.*.autoscale *compute.AutoScale ALL
213259
resources.clusters.*.autoscale.max_workers int ALL
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
bundle:
2+
name: catalog-grants-test_cli_12345
3+
4+
resources:
5+
catalogs:
6+
grants_catalog:
7+
name: catalog_grants_test_cli_12345
8+
comment: "Test catalog for grants"
9+
grants:
10+
- principal: deco-test-user@databricks.com
11+
privileges:
12+
- USE_CATALOG
13+
- CREATE_SCHEMA
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"method": "PATCH",
3+
"path": "/api/2.1/unity-catalog/permissions/catalog/catalog_grants_[UNIQUE_NAME]",
4+
"body": {
5+
"changes": [
6+
{
7+
"add": [
8+
"CREATE_SCHEMA",
9+
"USE_CATALOG"
10+
],
11+
"principal": "deco-test-user@databricks.com",
12+
"remove": [
13+
"ALL_PRIVILEGES"
14+
]
15+
}
16+
]
17+
}
18+
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"method": "PATCH",
3+
"path": "/api/2.1/unity-catalog/permissions/catalog/catalog_grants_[UNIQUE_NAME]",
4+
"body": {
5+
"changes": [
6+
{
7+
"add": [
8+
"USE_CATALOG",
9+
"USE_SCHEMA"
10+
],
11+
"principal": "deco-test-user@databricks.com",
12+
"remove": [
13+
"ALL_PRIVILEGES"
14+
]
15+
}
16+
]
17+
}
18+
}

acceptance/bundle/resources/grants/catalogs/out.destroy.requests.direct.json

Whitespace-only changes.
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"plan_version": 2,
3+
"cli_version": "[DEV_VERSION]",
4+
"plan": {
5+
"resources.catalogs.grants_catalog": {
6+
"action": "create",
7+
"new_state": {
8+
"value": {
9+
"comment": "Test catalog for grants",
10+
"name": "catalog_grants_[UNIQUE_NAME]"
11+
}
12+
}
13+
},
14+
"resources.catalogs.grants_catalog.grants": {
15+
"depends_on": [
16+
{
17+
"node": "resources.catalogs.grants_catalog",
18+
"label": "${resources.catalogs.grants_catalog.id}"
19+
}
20+
],
21+
"action": "create",
22+
"new_state": {
23+
"value": {
24+
"securable_type": "catalog",
25+
"full_name": "",
26+
"grants": [
27+
{
28+
"principal": "deco-test-user@databricks.com",
29+
"privileges": [
30+
"CREATE_SCHEMA",
31+
"USE_CATALOG"
32+
]
33+
}
34+
]
35+
},
36+
"vars": {
37+
"full_name": "${resources.catalogs.grants_catalog.id}"
38+
}
39+
}
40+
}
41+
}
42+
}
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"plan_version": 2,
3+
"cli_version": "[DEV_VERSION]",
4+
"lineage": "[UUID]",
5+
"serial": 1,
6+
"plan": {
7+
"resources.catalogs.grants_catalog": {
8+
"action": "skip",
9+
"remote_state": {
10+
"catalog_type": "MANAGED_CATALOG",
11+
"comment": "Test catalog for grants",
12+
"full_name": "catalog_grants_[UNIQUE_NAME]",
13+
"name": "catalog_grants_[UNIQUE_NAME]",
14+
"owner": "[USERNAME]"
15+
}
16+
},
17+
"resources.catalogs.grants_catalog.grants": {
18+
"depends_on": [
19+
{
20+
"node": "resources.catalogs.grants_catalog",
21+
"label": "${resources.catalogs.grants_catalog.id}"
22+
}
23+
],
24+
"action": "update",
25+
"new_state": {
26+
"value": {
27+
"securable_type": "catalog",
28+
"full_name": "catalog_grants_[UNIQUE_NAME]",
29+
"grants": [
30+
{
31+
"principal": "deco-test-user@databricks.com",
32+
"privileges": [
33+
"USE_CATALOG",
34+
"USE_SCHEMA"
35+
]
36+
}
37+
]
38+
}
39+
},
40+
"remote_state": {
41+
"securable_type": "catalog",
42+
"full_name": "catalog_grants_[UNIQUE_NAME]",
43+
"grants": [
44+
{
45+
"principal": "deco-test-user@databricks.com",
46+
"privileges": [
47+
"CREATE_SCHEMA",
48+
"USE_CATALOG"
49+
]
50+
}
51+
]
52+
},
53+
"changes": {
54+
"grants[0].privileges[0]": {
55+
"action": "update",
56+
"old": "CREATE_SCHEMA",
57+
"new": "USE_CATALOG",
58+
"remote": "CREATE_SCHEMA"
59+
},
60+
"grants[0].privileges[1]": {
61+
"action": "update",
62+
"old": "USE_CATALOG",
63+
"new": "USE_SCHEMA",
64+
"remote": "USE_CATALOG"
65+
}
66+
}
67+
}
68+
}
69+
}

acceptance/bundle/resources/grants/catalogs/out.test.toml

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

acceptance/bundle/resources/grants/catalogs/output.txt

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,18 @@ Plan: 0 to add, 0 to change, 0 to delete, 2 unchanged
3636
>>> [CLI] bundle plan -o json
3737

3838
>>> print_requests.py --get //permissions
39+
{
40+
"method": "GET",
41+
"path": "/api/2.1/unity-catalog/permissions/catalog/catalog_grants_[UNIQUE_NAME]"
42+
}
43+
{
44+
"method": "GET",
45+
"path": "/api/2.1/unity-catalog/permissions/catalog/catalog_grants_[UNIQUE_NAME]"
46+
}
47+
{
48+
"method": "GET",
49+
"path": "/api/2.1/unity-catalog/permissions/catalog/catalog_grants_[UNIQUE_NAME]"
50+
}
3951

4052
>>> [CLI] bundle deploy
4153
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/catalog-grants-[UNIQUE_NAME]/default/files...
@@ -51,7 +63,7 @@ Deployment complete!
5163
{
5264
"principal": "deco-test-user@databricks.com",
5365
"privileges": [
54-
"CREATE_SCHEMA",
66+
"USE_CATALOG",
5567
"USE_SCHEMA"
5668
]
5769
}
@@ -62,9 +74,6 @@ Deployment complete!
6274
The following resources will be deleted:
6375
delete resources.catalogs.grants_catalog
6476

65-
This action will result in the deletion of the following UC catalogs. Any underlying data may be lost:
66-
delete resources.catalogs.grants_catalog
67-
6877
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/catalog-grants-[UNIQUE_NAME]/default
6978

7079
Deleting files...
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[EnvMatrix]
2+
DATABRICKS_BUNDLE_ENGINE = ["direct"]

0 commit comments

Comments
 (0)