c[:created_at] = l.head.created_at
end
c[:wanted] = true
- if l.owner == current_user.uuid
+ if l.owner_uuid == current_user.uuid
c[:wanted_by_me] = true
end
end
def index
@groups = Group.limit(10000).all
@group_uuids = @groups.collect &:uuid
- @owned_users = User.where owner: @group_uuids
+ @owned_users = User.where owner_uuid: @group_uuids
@links_from = Link.where link_class: 'permission', tail_uuid: @group_uuids
@links_to = Link.where link_class: 'permission', head_uuid: @group_uuids
end
def show
- @collections = Collection.where(owner: @object.uuid)
+ @collections = Collection.where(owner_uuid: @object.uuid)
@names = {}
@keep_flag = {}
@pgp_hu_id = {}
# A Tutorial is a Link which has link_class "resources" and name
# "wants", and is owned by the Tutorials Group (i.e., named
# "Arvados Tutorials" and owned by the system user).
- @tutorial_group = Group.where(owner: User.system.uuid,
+ @tutorial_group = Group.where(owner_uuid: User.system.uuid,
name: 'Arvados Tutorials').first
if @tutorial_group
@tutorial_links = Link.where(tail_uuid: @tutorial_group.uuid,
@attribute_sortkey ||= {
'id' => nil,
'uuid' => '000',
- 'owner' => '001',
+ 'owner_uuid' => '001',
'created_at' => '002',
'modified_at' => '003',
- 'modified_by_user' => '004',
- 'modified_by_client' => '005',
+ 'modified_by_user_uuid' => '004',
+ 'modified_by_client_uuid' => '005',
'name' => '050',
'tail_kind' => '100',
'tail_uuid' => '100',
@kind = resp[:kind]
# these attrs can be modified by "save" -- we should update our copies
- %w(uuid owner created_at
- modified_at modified_by_user modified_by_client
+ %w(uuid owner_uuid created_at
+ modified_at modified_by_user_uuid modified_by_client_uuid
).each do |attr|
if self.respond_to? "#{attr}=".to_sym
self.send(attr + '=', resp[attr.to_sym])
def editable?
(current_user and current_user.is_active and
(current_user.is_admin or
- current_user.uuid == self.owner))
+ current_user.uuid == self.owner_uuid))
end
def attribute_editable?(attr)
- if "created_at modified_at modified_by_user modified_by_client updated_at".index(attr.to_s)
+ if "created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at".index(attr.to_s)
false
elsif not (current_user.andand.is_active)
false
- elsif "uuid owner".index(attr.to_s) or current_user.is_admin
+ elsif "uuid owner_uuid".index(attr.to_s) or current_user.is_admin
current_user.is_admin
else
- current_user.uuid == self.owner or current_user.uuid == self.uuid
+ current_user.uuid == self.owner_uuid or current_user.uuid == self.uuid
end
end
</tr>
<% end %>
<% elsif attrvalue.is_a? String or attrvalue.respond_to? :to_s %>
-<tr class="<%= 'info' if %w(uuid owner created_at modified_at modified_by_user modified_by_client updated_at).index(attr.to_s).nil? %>">
+<tr class="<%= 'info' if %w(uuid owner_uuid created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at).index(attr.to_s).nil? %>">
<td><%= attr %></td>
<% if attr == 'uuid' and (uuid = attrvalue.split('-')).size == 3 %>
<td><%= uuid[0..-2].join('-') %>-<b><%= uuid[-1] %></b></td>
<% else %>
-<% attr_blacklist = 'created_at modified_at modified_by_user modified_by_client updated_at' %>
+<% attr_blacklist = 'created_at modified_at modified_by_user_uuid modified_by_client_uuid updated_at' %>
<table class="table arv-index">
<thead>
</td><td>
<%= g.name %>
</td><td>
- <%= g.owner %>
+ <%= g.owner_uuid %>
</td><td>
<%= @links_to.select { |x| x.head_uuid == g.uuid }.collect(&:tail_uuid).uniq.count %>
</td><td>
<%= @links_from.select { |x| x.tail_uuid == g.uuid }.collect(&:head_uuid).uniq.count %>
</td><td>
- <%= @owned_users.select { |x| x.owner == g.uuid }.count %> users<br />
+ <%= @owned_users.select { |x| x.owner_uuid == g.uuid }.count %> users<br />
</td>
</tr>
</td>
<td>
- <% if current_user and (current_user.is_admin or current_user.uuid == link.owner) %>
+ <% if current_user and (current_user.is_admin or current_user.uuid == link.owner_uuid) %>
<%= link_to raw('<i class="icon-trash"></i>'), { action: 'destroy', id: link.uuid }, { confirm: 'Delete this link?', method: 'delete' } %>
<% end %>
</td>
</td><td>
<%= link_to_if_arvados_object ob.pipeline_template_uuid %>
</td><td>
- <%= link_to_if_arvados_object ob.owner %>
+ <%= link_to_if_arvados_object ob.owner_uuid %>
</td><td>
<% ob.components.each do |cname, c| %>
<% status = if !(c.is_a?(Hash) && c[:job].is_a?(Hash)) then nil elsif c[:job][:success] then 'success' elsif c[:job][:running] then 'info' else 'warning' end %>
</td><td>
<%= ob.name %>
</td><td>
- <%= link_to_if_arvados_object ob.owner %>
+ <%= link_to_if_arvados_object ob.owner_uuid %>
</td><td>
<%= ob.components.collect { |k,v| k.to_s }.join(", ") %>
</td>
</td><td>
<%= render_editable_attribute u, 'is_admin', u.is_admin ? 'Admin' : 'No', "data-type" => "select", "data-source" => '[{value:1,text:"admin"},{value:0,text:"No"}]', "data-value" => u.is_admin ? "1" : "0" %>
</td><td>
- <%= render_editable_attribute u, 'owner' %>
+ <%= render_editable_attribute u, 'owner_uuid' %>
</td><td>
<%= render_editable_attribute u, 'default_owner' %>
</td>
|*Property name*|*Value*|*Description*|
|portable_data_hash|string||
|redundancy|number||
-|redundancy_confirmed_by_client|string|API client|
+|redundancy_confirmed_by_client_uuid|string|API client|
|redundancy_confirmed_at|datetime||
|redundancy_confirmed_as|number||
POST https://{{ site.arvados_api_host }}/arvados/v1/jobs/queue
_method=GET
-where[owner]=xyzzy-tpzed-a4lcehql0dv2u25
+where[owner_uuid]=xyzzy-tpzed-a4lcehql0dv2u25
</pre>
→ Job resource list
|finished_at|datetime|When job finished running|Is null if job has not [yet] finished|
|running|boolean|Whether the job is running||
|success|boolean|Whether the job indicated successful completion|Is null if job has not finished|
-|is_locked_by|string|UUID of the user who has locked this job|Is null if job is not locked. The system user locks the job when starting the job, in order to prevent job attributes from being altered.|
+|is_locked_by_uuid|string|UUID of the user who has locked this job|Is null if job is not locked. The system user locks the job when starting the job, in order to prevent job attributes from being altered.|
h3. Resource limits
table(table table-bordered table-condensed).
|Name|Type|Description|
-|modified_by_client|string|ID of API client|
-|modified_by_user|string|ID of authenticated user|
+|modified_by_client_uuid|string|ID of API client|
+|modified_by_user_uuid|string|ID of authenticated user|
h2. Authorizing a client application
h2(#index). Index, list, search
<pre>
-GET https://{{ site.arvados_api_host }}/arvados/v1/groups?where[owner]=xyzzy-tpzed-a4lcehql0dv2u25
+GET https://{{ site.arvados_api_host }}/arvados/v1/groups?where[owner_uuid]=xyzzy-tpzed-a4lcehql0dv2u25
POST https://{{ site.arvados_api_host }}/arvados/v1/groups
_method=GET
-where[owner]=xyzzy-tpzed-a4lcehql0dv2u25
+where[owner_uuid]=xyzzy-tpzed-a4lcehql0dv2u25
</pre>
→ Group resource list
|self_link|string|||
|owner_uuid|string|UUID of owner (typically User or Project)|@mk2qn-tpzed-a4lcehql0dv2u25@|
|created_at|datetime|When resource was created|@2013-01-21T22:17:39Z@|
-|modified_by_client|string|API client software which most recently modified the resource|@mk2qn-ozdt8-vq8l5qkzj7pr7h7@|
-|modified_by_user|string|Authenticated user, on whose behalf the client was acting when modifying the resource|@mk2qn-tpzed-a4lcehql0dv2u25@|
+|modified_by_client_uuid|string|API client software which most recently modified the resource|@mk2qn-ozdt8-vq8l5qkzj7pr7h7@|
+|modified_by_user_uuid|string|Authenticated user, on whose behalf the client was acting when modifying the resource|@mk2qn-tpzed-a4lcehql0dv2u25@|
|modified_at|datetime|When resource was last modified|@2013-01-25T22:29:32Z@|
h2. Attributes of resource lists
In rails console
- a = ApiClient.new(owner:1); a.save!
+ a = ApiClient.new(owner_uuid:'0'); a.save!
x = ApiClientAuthorization.new(api_client_id:a.id, user_id:1); x.save; x.api_token
task_input = f.as_manifest()
new_task_attrs = {
'job_uuid': current_job()['uuid'],
- 'created_by_job_task': current_task()['uuid'],
+ 'created_by_job_task_uuid': current_task()['uuid'],
'sequence': if_sequence + 1,
'parameters': {
'input':task_input
or_references_me = "OR (#{table_name}.link_class in (#{model_class.sanitize 'permission'}, #{model_class.sanitize 'resources'}) AND #{model_class.sanitize current_user.uuid} IN (#{table_name}.head_uuid, #{table_name}.tail_uuid))"
end
@objects ||= model_class.
- joins("LEFT JOIN links permissions ON permissions.head_uuid in (#{table_name}.owner, #{table_name}.uuid) AND permissions.tail_uuid in (#{sanitized_uuid_list}) AND permissions.link_class='permission'").
- where("?=? OR #{table_name}.owner in (?) OR #{table_name}.uuid=? OR permissions.head_uuid IS NOT NULL #{or_references_me}",
+ joins("LEFT JOIN links permissions ON permissions.head_uuid in (#{table_name}.owner_uuid, #{table_name}.uuid) AND permissions.tail_uuid in (#{sanitized_uuid_list}) AND permissions.link_class='permission'").
+ where("?=? OR #{table_name}.owner_uuid in (?) OR #{table_name}.uuid=? OR permissions.head_uuid IS NOT NULL #{or_references_me}",
true, current_user.is_admin,
uuid_list,
current_user.uuid)
message << " hash provided with request"
raise ArgumentError.new(message)
end
- %w(created_at modified_by_client modified_by_user modified_at).each do |x|
+ %w(created_at modified_by_client_uuid modified_by_user_uuid modified_at).each do |x|
@attrs.delete x
end
@attrs
load_where_param
@where.merge!({
started_at: nil,
- is_locked_by: nil,
+ is_locked_by_uuid: nil,
cancelled_at: nil
})
params[:order] ||= 'priority desc, created_at'
after_initialize :assign_random_api_token
api_accessible :superuser, :extend => :common do |t|
- t.add :owner
+ t.add :owner_uuid
t.add :user_id
t.add :api_client_id
t.add :api_token
t.add :created_by_ip_address
- t.add :default_owner
+ t.add :default_owner_uuid
t.add :expires_at
t.add :last_used_at
t.add :last_used_by_ip_address
self.api_token ||= rand(2**256).to_s(36)
end
- def owner
+ def owner_uuid
self.user.andand.uuid
end
- def owner_was
+ def owner_uuid_was
self.user_id_changed? ? User.find(self.user_id_was).andand.uuid : self.user.andand.uuid
end
- def owner_changed?
+ def owner_uuid_changed?
self.user_id_changed?
end
self.api_token_changed?
end
- def modified_by_client
+ def modified_by_client_uuid
nil
end
- def modified_by_client=(x) end
+ def modified_by_client_uuid=(x) end
- def modified_by_user
+ def modified_by_user_uuid
nil
end
- def modified_by_user=(x) end
+ def modified_by_user_uuid=(x) end
def modified_at
nil
def permission_to_update
(permission_to_create and
not self.user_id_changed? and
- not self.owner_changed?)
+ not self.owner_uuid_changed?)
end
end
include CurrentApiClient # current_user, current_api_client, etc.
attr_protected :created_at
- attr_protected :modified_by_user
- attr_protected :modified_by_client
+ attr_protected :modified_by_user_uuid
+ attr_protected :modified_by_client_uuid
attr_protected :modified_at
before_create :ensure_permission_to_create
before_update :ensure_permission_to_update
return false
end
return true if current_user.is_admin
- if self.owner_changed?
- if current_user.uuid == self.owner or
- current_user.can? write: self.owner
+ if self.owner_uuid_changed?
+ if current_user.uuid == self.owner_uuid or
+ current_user.can? write: self.owner_uuid
# current_user is, or has :write permission on, the new owner
else
- logger.warn "User #{current_user.uuid} tried to change owner of #{self.class.to_s} #{self.uuid} to #{self.owner} but does not have permission to write to #{self.owner}"
+ logger.warn "User #{current_user.uuid} tried to change owner_uuid of #{self.class.to_s} #{self.uuid} to #{self.owner_uuid} but does not have permission to write to #{self.owner_uuid}"
return false
end
end
- if current_user.uuid == self.owner_was or
+ if current_user.uuid == self.owner_uuid_was or
current_user.uuid == self.uuid or
- current_user.can? write: self.owner_was
+ current_user.can? write: self.owner_uuid_was
# current user is, or has :write permission on, the previous owner
return true
else
- logger.warn "User #{current_user.uuid} tried to modify #{self.class.to_s} #{self.uuid} but does not have permission to write #{self.owner_was}"
+ logger.warn "User #{current_user.uuid} tried to modify #{self.class.to_s} #{self.uuid} but does not have permission to write #{self.owner_uuid_was}"
return false
end
end
def update_modified_by_fields
self.created_at ||= Time.now
- self.owner ||= current_default_owner
+ self.owner_uuid ||= current_default_owner
self.modified_at = Time.now
- self.modified_by_user = current_user ? current_user.uuid : nil
- self.modified_by_client = current_api_client ? current_api_client.uuid : nil
+ self.modified_by_user_uuid = current_user ? current_user.uuid : nil
+ self.modified_by_client_uuid = current_api_client ? current_api_client.uuid : nil
end
def ensure_serialized_attribute_type
t.add :output
t.add :success
t.add :running
- t.add :is_locked_by
+ t.add :is_locked_by_uuid
t.add :log
t.add :resource_limits
t.add :tasks_summary
end
def self.queue
- self.where('started_at is ? and is_locked_by is ? and cancelled_at is ?',
+ self.where('started_at is ? and is_locked_by_uuid is ? and cancelled_at is ?',
nil, nil, nil).
order('priority desc, created_at')
end
protected
def ensure_script_version_is_commit
- if self.is_locked_by and self.started_at
+ if self.is_locked_by_uuid and self.started_at
# Apparently client has already decided to go for it. This is
# needed to run a local job using a local working directory
# instead of a commit-ish.
elsif is_locked_by_was and is_locked_by_was != current_user.uuid
logger.warn "User #{current_user.uuid} tried to steal lock on #{self.class.to_s} #{uuid_was} from #{is_locked_by_was}"
false
- elsif !is_locked_by.nil? and is_locked_by != current_user.uuid
- logger.warn "User #{current_user.uuid} tried to lock #{self.class.to_s} #{uuid_was} with uuid #{is_locked_by}"
+ elsif !is_locked_by_uuid.nil? and is_locked_by_uuid != current_user.uuid
+ logger.warn "User #{current_user.uuid} tried to lock #{self.class.to_s} #{uuid_was} with uuid #{is_locked_by_uuid}"
false
else
super
api_accessible :superuser, :extend => :common do |t|
t.add :job_uuid
- t.add :created_by_job_task
+ t.add :created_by_job_task_uuid
t.add :sequence
t.add :qsequence
t.add :parameters
def delete_created_job_tasks_if_failed
if self.success == false and self.success != self.success_was
- JobTask.delete_all ['created_by_job_task = ?', self.uuid]
+ JobTask.delete_all ['created_by_job_task_uuid = ?', self.uuid]
end
end
# xxx qsequence should be sequential as advertised; for now at
# least it's non-decreasing.
JobTask.update_all(['qsequence = ?', (Time.now.to_f*10000000).to_i],
- ['created_by_job_task = ?', self.uuid])
+ ['created_by_job_task_uuid = ?', self.uuid])
end
end
end
where('uuid=?',head_uuid).
first
if head_obj
- return true if head_obj.owner == current_user.uuid
+ return true if head_obj.owner_uuid == current_user.uuid
end
# Users with "can_grant" permission on an object can grant
next if target_uuid == self.uuid
next if (group_permissions[target_uuid] and
group_permissions[target_uuid][action])
- if target.respond_to? :owner
- next if target.owner == self.uuid
- next if (group_permissions[target.owner] and
- group_permissions[target.owner][action])
+ if target.respond_to? :owner_uuid
+ next if target.owner_uuid == self.uuid
+ next if (group_permissions[target.owner_uuid] and
+ group_permissions[target.owner_uuid][action])
end
return false
end
--- /dev/null
+class RenameForeignUuidAttributes < ActiveRecord::Migration
+ def change
+ rename_column :api_client_authorizations, :default_owner, :default_owner_uuid
+ [:api_clients, :authorized_keys, :collections,
+ :groups, :humans, :job_tasks, :jobs, :keep_disks,
+ :links, :logs, :nodes, :pipeline_instances, :pipeline_templates,
+ :repositories, :specimens, :traits, :users, :virtual_machines].each do |t|
+ rename_column t, :owner, :owner_uuid
+ rename_column t, :modified_by_client, :modified_by_client_uuid
+ rename_column t, :modified_by_user, :modified_by_user_uuid
+ end
+ rename_column :collections, :redundancy_confirmed_by_client, :redundancy_confirmed_by_client_uuid
+ rename_column :jobs, :is_locked_by, :is_locked_by_uuid
+ rename_column :job_tasks, :created_by_job_task, :created_by_job_task_uuid
+ end
+end
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20130627184333) do
+ActiveRecord::Schema.define(:version => 20130708163414) do
create_table "api_client_authorizations", :force => true do |t|
t.string "api_token", :null => false
t.datetime "expires_at"
t.datetime "created_at"
t.datetime "updated_at"
- t.string "default_owner"
+ t.string "default_owner_uuid"
end
add_index "api_client_authorizations", ["api_client_id"], :name => "index_api_client_authorizations_on_api_client_id"
create_table "api_clients", :force => true do |t|
t.string "uuid"
- t.string "owner"
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "owner_uuid"
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.string "name"
t.string "url_prefix"
t.datetime "created_at"
t.datetime "updated_at"
- t.boolean "is_trusted", :default => false
+ t.boolean "is_trusted", :default => false
end
add_index "api_clients", ["created_at"], :name => "index_api_clients_on_created_at"
add_index "api_clients", ["uuid"], :name => "index_api_clients_on_uuid", :unique => true
create_table "authorized_keys", :force => true do |t|
- t.string "uuid", :null => false
- t.string "owner", :null => false
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "uuid", :null => false
+ t.string "owner_uuid", :null => false
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.string "name"
t.string "key_type"
create_table "collections", :force => true do |t|
t.string "locator"
- t.string "owner"
+ t.string "owner_uuid"
t.datetime "created_at"
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.string "portable_data_hash"
t.string "name"
t.integer "redundancy"
- t.string "redundancy_confirmed_by_client"
+ t.string "redundancy_confirmed_by_client_uuid"
t.datetime "redundancy_confirmed_at"
t.integer "redundancy_confirmed_as"
t.datetime "updated_at"
create_table "groups", :force => true do |t|
t.string "uuid"
- t.string "owner"
+ t.string "owner_uuid"
t.datetime "created_at"
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.string "name"
t.text "description"
add_index "groups", ["uuid"], :name => "index_groups_on_uuid", :unique => true
create_table "humans", :force => true do |t|
- t.string "uuid", :null => false
- t.string "owner", :null => false
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "uuid", :null => false
+ t.string "owner_uuid", :null => false
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.text "properties"
t.datetime "created_at"
create_table "job_tasks", :force => true do |t|
t.string "uuid"
- t.string "owner"
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "owner_uuid"
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.string "job_uuid"
t.integer "sequence"
t.boolean "success"
t.datetime "created_at"
t.datetime "updated_at"
- t.string "created_by_job_task"
- t.integer "qsequence", :limit => 8
+ t.string "created_by_job_task_uuid"
+ t.integer "qsequence", :limit => 8
end
add_index "job_tasks", ["created_at"], :name => "index_job_tasks_on_created_at"
create_table "jobs", :force => true do |t|
t.string "uuid"
- t.string "owner"
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "owner_uuid"
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.string "submit_id"
t.string "script"
t.datetime "created_at"
t.datetime "updated_at"
t.string "priority"
- t.string "is_locked_by"
+ t.string "is_locked_by_uuid"
t.string "log"
t.text "tasks_summary"
t.text "resource_limits"
add_index "jobs", ["uuid"], :name => "index_jobs_on_uuid", :unique => true
create_table "keep_disks", :force => true do |t|
- t.string "uuid", :null => false
- t.string "owner", :null => false
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "uuid", :null => false
+ t.string "owner_uuid", :null => false
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
- t.string "ping_secret", :null => false
+ t.string "ping_secret", :null => false
t.string "node_uuid"
t.string "filesystem_uuid"
t.integer "bytes_total"
t.integer "bytes_free"
- t.boolean "is_readable", :default => true, :null => false
- t.boolean "is_writable", :default => true, :null => false
+ t.boolean "is_readable", :default => true, :null => false
+ t.boolean "is_writable", :default => true, :null => false
t.datetime "last_read_at"
t.datetime "last_write_at"
t.datetime "last_ping_at"
create_table "links", :force => true do |t|
t.string "uuid"
- t.string "owner"
+ t.string "owner_uuid"
t.datetime "created_at"
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.string "tail_uuid"
t.string "tail_kind"
create_table "logs", :force => true do |t|
t.string "uuid"
- t.string "owner"
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "owner_uuid"
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.string "object_kind"
t.string "object_uuid"
t.datetime "event_at"
create_table "nodes", :force => true do |t|
t.string "uuid"
- t.string "owner"
+ t.string "owner_uuid"
t.datetime "created_at"
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.integer "slot_number"
t.string "hostname"
create_table "pipeline_instances", :force => true do |t|
t.string "uuid"
- t.string "owner"
+ t.string "owner_uuid"
t.datetime "created_at"
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.string "pipeline_template_uuid"
t.string "name"
t.text "components"
t.boolean "success"
- t.boolean "active", :default => false
+ t.boolean "active", :default => false
t.datetime "updated_at"
t.text "properties"
end
create_table "pipeline_templates", :force => true do |t|
t.string "uuid"
- t.string "owner"
+ t.string "owner_uuid"
t.datetime "created_at"
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.string "name"
t.text "components"
add_index "pipeline_templates", ["uuid"], :name => "index_pipeline_templates_on_uuid", :unique => true
create_table "repositories", :force => true do |t|
- t.string "uuid", :null => false
- t.string "owner", :null => false
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "uuid", :null => false
+ t.string "owner_uuid", :null => false
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.string "name"
t.string "fetch_url"
create_table "specimens", :force => true do |t|
t.string "uuid"
- t.string "owner"
+ t.string "owner_uuid"
t.datetime "created_at"
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.string "material"
t.datetime "updated_at"
add_index "specimens", ["uuid"], :name => "index_specimens_on_uuid", :unique => true
create_table "traits", :force => true do |t|
- t.string "uuid", :null => false
- t.string "owner", :null => false
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "uuid", :null => false
+ t.string "owner_uuid", :null => false
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.string "name"
t.text "properties"
create_table "users", :force => true do |t|
t.string "uuid"
- t.string "owner"
+ t.string "owner_uuid"
t.datetime "created_at"
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.string "email"
t.string "first_name"
t.text "prefs"
t.datetime "updated_at"
t.string "default_owner"
- t.boolean "is_active", :default => false
+ t.boolean "is_active", :default => false
end
add_index "users", ["created_at"], :name => "index_users_on_created_at"
add_index "users", ["uuid"], :name => "index_users_on_uuid", :unique => true
create_table "virtual_machines", :force => true do |t|
- t.string "uuid", :null => false
- t.string "owner", :null => false
- t.string "modified_by_client"
- t.string "modified_by_user"
+ t.string "uuid", :null => false
+ t.string "owner_uuid", :null => false
+ t.string "modified_by_client_uuid"
+ t.string "modified_by_user_uuid"
t.datetime "modified_at"
t.string "hostname"
t.datetime "created_at"
t.add :kind
t.add :etag
t.add :uuid
- t.add :owner
+ t.add :owner_uuid
t.add :created_at
- t.add :modified_by_client
- t.add :modified_by_user
+ t.add :modified_by_client_uuid
+ t.add :modified_by_user_uuid
t.add :modified_at
t.add :updated_at
end
end
def current_default_owner
- # owner uuid for newly created objects
+ # owner_uuid for newly created objects
((current_api_client_authorization &&
current_api_client_authorization.default_owner) ||
(current_user && current_user.default_owner) ||
end
job_auth = ApiClientAuthorization.
- new(user: User.where('uuid=?', job.modified_by_user).first,
+ new(user: User.where('uuid=?', job.modified_by_user_uuid).first,
api_client_id: 0)
job_auth.save
uuid: MyString
created_by_client: MyString
created_by_user: MyString
- modified_by_client: MyString
- modified_by_user: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
modified_at: 2013-01-23 10:02:24
name: MyString
url_prefix: MyString
uuid: MyString
created_by_client: MyString
created_by_user: MyString
- modified_by_client: MyString
- modified_by_user: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
modified_at: 2013-01-23 10:02:24
name: MyString
url_prefix: MyString
one:
uuid: MyString
- owner: MyString
- modified_by_client: MyString
- modified_by_user: MyString
+ owner_uuid: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
modified_at: 2013-06-06 14:35:19
name: MyString
key_type: MyString
two:
uuid: MyString
- owner: MyString
- modified_by_client: MyString
- modified_by_user: MyString
+ owner_uuid: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
modified_at: 2013-06-06 14:35:19
name: MyString
key_type: MyString
created_by_client: MyString
created_by_user: MyString
created_at: 2012-10-15 20:50:09
- modified_by_client: MyString
- modified_by_user: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
modified_at: 2012-10-15 20:50:09
portable_data_hash: MyString
name: MyString
redundancy: 1
- redundancy_confirmed_by_client: MyString
+ redundancy_confirmed_by_client_uuid: MyString
redundancy_confirmed_at: 2012-10-15 20:50:09
redundancy_confirmed_as: 1
created_by_client: MyString
created_by_user: MyString
created_at: 2012-10-15 20:50:09
- modified_by_client: MyString
- modified_by_user: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
modified_at: 2012-10-15 20:50:09
portable_data_hash: MyString
name: MyString
redundancy: 1
- redundancy_confirmed_by_client: MyString
+ redundancy_confirmed_by_client_uuid: MyString
redundancy_confirmed_at: 2012-10-15 20:50:09
redundancy_confirmed_as: 1
one:
uuid: MyString
- owner: MyString
- modified_by_client: MyString
- modified_by_user: MyString
+ owner_uuid: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
modified_at: 2013-06-27 14:43:33
properties: MyText
two:
uuid: MyString
- owner: MyString
- modified_by_client: MyString
- modified_by_user: MyString
+ owner_uuid: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
modified_at: 2013-06-27 14:43:33
properties: MyText
uuid: MyString
created_by_client: MyString
created_by_user: MyString
- modified_by_client: MyString
- modified_by_user: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
object_kind: MyString
object_uuid: MyString
event_at: 2013-01-22 12:14:42
uuid: MyString
created_by_client: MyString
created_by_user: MyString
- modified_by_client: MyString
- modified_by_user: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
object_kind: MyString
object_uuid: MyString
event_at: 2013-01-22 12:14:42
created_by_client: MyString
created_by_user: MyString
modified_at: 2013-01-15 18:42:33
- modified_by_client: MyString
- modified_by_user: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
material: MyString
two:
created_by_client: MyString
created_by_user: MyString
modified_at: 2013-01-15 18:42:33
- modified_by_client: MyString
- modified_by_user: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
material: MyString
one:
uuid: MyString
- owner: MyString
- modified_by_client: MyString
- modified_by_user: MyString
+ owner_uuid: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
modified_at: 2013-06-27 11:45:37
name: MyString
properties: MyText
two:
uuid: MyString
- owner: MyString
- modified_by_client: MyString
- modified_by_user: MyString
+ owner_uuid: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
modified_at: 2013-06-27 11:45:37
name: MyString
properties: MyText
created_by_client: MyString
created_by_user: MyString
created_at: 2013-01-21 21:00:42
- modified_by_client: MyString
- modified_by_user: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
modified_at: 2013-01-21 21:00:42
email: MyString
first_name: MyString
created_by_client: MyString
created_by_user: MyString
created_at: 2013-01-21 21:00:42
- modified_by_client: MyString
- modified_by_user: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
modified_at: 2013-01-21 21:00:42
email: MyString
first_name: MyString
one:
uuid: MyString
- owner: MyString
- modified_by_client: MyString
- modified_by_user: MyString
+ owner_uuid: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
modified_at: 2013-06-08 01:37:30
hostname: MyString
two:
uuid: MyString
- owner: MyString
- modified_by_client: MyString
- modified_by_user: MyString
+ owner_uuid: MyString
+ modified_by_client_uuid: MyString
+ modified_by_user_uuid: MyString
modified_at: 2013-06-08 01:37:30
hostname: MyString
{
$Job = $arv->{'jobs'}->{'get'}->execute('uuid' => $jobspec);
if (!$force_unlock) {
- if ($Job->{'is_locked_by'}) {
- croak("Job is locked: " . $Job->{'is_locked_by'});
+ if ($Job->{'is_locked_by_uuid'}) {
+ croak("Job is locked: " . $Job->{'is_locked_by_uuid'});
}
if ($Job->{'success'} ne undef) {
croak("Job 'success' flag (" . $Job->{'success'} . ") is not null");
qw(script script_version script_parameters);
}
- $Job->{'is_locked_by'} = $User->{'uuid'};
+ $Job->{'is_locked_by_uuid'} = $User->{'uuid'};
$Job->{'started_at'} = gmtime;
$Job = $arv->{'jobs'}->{'create'}->execute('job' => $Job);
{
# Claim this job, and make sure nobody else does
- $Job->{'is_locked_by'} = $User->{'uuid'};
+ $Job->{'is_locked_by_uuid'} = $User->{'uuid'};
$Job->{'started_at'} = gmtime;
$Job->{'running'} = 1;
$Job->{'success'} = undef;
'running' => 0,
'done' => 0 };
if ($job_has_uuid) {
- unless ($Job->save() && $Job->{'is_locked_by'} == $User->{'uuid'}) {
+ unless ($Job->save() && $Job->{'is_locked_by_uuid'} == $User->{'uuid'}) {
croak("Error while updating / locking job");
}
}
# Load new tasks
my $newtask_list = $arv->{'job_tasks'}->{'list'}->execute(
'where' => {
- 'created_by_job_task' => $Jobstep->{'arvados_task'}->{uuid}
+ 'created_by_job_task_uuid' => $Jobstep->{'arvados_task'}->{uuid}
},
'order' => 'qsequence'
);