<% content_for :arvados_object_table do %>

<%= @object.class %> <%= @object.uuid %>

<%= form_for @object do |f| %> <% @object.attributes_for_display.each do |attr, attrvalue| %> <%= render partial: 'application/arvados_object_attr', locals: { attr: attr, attrvalue: attrvalue } %> <% end %>
<% incoming = Link.where(tail_uuid: @object.uuid) %> <% if incoming.items_available > 0 %>

Incoming Links

<% incoming.each do |link| %> <% end %>
<%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "uuid", attrvalue: link.uuid } %> <%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "link_class", attrvalue: link.link_class } %> <%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "name", attrvalue: link.name } %> <%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "head_uuid", attrvalue: link.head_uuid } %> <%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "properties", attrvalue: link.properties } %>
<% end %> <% outgoing = Link.where(head_uuid: @object.uuid) %> <% if outgoing.items_available > 0 %>

Outgoing Links

<% outgoing.each do |link| %> <% end %>
<%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "uuid", attrvalue: link.uuid } %> <%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "link_class", attrvalue: link.link_class } %> <%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "name", attrvalue: link.name } %> <%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "tail_uuid", attrvalue: link.tail_uuid } %> <%= render partial: 'application/arvados_attr_value', locals: { obj: link, attr: "properties", attrvalue: link.properties } %>
<% end %> <% end %> <% end %> <% if content_for? :page_content %> <%= yield :page_content %> <% else %> <%= yield :arvados_object_table %> <% end %>
<% if content_for? :page_content %>
<%= yield :arvados_object_table %>
<% end %>
<%= JSON.pretty_generate(@object.attributes.reject { |k,v| k == 'id' }) rescue nil %>
      
<% if @object.andand.uuid %>
curl -X PUT \
 -H "Authorization: OAuth2 $ARVADOS_API_TOKEN" \
 --data-urlencode <%= @object.class.to_s.underscore %>@/dev/stdin \
 https://$ARVADOS_API_HOST/arvados/v1/<%= @object.class.to_s.pluralize.underscore %>/<%= @object.uuid %> \
 <<EOF
<%= JSON.pretty_generate({@object.attributes.keys[-3] => @object.attributes.values[-3]}) %>
EOF
      
arv --pretty <%= @object.class.to_s.underscore %> get \
 --uuid <%= @object.uuid %>

arv <%= @object.class.to_s.underscore %> update \
 --uuid <%= @object.uuid %> \
 --<%= @object.class.to_s.underscore.gsub '_', '-' %> '<%= JSON.generate({@object.attributes.keys[-3] => @object.attributes.values[-3]}).gsub("'","'\''") %>'
      
import arvados

x = arvados.api().<%= @object.class.to_s.pluralize.underscore %>().get(uuid='<%= @object.uuid %>').execute()
      
<% end %>