@@ -27,20 +27,20 @@ NOTE: Due to the specific functionality related to Google Cloud APIs, this guide
27
27
3. A Python environment (https://cloud.google.com/python/setup)
28
28
29
29
** Command-Line Arguments**
30
- * ` project_name ` _ ( Required): Specifies your GCP project name.
31
- * ` --cost_threshold ` _ (Optional, default=0): Sets a relative cost threshold.
32
- * ` --soft_delete_window ` _ (Optional, default= 604800 (i.e. 7 days)): Time window (in seconds) for considering soft-deleted objects..
33
- * ` --agg_days ` _ (Optional, default=30): The period over which to combine and aggregate results.
34
- * ` --lookback_days ` _ (Optional, default=360): Time window (in days) for considering the how old the bucket to be.
35
- * ` --list ` _ (Optional): Produces a simple list of bucket names.
30
+ * ` project_name ` - ( ** Required** ): Specifies your GCP project name.
31
+ * ` --cost_threshold ` - (Optional, default=0): Sets a relative cost threshold.
32
+ * ` --soft_delete_window ` - (Optional, default= 604800 (i.e. 7 days)): Time window (in seconds) for considering soft-deleted objects..
33
+ * ` --agg_days ` - (Optional, default=30): The period over which to combine and aggregate results.
34
+ * ` --lookback_days ` - (Optional, default=360): Time window (in days) for considering the how old the bucket to be.
35
+ * ` --list ` - (Optional, default=False ): Produces a simple list of bucket names.
36
36
37
37
Note: In this sample, cost_threshold 0.15 would spotlight buckets where enabling soft delete might increase costs by over 15%.
38
38
39
39
``` code-block:: bash
40
40
$ python storage_soft_delete_relative_cost_analyzer.py my-project-name
41
41
```
42
42
43
- ** Important Note: ** To disable soft-delete for buckets flagged by the script, follow these steps:
43
+ To disable soft-delete for buckets flagged by the script, follow these steps:
44
44
45
45
``` code-block::bash
46
46
# 1. Run the analyzer to generate a list of buckets exceeding your cost threshold:
@@ -49,4 +49,6 @@ python storage_soft_delete_relative_cost_analyzer.py [your-project-name] --[OTHE
49
49
# 2. Update the buckets using the generated list:
50
50
cat list_of_buckets.txt | gcloud storage buckets update -I --clear-soft-delete
51
51
52
- ```
52
+ ```
53
+
54
+ ** Important Note:** <span style =" color : red ;" >Disabling soft-delete for flagged buckets means when deleting it will permanently delete files. These files cannot be restored, even if a soft-delete policy is later re-enabled.</span >
0 commit comments