#NEWLINE# def show( self , request , instance , extend_address = True ) : #NEWLINE# #INDENT# 'Detailed view of a single instance.' #NEWLINE# server = { #NEWLINE# #INDENT# 'server' : { #NEWLINE# #INDENT# 'id' : instance [ 'uuid' ] , #NEWLINE# 'name' : instance [ 'display_name' ] , #NEWLINE# 'status' : self . _get_vm_status ( instance ) , #NEWLINE# 'tenant_id' : ( instance . get ( 'project_id' ) or '' ) , #NEWLINE# 'user_id' : ( instance . get ( 'user_id' ) or '' ) , #NEWLINE# 'metadata' : self . _get_metadata ( instance ) , #NEWLINE# 'hostId' : ( self . _get_host_id ( instance ) or '' ) , #NEWLINE# 'image' : self . _get_image ( request , instance ) , #NEWLINE# 'flavor' : self . _get_flavor ( request , instance ) , #NEWLINE# 'created' : utils . isotime ( instance [ 'created_at' ] ) , #NEWLINE# 'updated' : utils . isotime ( instance [ 'updated_at' ] ) , #NEWLINE# 'addresses' : self . _get_addresses ( request , instance , extend_address ) , #NEWLINE# 'links' : self . _get_links ( request , instance [ 'uuid' ] , self . _collection_name ) , #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# if ( server [ 'server' ] [ 'status' ] in self . _fault_statuses ) : #NEWLINE# #INDENT# _inst_fault = self . _get_fault ( request , instance ) #NEWLINE# if _inst_fault : #NEWLINE# #INDENT# server [ 'server' ] [ 'fault' ] = _inst_fault #NEWLINE# #UNINDENT# #UNINDENT# if ( server [ 'server' ] [ 'status' ] in self . _progress_statuses ) : #NEWLINE# #INDENT# server [ 'server' ] [ 'progress' ] = instance . get ( 'progress' , 0 ) #NEWLINE# #UNINDENT# if api_version_request . is_supported ( request , min_version = '2.9' ) : #NEWLINE# #INDENT# server [ 'server' ] [ 'locked' ] = ( True if instance [ 'locked_by' ] else False ) #NEWLINE# #UNINDENT# if api_version_request . is_supported ( request , min_version = '2.19' ) : #NEWLINE# #INDENT# server [ 'server' ] [ 'description' ] = instance . get ( 'display_description' ) #NEWLINE# #UNINDENT# return server