ECS: [atmos_headers.py (oc_map)] Check or Set ATMOS and custom x-emc headers
Summary: Check or Set ATMOS and custom x-emc headers.
This article applies to
This article does not apply to
This article is not tied to any specific product.
Not all product versions are identified in this article.
Symptoms
Automation through "oc_map"
Ability to quickly check and set s3 and custom x-emc header.
Ability to quickly perform this operation on a list of objects
Ability to quickly check and set s3 and custom x-emc header.
Ability to quickly perform this operation on a list of objects
Cause
- Tedious manual efforts
- Lack of automation
Resolution
- Download "oc_map" (Contains "atmos_headers.py" under "~/oc_map/suite/"). Download locations under "Notes" section.
- To get usage:
#python atmos_headers.py -h
- Examples/Typical Usage:
~/oc_map/suite> python atmos_headers.py -h ** ATMOS API usage / example: - Check Header on object, example: --> #python atmos_headers.py --api_head <object> --atmos_uid <subtenant>/<user> --ss <secret_key> - Update Header on List of objects, example: --> #python atmos_headers.py --api_put_list test_list_ret --atmos_uid <subtenant>/<user> --ss <secret_key> --update_header <x-emc-header>:<value> ** Get Stats and ETA for current scan: --> #python atmos_headers.py --api_eta --update_cnt 400000
- Example output:
======== Set custom x-emc header ======== ~/oc_map/suite> python atmos_headers.py --api_post_list oid_list2 --data_creds atmos_creds.txt --atmos_type objects --update_header x-emc-retention-period:0 atmos_headers_v1.0.0.0 (oc_map_v3.2.3.2), Started: 01-03-2020 18:30:09 - Performing ATMOS API call "POST" on file list "oid_list2" against bucket "626b78f471a44abca3c07d1e2859df46". --> Updates will occur every 1000 objects. --> Log Location: "/home/admin/oc_map/suite/oc_cache/01-03-2020/18:30:08_626b78f471a44abca3c07d1e2859df46_api_req.log". --> Results Log "/home/admin/oc_map/suite/oc_cache/01-03-2020/18:30:08_ob_api_results.log". -- Content: <BEGIN> <Response [201]> Content-Length: 0 x-emc-request-id: 0af1daba:16eec540ad7:136e0:4 x-emc-delta: 1025 Location: /rest/objects/f7db4712db335bf11ff80fe2a1ce4f1de20d439e0a64d2cfe61f51ad1081bd22-28e46932-bdf4-4be8-a3ad-7907f1e3bec2 Date: Fri, 03 Jan 2020 18:30:10 GMT x-emc-mtime: 1578076210495 x-emc-policy: default <END> [SUCCESS]: 201 [OBJECT]: 01958d72901b4b556c1114d64fa10ec6760beb822d1b87e2d358f0ef02774cd0 : [OID]: f7db4712db335bf11ff80fe2a1ce4f1de20d439e0a64d2cfe61f51ad1081bd22 -- Total Objects Scanned: 1 --> SUCCESS: 1 --> ERROR: 0 --> DUR: 0 (Days) 00:00:00.417 (hh:mm:ss.ms) ======== Confirm custom x-emc header ======== ~/oc_map/suite> python atmos_object.py --api_get_list oid_list3 --data_creds atmos_creds.txt --atmos_type objects --keep_file atmos_object_v1.0.0.0 (oc_map_v3.2.3.2), Started: 01-03-2020 18:31:39 - Performing ATMOS API call "GET" on file list "oid_list3" against bucket "626b78f471a44abca3c07d1e2859df46". --> Updates will occur every 1000 objects. --> Log Location: "/home/admin/oc_map/suite/oc_cache/01-03-2020/18:31:39_626b78f471a44abca3c07d1e2859df46_api_req.log". --> Files copied back, can be found in "/home/admin/oc_map/suite/oc_cache/01-03-2020/18:31:39_call_back_files/". --> Results Log "/home/admin/oc_map/suite/oc_cache/01-03-2020/18:31:39_ob_api_results.log". [SUCCESS]: 200 [OBJECT]: f7db4712db335bf11ff80fe2a1ce4f1de20d439e0a64d2cfe61f51ad1081bd22 -- Content: <BEGIN> <Response [200]> Content-Length: 1025 x-emc-useracl: jk_usr=FULL_CONTROL x-emc-mtime: 1578076210495 x-emc-retention-period: 0 x-emc-meta: user.maui.retentionEnd=2020-01-03T18:30:10Z,user.maui.retentionEnable=true,atime=2020-01-03T18:30:10Z,ctime=2020-01-03T18:30:10Z,current-zone-is-owner=true,itime=2020-01-03T18:30:10Z,mtime=2020-01-03T18:30:10Z,nlink=1,objectid=f7db4712db335bf11ff80fe2a1ce4f1de20d439e0a64d2cfe61f51ad1081bd22,policyname=default,retention=CgIIAA==,size=1025,snapshot-id=0,type=regular,uid=jk_usr,parent=apache,gid=apache x-emc-groupacl: other=NONE ETag: 9fedd0b308bfaa5501f32563454e5d06 Date: Fri, 03 Jan 2020 18:31:40 GMT x-emc-request-id: 0af1daba:16eec540ad7:136f4:0 Content-Type: application/octet-stream x-emc-policy: default <END> -- Total Objects Scanned: 1 --> SUCCESS: 1 --> ERROR: 0 --> DUR: 0 (Days) 00:00:00.059 (hh:mm:ss.ms) - Finished: 01-03-2020 18:31:40, Will now exit.
- Options:
~/oc_map/suite> python atmos_headers.py -h * ATMOS Header Options (Supports all "x-emc" custom headers): --api_head Head file with s3/Atmos API. Argument <file_path> --api_put Write file with s3/Atmos API. Argument <file_path> --api_post Write / update file with s3/Atmos API. Argument <file_path> --api_head_list Head file with s3/Atmos API. Argument <file_list> --api_put_list Write file with s3/Atmos API. Argument <file_list> --api_post_list Write / update files with s3/Atmos API. Argument <file_path> --api_eta Provide Statistics and ETA for current scan. For non-current scan, provide statistics from last scan -q --quiet Suppress printing --quiet_off Disable automatic quiet -w --w_to_log Output to default log ** Enabled by default --no_log Disable logging --update_cnt Number between 1 and 1000000000 ("-s3_bkt_dump" is same as "--max_keys") --api_restart Restarts last failed / stopped scan. Restores all statistics --atmos_uid <subtenant>/<s3_ecs_user> --atmos_ip <ECS_data_IP>:<9022 or 9023> --ss s3 secret key --atmos_type <namespace|objects|auto>, Default = auto --> "auto" only works on GET request, and decides when to use "namespace" or "objects" --atmos_share <share name>. Slashes not needed. Use to create or read from share. Needed to upload full paths --> Not needed for basename file ** CUSTOM HEADER OPERATIONS: --add_header <x-emc_header:value> add "x-emc" header to new file (avoid spaces) --> Cannot be used with options "--s3_create_bkt" and "--atmos_create_bkt" --> Use with "--api_put" and "--api_put_list" --update_header <x-emc_header:value> add "x-emc" header to existing file or new bucket (avoid spaces) --> Can be used with options "--s3_create_bkt" and "--atmos_create_bkt" --> Use with "--api_put" and "--api_put_list" ** CREATE / DELETE BUCKET OPTIONS: --atmos_create_bkt <bucket_name> Create Subtenant / Bucket. To generate random ID, use 'auto' as arg --atmos_delete_bkt <bucket_name> Delete Subtenant / Bucket * Restart Options (list scans only (HEAD/GET/PUT/POST/DELETE) --api_restart Use in addition to your original syntax. This will restart scan right where it left off * Advanced / Secure Options: --secure_options Reference KB 517148 --advanced_options Advanced options
Additional Information
- Latest version of "oc_map" (includes "suite") can be downloaded from:
- https://support.emc.com/kb/503854
- https://asdwiki.isus.emc.com:8443/display/EE/OC_Map.py+%7C+Suite+Tools
- Tool is also available in xDoctor. However, the version may not be the latest.
- WIKI - https://asdwiki.isus.emc.com:8443/display/EE/oc_map+tools+wiki
Affected Products
ECS ApplianceProducts
ECS Appliance Hardware Gen1 U-Series, ECS Appliance Software with Encryption, ECS Appliance Software without EncryptionArticle Properties
Article Number: 000063850
Article Type: Solution
Last Modified: 31 Jan 2023
Version: 3
Find answers to your questions from other Dell users
Support Services
Check if your device is covered by Support Services.