File tree Expand file tree Collapse file tree 2 files changed +73
-0
lines changed
Expand file tree Collapse file tree 2 files changed +73
-0
lines changed Original file line number Diff line number Diff line change 1+ #!/usr/bin/python
2+
3+ from __future__ import print_function
4+ from botocore .client import Config
5+ from pprint import pprint
6+
7+ import boto3
8+ import json
9+
10+
11+ # endpoint and keys from vstart
12+ endpoint = 'http://127.0.0.1:8101'
13+ access_key = '0555b35654ad1656d804'
14+ secret_key = 'h7GhxuBLTrlhVUyxSPUKUV8r/2EI4ngqJxD7iBdBYLhwluN30JaT3Q=='
15+
16+ client = boto3 .client ('s3' ,
17+ endpoint_url = endpoint ,
18+ aws_access_key_id = access_key ,
19+ aws_secret_access_key = secret_key ,
20+ config = Config (parameter_validation = False ))
21+
22+ response = client .put_bucket_replication (
23+ Bucket = 'sample-bucket' ,
24+ ReplicationConfiguration = {
25+ 'Role' : '' ,
26+ 'Rules' : [
27+ {
28+ 'ID' : 'sample-bucket-rule' ,
29+ "Status" : "Enabled" ,
30+ "Filter" : { "Prefix" : "" },
31+ "Source" : { "Zones" : ["zg1-1" ] },
32+ "Destination" : {"Zones" : ["zg1-1" , "zg1-2" ], "Bucket" : "*" }
33+ }
34+ ]
35+ }
36+ )
37+
38+ pprint (response )
39+
Original file line number Diff line number Diff line change 4646 }
4747 }
4848 },
49+ "ReplicationRule" :{
50+ "members" :{
51+ "Source" : {
52+ "shape" :" S3RepSource" ,
53+ "documentation" :" <p>A container for information about the replication source.<p>" ,
54+ "locationName" :" Source"
55+ }
56+ }
57+ },
58+ "S3RepSource" : {
59+ "type" : " structure" ,
60+ "members" : {
61+ "Zones" : {
62+ "shape" :" ZoneList" ,
63+ "documentation" :" <p>Array of replication source zone names.</p>" ,
64+ "locationName" :" Zone"
65+ }
66+ }
67+ },
68+ "Destination" : {
69+ "members" : {
70+ "Zones" : {
71+ "shape" :" ZoneList" ,
72+ "documentation" :" <p>Array of replication destination zone names.</p>" ,
73+ "locationName" :" Zone"
74+ }
75+ }
76+ },
77+ "ZoneList" : {
78+ "type" :" list" ,
79+ "member" :{"shape" :" Zone" },
80+ "flattened" :true
81+ },
82+ "Zone" :{"type" :" string" },
4983 "AllowUnordered" :{"type" :" boolean" },
5084 "PutObjectRequest" : {
5185 "members" : {
You can’t perform that action at this time.
0 commit comments