About Shares

About Shares

Contents

Introduction

The Python SDK allows you to retrieve a list of shared files, share a file, and stop sharing a file. The following examples provide detailed steps that describe how to use supported methods and include code samples to help you get started with shares.

Examples

share

The following code sample shows you how to share a file.

Code Sample

# cloud_file object returned from fullview or metadata calls
share_request = ShareRequest(cloud_file.uri, 'new share name', size=cloud_file.size, type='file')
share = cloud.share(share_request)

shares

The following code sample shows you how to retrieve a list of shared files.

Code Sample

shares, shares_cursor = cloud.shares()

# getting the next page of results
shares, shares_cursor = cloud.shares(cursor=shares_cursor.next)

unshare

The following code sample shows you how to stop sharing a file.

Code Sample

# share returned from shares or share api call
cloud.unshare(share.uid)

Copyright © 2015-2017, Verizon and/or its Licensors. All rights reserved.