Skip to content

Commit 10afd0d

Browse files
author
x00403408
committed
upload 3.19.5
1 parent ed9bfe7 commit 10afd0d

36 files changed

+4715
-4441
lines changed

examples/bucket_operations_sample.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/python
22
# -*- coding:utf-8 -*-
3+
# Copyright 2019 Huawei Technologies Co.,Ltd.
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
10+
# Unless required by applicable law or agreed to in writing, software distributed
11+
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12+
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
314

415
'''
516
This sample demonstrates how to do bucket-related operations
@@ -51,6 +62,21 @@ def doBucketQuotaOperation():
5162
resp = bucketClient.getBucketQuota()
5263

5364
print('Getting bucket quota ' + str(resp.body) + ' \n')
65+
66+
def doBucketEncryptionOperation():
67+
print('Setting bucket encryption\n')
68+
# obsClient.setBucketEncryption(bucketName, 'kms')
69+
bucketClient.setBucketEncryption('kms')
70+
71+
print('Getting bucket encryption\n')
72+
# resp = obsClient.getBucketEncryption(bucketName)
73+
resp = bucketClient.getBucketEncryption()
74+
print('\t' + str(resp.body) + '\n')
75+
76+
print('Deleting bucket encryption\n')
77+
# obsClient.deleteBucketEncryption(bucketName)
78+
bucketClient.deleteBucketEncryption()
79+
5480

5581
def doBucketVersioningOperation():
5682
# print('Getting bucket versioning config ' + str(obsClient.getBucketVersioning(bucketName).body) + ' \n')
@@ -207,6 +233,9 @@ def deleteBucket():
207233
# Put/Get bucket quota operations
208234
doBucketQuotaOperation()
209235

236+
# Put/Get/Delete encryption operations
237+
doBucketEncryptionOperation()
238+
210239
# Put/Get bucket versioning operations
211240
doBucketVersioningOperation()
212241

examples/concurrent_copy_part_sample.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/python
22
# -*- coding:utf-8 -*-
3+
# Copyright 2019 Huawei Technologies Co.,Ltd.
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
10+
# Unless required by applicable law or agreed to in writing, software distributed
11+
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12+
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
314

415
'''
516
This sample demonstrates how to multipart upload an object concurrently by copy mode

examples/concurrent_download_object_sample.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/python
22
# -*- coding:utf-8 -*-
3+
# Copyright 2019 Huawei Technologies Co.,Ltd.
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
10+
# Unless required by applicable law or agreed to in writing, software distributed
11+
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12+
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
314

415
'''
516
This sample demonstrates how to download an object concurrently

examples/concurrent_upload_part_sample.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/python
22
# -*- coding:utf-8 -*-
3+
# Copyright 2019 Huawei Technologies Co.,Ltd.
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
10+
# Unless required by applicable law or agreed to in writing, software distributed
11+
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12+
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
314

415
'''
516
This sample demonstrates how to multipart upload an object concurrently

examples/create_folder_sample.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/python
22
# -*- coding:utf-8 -*-
3+
# Copyright 2019 Huawei Technologies Co.,Ltd.
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
10+
# Unless required by applicable law or agreed to in writing, software distributed
11+
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12+
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
314

415
'''
516
This sample demonstrates how to create an empty folder under

examples/delete_objects_sample.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/python
22
# -*- coding:utf-8 -*-
3+
# Copyright 2019 Huawei Technologies Co.,Ltd.
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
10+
# Unless required by applicable law or agreed to in writing, software distributed
11+
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12+
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
314

415
'''
516
This sample demonstrates how to delete objects under specified bucket

examples/download_sample.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/python
22
# -*- coding:utf-8 -*-
3+
# Copyright 2019 Huawei Technologies Co.,Ltd.
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
10+
# Unless required by applicable law or agreed to in writing, software distributed
11+
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12+
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
314

415
'''
516
This sample demonstrates how to download an object

examples/list_objects_in_folder_sample.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/python
22
# -*- coding:utf-8 -*-
3+
# Copyright 2019 Huawei Technologies Co.,Ltd.
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
10+
# Unless required by applicable law or agreed to in writing, software distributed
11+
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12+
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
314

415
'''
516
This sample demonstrates how to list objects under a specified folder of a bucket

examples/list_objects_sample.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/python
22
# -*- coding:utf-8 -*-
3+
# Copyright 2019 Huawei Technologies Co.,Ltd.
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
10+
# Unless required by applicable law or agreed to in writing, software distributed
11+
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12+
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
314

415
'''
516
This sample demonstrates how to list objects under specified bucket

examples/list_versions_sample.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/usr/bin/python
22
# -*- coding:utf-8 -*-
3+
# Copyright 2019 Huawei Technologies Co.,Ltd.
4+
# Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5+
# this file except in compliance with the License. You may obtain a copy of the
6+
# License at
7+
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
10+
# Unless required by applicable law or agreed to in writing, software distributed
11+
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
12+
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
13+
# specific language governing permissions and limitations under the License.
314

415
'''
516
This sample demonstrates how to list versions under specified bucket

0 commit comments

Comments
 (0)