--- /dev/null
+# Place all the behaviors and hooks related to the matching controller here.
+# All this logic will automatically be available in application.js.
+# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
--- /dev/null
+// Place all the styles related to the PipelineInvocations controller here.
+// They will automatically be included in application.css.
+// You can use Sass (SCSS) here: http://sass-lang.com/
def create
@attrs = params[resource_name]
+ if @attrs.nil?
+ raise "no #{resource_name} provided with request #{params.inspect}"
+ end
if @attrs.class == String
@attrs = uncamelcase_hash_keys(JSON.parse @attrs)
end
end
def uncamelcase_params_hash_keys
- uncamelcase_hash_keys(params)
+ self.params = uncamelcase_hash_keys(params)
end
def uncamelcase_hash_keys(h)
--- /dev/null
+class Orvos::V1::PipelineInvocationsController < ApplicationController
+end
--- /dev/null
+module PipelineInvocationsHelper
+end
--- /dev/null
+class PipelineInvocation < ActiveRecord::Base
+ include AssignUuid
+ serialize :components, Hash
+ belongs_to :pipeline, :foreign_key => :pipeline_uuid, :primary_key => :uuid
+
+ after_validation :bootstrap_components
+
+ protected
+ def bootstrap_components
+ if pipeline and (!components or components.empty?)
+ self.components = pipeline.components
+ end
+ end
+end
Server::Application.routes.draw do
- resources :pipelines
- resources :nodes
- resources :collections
- resources :metadata
-
# The priority is based upon order of creation:
# first created -> highest priority.
resources :metadata
resources :nodes
resources :pipelines
+ resources :pipeline_invocations
match '/nodes/:uuid/ping' => 'nodes#ping', :as => :ping_node
match '/metadata/:target_kind/:target_uuid' => 'metadata#index'
end
--- /dev/null
+class CreatePipelineInvocations < ActiveRecord::Migration
+ def up
+ create_table :pipeline_invocations do |t|
+ t.string :uuid
+ t.string :created_by_client
+ t.string :created_by_user
+ t.datetime :created_at
+ t.string :modified_by_client
+ t.string :modified_by_user
+ t.datetime :modified_at
+ t.string :pipeline_uuid
+ t.string :name
+ t.text :components
+ t.boolean :success, :null => true
+ t.boolean :active, :default => false
+
+ t.timestamps
+ end
+ add_index :pipeline_invocations, :uuid, :unique => true
+ end
+ def down
+ drop_table :pipeline_invocations
+ end
+end
-# encoding: UTF-8
# This file is auto-generated from the current state of the database. Instead
# of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition.
#
# It's strongly recommended to check this file into your version control system.
-ActiveRecord::Schema.define(:version => 20130109175700) do
+ActiveRecord::Schema.define(:version => 20130109220548) do
create_table "collections", :force => true do |t|
t.string "locator"
add_index "nodes", ["slot_number"], :name => "index_nodes_on_slot_number", :unique => true
add_index "nodes", ["uuid"], :name => "index_nodes_on_uuid", :unique => true
+ create_table "pipeline_invocations", :force => true do |t|
+ t.string "uuid"
+ t.string "created_by_client"
+ t.string "created_by_user"
+ t.datetime "created_at"
+ t.string "modified_by_client"
+ t.string "modified_by_user"
+ t.datetime "modified_at"
+ t.string "pipeline_uuid"
+ t.string "name"
+ t.text "components"
+ t.boolean "success"
+ t.boolean "active", :default => false
+ t.datetime "updated_at"
+ end
+
+ add_index "pipeline_invocations", ["uuid"], :name => "index_pipeline_invocations_on_uuid", :unique => true
+
create_table "pipelines", :force => true do |t|
t.string "uuid"
t.string "created_by_client"
--- /dev/null
+# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/Fixtures.html
+
+# This model initially had no columns defined. If you add columns to the
+# model remove the '{}' from the fixture names and add the columns immediately
+# below each fixture, per the syntax in the comments below
+#
+one: {}
+# column: value
+#
+two: {}
+# column: value
--- /dev/null
+require 'test_helper'
+
+class PipelineInvocationsControllerTest < ActionController::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end
--- /dev/null
+require 'test_helper'
+
+class PipelineInvocationsHelperTest < ActionView::TestCase
+end
--- /dev/null
+require 'test_helper'
+
+class PipelineInvocationTest < ActiveSupport::TestCase
+ # test "the truth" do
+ # assert true
+ # end
+end