اگر لازم دارید که نقش برای همهی آبجکتها بدون فیلتر خاصی اعمال شود یک پریفیکس خالی یا فیلتر با پریفیکس خالی را در نقش قرار دهید:\u003Cbr/>Filter: { Prefix: “”}}\u003C/li>\u003Cli data-block-key=\"56lfi\">یا: Prefix: “”\u003C/li>\u003C/ul>","d0fbb96d-90b2-49eb-b2c8-672fa552c289",{"type":1029,"value":1030,"id":1034},"heading_block",{"heading_text":1031,"size":1032,"link_id":1033},"سادهترین حالت تنظیم LifeCycle:","h2","setting","4b970db2-6674-4f8d-809d-a3141b7caae4",{"type":1012,"value":1036,"id":1038},{"language":1014,"code":1037},"\"Rules\": [\r\n {\r\n \"Expiration\": { \r\n \"Days\": 30, \r\n },\r\n \"ID\": \"ONE_MONTH_EXPIRATION\",\r\n \"Status\": \"Enabled\",\r\n \"Prefix\": \"\",\r\n }\r\n ]\r\n}","db456ef5-7271-4146-ae56-ef1bb4d395fc",{"type":1029,"value":1040,"id":1043},{"heading_text":1041,"size":1032,"link_id":1042},"تمپلیت json لایف سایکل","template","9708c32c-e0cf-4d2f-a5c3-0787e1f68abd",{"type":1012,"value":1045,"id":1047},{"language":1022,"code":1046},"{\r\n\"Rules\": [\r\n {\r\n \"Expiration\": {\r\n \"Date\": timestamp,\r\n \"Days\": integer,\r\n \"ExpiredObjectDeleteMarker\": true|false\r\n },\r\n \"ID\": \"string\",\r\n \"Filter\": {\r\n \"Prefix\": \"string\",\r\n \"Tag\": {\r\n \"Key\": \"string\",\r\n \"Value\": \"string\"\r\n },\r\n \"ObjectSizeGreaterThan\": long,\r\n \"ObjectSizeLessThan\": long,\r\n },\r\n \"Status\": \"Enabled\"|\"Disabled\", \r\n \"NoncurrentVersionExpiration\": {\r\n \"NoncurrentDays\": integer,\r\n \"NewerNoncurrentVersions\": integer\r\n },\r\n \"AbortIncompleteMultipartUpload\": {\r\n \"DaysAfterInitiation\": integer\r\n }\r\n }\r\n ...\r\n ]\r\n}","447d2cd4-77cf-457a-8711-e5e0dfba5779",{"type":1008,"value":1049,"id":1050},"\u003Cp data-block-key=\"kgl3o\">ممکن است در منابع دیگر به کانفیگ Transition بر بخورید. این کانفیگ برای جابجایی خودکار آبجکتها به یک Tier دیگر (معمولا Tier سردتر) پس از مدت مشخصی است. این کانفیگ در حال حاضر قابل تنظیم در کلاستر ستون نیست (چون کلاستر ها Tier مجزا ندارند).\u003C/p>","24eea8d1-0ca3-4dfd-a7e1-f56048caa25d",{"type":1008,"value":1052,"id":1053},"\u003Cp data-block-key=\"tmdnh\">\u003Ca href=\"https://docs.aws.amazon.com/cli/latest/reference/s3api/get-bucket-lifecycle-configuration.html\">Get/List Lifecycle Policy:\u003C/a>\u003C/p>","76922e18-2bd3-4d4f-b4be-2d2cd4e0e87a",{"type":1012,"value":1055,"id":1057},{"language":1014,"code":1056},"aws s3api get-bucket-lifecycle-configuration --endpoint-url s3.thr1.sotoon.ir --bucket my-bucket","468bd1bc-2ea5-4a07-a5ba-7dffa9f50c66",{"type":1008,"value":1059,"id":1060},"\u003Cp data-block-key=\"tmdnh\">\u003Ca href=\"https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-bucket-lifecycle.html\">Delete Lifecycle Policy\u003C/a>:\u003C/p>","6f53bfec-3057-47ed-9d6a-581d952adc71",{"type":1012,"value":1062,"id":1064},{"language":1014,"code":1063},"aws s3api delete-bucket-lifecycle-configuration --endpoint-url s3.thr1.sotoon.ir --bucket my-bucket --account-id rule-id","bb6f14e6-f18d-459e-b940-fdd0e2d9e5d6",{"type":1008,"value":1066,"id":1067},"\u003Cp data-block-key=\"kgl3o\">در این \u003Ca href=\"https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-configuration-examples.html\">لینک\u003C/a> مثالهایی از کانفیگ چرخهی حیات آمده است.\u003C/p>","12420666-1c1a-42e6-a4d6-2b72dea7b469",{"type":1029,"value":1069,"id":1072},{"heading_text":1070,"size":1032,"link_id":1071},"Minio Client","minio-client","b01687fd-0260-43b1-bce7-5cfe829843f2",{"type":1008,"value":1074,"id":1075},"\u003Cp data-block-key=\"tmdnh\">از دستورهای ilm در minio برای مدیریت LifeCycle استفاده میشود. \u003Ca href=\"https://min.io/docs/minio/linux/administration/object-management/object-lifecycle-management.html\">داکیومنت رسمی\u003C/a>.\u003Cbr/>مشاهدهی لیست LifeCycleهای تعریفشده برای باکت:\u003C/p>","2451b24e-40cd-442f-a4b8-beed82999bb4",{"type":1012,"value":1077,"id":1079},{"language":1014,"code":1078},"minio ilm rule export bucket_name","c27de603-f38e-4c4c-986c-f9947854b852",{"type":1008,"value":1081,"id":1082},"\u003Cp data-block-key=\"tmdnh\">یا:\u003C/p>","ee1f96bf-cc69-43fd-b6b7-101ca7be465e",{"type":1012,"value":1084,"id":1086},{"language":1014,"code":1085},"mc ilm ls bucket_name --json","6ddc4988-1177-492a-9098-04549d989419",{"type":1008,"value":1088,"id":1089},"\u003Cp data-block-key=\"tmdnh\">قرار دادن قانون LifeCycle:\u003C/p>","976fafc6-d015-430f-a216-d07b933f5373",{"type":1012,"value":1091,"id":1093},{"language":1014,"code":1092},"minio ilm import bucket_name \u003C\u003CEOF\r\n{\r\n\"Rules\": [\r\n {\r\n \"Expiration\": {\r\n \"Days\": 365\r\n },\r\n \"ID\": \"OneYearExpiration\",\r\n \"Status\": \"Enabled\"\r\n }\r\n]\r\n}\r\nEOF","5292d7f4-8c5f-45e7-a0f1-5a94cb44c39f",{"type":1008,"value":1095,"id":1096},"\u003Cp data-block-key=\"tmdnh\">یا با فایل ورودی:\u003C/p>","c9ac32b7-e527-41ef-8f77-2eda9609555d",{"type":1012,"value":1098,"id":1100},{"language":1014,"code":1099},"mc ilm rule import bucket_name \u003C lc_rule.json","f1e0ffed-e1e1-4828-afc3-5f6f7c664f5a",{"type":1008,"value":1102,"id":1103},"\u003Cp data-block-key=\"tmdnh\">دقت کنید که import، همهی قوانین قبلی را overwrite میکند. اگر صرفا میخواهید یک قانون جدید در کنار قانونهای قبلی اضافه کنید:\u003C/p>","7ba110ff-d996-4dd4-93a2-46311d18aa5b",{"type":1012,"value":1105,"id":1107},{"language":1014,"code":1106},"mc ilm rule add --expire-days 365 bucket_name","ca34b76e-8289-4a68-95db-6d4781f66f75",{"type":1008,"value":1109,"id":1110},"\u003Cp data-block-key=\"tmdnh\">حذف کردن قانون LifeCycle:\u003C/p>","89c0e6b1-f697-4bfc-99dd-66c6107fe346",{"type":1012,"value":1112,"id":1114},{"language":1014,"code":1113},"mc ilm rule rm --id \"rule_ID\" bucket_name","1c608575-24ca-4680-bc14-8292786479e6",{"type":1029,"value":1116,"id":1119},{"heading_text":1117,"size":1032,"link_id":1118},"Boto3 (python client)","boto3","7b973b3f-aee0-4a69-af4d-21134ee062b6",{"type":1008,"value":1121,"id":1122},"\u003Cp data-block-key=\"tmdnh\">script پایتون برای\u003C/p>\u003Cp data-block-key=\"880lj\">۱- قرار دادن LifeCycle انقضای ۳۰ روزهی تمامی آبجکتها\u003C/p>\u003Cp data-block-key=\"18acs\">۲- انقضای ۷ روزه برای آبجکتهایی که با logs شروع میشوند و برچسب backup:true دارند:\u003C/p>","44ab247e-b3aa-44db-81c4-8f0e867dd13f",{"type":1012,"value":1124,"id":1127},{"language":1125,"code":1126},"python","import boto3\r\nimport botocore\r\nimport datetime\r\n\r\n\r\nclass S3client:\r\n def __init__(self, endpoint_url, aws_access_key_id, aws_secret_access_key, path_style):\r\n self.endpoint_url = endpoint_url\r\n self.aws_access_key_id = aws_access_key_id\r\n self.aws_secret_access_key = aws_secret_access_key\r\n self.path_style = path_style\r\n\r\n def configure_path_style(self):\r\n botocore.config.Config(s3=self.path_style)\r\n\r\n def create_connection(self):\r\n connection = boto3.client(\r\n 's3',\r\n endpoint_url=self.endpoint_url,\r\n aws_access_key_id=self.aws_access_key_id,\r\n aws_secret_access_key=self.aws_secret_access_key\r\n )\r\n return connection\r\n\r\n\r\ndef main():\r\n s3client_instance = S3client(\r\n 'http://\u003CENDPOINT>',\r\n '\u003CACCESS_KEY>',\r\n '\u003CSECRET_KEY>',\r\n {\"addressing_style\": \"path\"}\r\n )\r\n s3client_instance.configure_path_style()\r\n s3_connection = s3client_instance.create_connection()\r\n bucket_name = 'BUCKET_NAME'\r\n s3_connection.create_bucket(Bucket=bucket_name)\r\n s3_connection.put_bucket_lifecycle_configuration(\r\n Bucket=bucket_name,\r\n LifecycleConfiguration=\r\n {\r\n \"Rules\": [\r\n {\r\n \"Expiration\": {\r\n \"Days\": 30\r\n },\r\n \"ID\": \"1-month-expiration\",\r\n \"Status\": \"Enabled\"\r\n },\r\n {\r\n \"Expiration\": {\r\n \"Days\": 7\r\n },\r\n \"ID\": \"1-week-tagged-expiration\",\r\n \"Filter\": {\r\n \"Prefix\": \"logs\"\r\n \"Tag\": {\r\n \"Key\": \"backup\",\r\n \"Value\": \"true\"\r\n }\r\n },\r\n \"Status\": \"Enabled\"\r\n }\r\n\r\n ]\r\n }\r\n )\r\n\r\nif __name__ == \"__main__\":\r\n main()","b4388501-325e-44f8-b91e-c39e9ead554b",[1129,1130,1131,1132],{"heading_text":1031,"size":1032,"link_id":1033},{"heading_text":1041,"size":1032,"link_id":1042},{"heading_text":1070,"size":1032,"link_id":1071},{"heading_text":1117,"size":1032,"link_id":1118},{"slug":128,"title":129},["Reactive",1135],{"$snuxt-i18n-meta":1136,"$sroute-nav-config":1137,"$ssite-config":1140},{},{"variant":1138,"position":1139,"container":102},"light","static",{"currentLocale":1141,"description":1142,"env":1143,"name":1144,"url":1145},"fa","Managing Sotoon products showcase","production","sotoon","https://sotoon.ir",["Set"],["ShallowReactive",1148],{"products":-1,"documents:products":-1,"documents:search:":-1,"$APL8jXlmTi":-1},"/docs/storage/object-storage/how-to-guides/LifeCycle"]