|
| 1 | + |
| 2 | +=== Initial summary for resource, before the deployment |
| 3 | +>>> [CLI] bundle summary -o json |
| 4 | +{ |
| 5 | + "catalog_name": "main", |
| 6 | + "comment": "COMMENT1", |
| 7 | + "modified_status": "created", |
| 8 | + "name": "myvolume", |
| 9 | + "schema_name": "myschema", |
| 10 | + "volume_type": "MANAGED" |
| 11 | +} |
| 12 | + |
| 13 | +=== Verify volume does not exist |
| 14 | +>>> musterr [CLI] volumes read main.myschema.myvolume |
| 15 | +Error: Resource catalog.VolumeInfo not found: main.myschema.myvolume |
| 16 | + |
| 17 | +Exit code (musterr): 1 |
| 18 | + |
| 19 | +>>> [CLI] bundle deploy |
| 20 | +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... |
| 21 | +Deploying resources... |
| 22 | +Updating deployment state... |
| 23 | +Deployment complete! |
| 24 | + |
| 25 | +>>> print_requests |
| 26 | +{ |
| 27 | + "method": "POST", |
| 28 | + "path": "/api/2.1/unity-catalog/volumes", |
| 29 | + "body": { |
| 30 | + "catalog_name": "main", |
| 31 | + "comment": "COMMENT1", |
| 32 | + "name": "myvolume", |
| 33 | + "schema_name": "myschema", |
| 34 | + "volume_type": "MANAGED" |
| 35 | + } |
| 36 | +} |
| 37 | + |
| 38 | +=== Summary should now show id and url |
| 39 | +"main.myschema.myvolume" |
| 40 | +"[DATABRICKS_URL]/explore/data/volumes/main/myschema/myvolume?o=[NUMID]" |
| 41 | + |
| 42 | +=== Verify deployment |
| 43 | +>>> [CLI] volumes read main.myschema.myvolume |
| 44 | +{ |
| 45 | + "catalog_name":"main", |
| 46 | + "comment":"COMMENT1", |
| 47 | + "full_name":"main.myschema.myvolume", |
| 48 | + "name":"myvolume", |
| 49 | + "schema_name":"myschema", |
| 50 | + "volume_type":"MANAGED" |
| 51 | +} |
| 52 | + |
| 53 | +=== Update comment |
| 54 | +>>> update_file.py databricks.yml COMMENT1 COMMENT2 |
| 55 | + |
| 56 | +=== Summary should show modified_status=modified and show the same id |
| 57 | +{ |
| 58 | + "catalog_name": "main", |
| 59 | + "comment": "COMMENT2", |
| 60 | + "id": "main.myschema.myvolume", |
| 61 | + "name": "myvolume", |
| 62 | + "schema_name": "myschema", |
| 63 | + "url": "[DATABRICKS_URL]/explore/data/volumes/main/myschema/myvolume?o=[NUMID]", |
| 64 | + "volume_type": "MANAGED" |
| 65 | +} |
| 66 | + |
| 67 | +>>> [CLI] bundle deploy |
| 68 | +Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/test-bundle/default/files... |
| 69 | +Deploying resources... |
| 70 | +Updating deployment state... |
| 71 | +Deployment complete! |
| 72 | + |
| 73 | +>>> print_requests |
| 74 | +{ |
| 75 | + "method": "PATCH", |
| 76 | + "path": "/api/2.1/unity-catalog/volumes/main.myschema.myvolume", |
| 77 | + "body": { |
| 78 | + "comment": "COMMENT2" |
| 79 | + } |
| 80 | +} |
| 81 | + |
| 82 | +=== Verify updated deployment: should show new comment |
| 83 | +>>> [CLI] volumes read main.myschema.myvolume |
| 84 | +"COMMENT2" |
| 85 | + |
| 86 | +>>> [CLI] bundle destroy --auto-approve |
| 87 | +The following resources will be deleted: |
| 88 | + delete volume volume1 |
| 89 | + |
| 90 | +All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/test-bundle/default |
| 91 | + |
| 92 | +Deleting files... |
| 93 | +Destroy complete! |
| 94 | + |
| 95 | +>>> print_requests |
| 96 | +{ |
| 97 | + "method": "DELETE", |
| 98 | + "path": "/api/2.1/unity-catalog/volumes/main.myschema.myvolume" |
| 99 | +} |
| 100 | + |
| 101 | +>>> musterr [CLI] volumes read main.myschema.myvolume |
| 102 | +Error: Resource catalog.VolumeInfo not found: main.myschema.myvolume |
| 103 | + |
| 104 | +Exit code (musterr): 1 |
| 105 | +{ |
| 106 | + "catalog_name": "main", |
| 107 | + "comment": "COMMENT2", |
| 108 | + "modified_status": "created", |
| 109 | + "name": "myvolume", |
| 110 | + "schema_name": "myschema", |
| 111 | + "volume_type": "MANAGED" |
| 112 | +} |
0 commit comments