#NEWLINE# def get_object_cdn_url( self , obj , expiry = None , use_object = False ) : #NEWLINE# #INDENT# '\n        Return an object CDN URL.\n\n        :param obj: Object instance\n        :type  obj: :class:`Object`\n\n        :param expiry: Expiry\n        :type expiry: ``str``\n\n        :param use_object: Use object\n        :type use_object: ``bool``\n\n        :rtype: ``str``\n        ' #NEWLINE# if use_object : #NEWLINE# #INDENT# path = ( '/rest/objects' + obj . meta_data [ 'object_id' ] ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# path = ( ( ( '/rest/namespace/' + obj . container . name ) + '/' ) + obj . name ) #NEWLINE# #UNINDENT# if self . secure : #NEWLINE# #INDENT# protocol = 'https' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# protocol = 'http' #NEWLINE# #UNINDENT# expiry = str ( ( expiry or ( int ( time . time ( ) ) + self . DEFAULT_CDN_TTL ) ) ) #NEWLINE# params = [ ( 'uid' , self . key ) , ( 'expires' , expiry ) ] #NEWLINE# params . append ( ( 'signature' , self . _cdn_signature ( path , params , expiry ) ) ) #NEWLINE# params = urlencode ( params ) #NEWLINE# path = ( self . path + path ) #NEWLINE# return urlparse . urlunparse ( ( protocol , self . host , path , '' , params , '' ) )