'Return the resource metadata.'

def metadata_get(self):

    if (self._parent_stack is None):
        refd_stk = (self._stack_ref and self._stack_ref())
        if (refd_stk is not None):
            return refd_stk[self.name].metadata_get()
    assert (self._stack_id is not None), 'Must    provide    parent    stack    or    ID'
    rs = resource_object.Resource.get_by_name_and_stack(self._context, self.name, self._stack_id)
    if (rs is not None):
        return rs.rsrc_metadata
    return self.t.metadata()
