Class: Conductor::Metadata
- Defined in:
- lib/nf-conductor/http/metadata.rb
Instance Attribute Summary
Attributes inherited from Model
Class Method Summary collapse
-
.create_or_update_workflows(workflow_list) ⇒ Object
PUT /metadata/workflow Create or update workflow definition.
-
.create_tasks(task_list) ⇒ Object
POST /metadata/taskdefs Create new task definition(s) 204 success.
-
.create_workflow(workflow) ⇒ Object
POST /metadata/workflow Create a new workflow definition.
-
.delete_task(task_type) ⇒ Object
DELETE /metadata/taskdefs/taskType Remove a task definition.
-
.get_all_tasks ⇒ Object
GET /metadata/taskdefs Gets all task definition.
-
.get_all_workflows ⇒ Object
GET /metadata/workflow Retrieves all workflow definition along with blueprint.
-
.get_task(task_type) ⇒ Object
GET /metadata/taskdefs/taskType Gets the task definition.
-
.get_workflow(workflow_name, version: nil) ⇒ Object
GET /metadata/workflow/name?version= Retrieves workflow definition along with blueprint.
-
.update_task(task_definition) ⇒ Object
PUT /metadata/taskdefs Update an existing task.
Instance Method Summary collapse
-
#initialize(response) ⇒ Metadata
constructor
A new instance of Metadata.
Methods inherited from Model
Constructor Details
#initialize(response) ⇒ Metadata
Returns a new instance of Metadata.
3 4 5 |
# File 'lib/nf-conductor/http/metadata.rb', line 3 def initialize(response) super(response) end |
Class Method Details
.create_or_update_workflows(workflow_list) ⇒ Object
PUT /metadata/workflow Create or update workflow definition
79 80 81 82 83 84 85 |
# File 'lib/nf-conductor/http/metadata.rb', line 79 def create_or_update_workflows(workflow_list) response = Connection.new.put( "/metadata/taskdefs", { body: (workflow_list.is_a?(Array) ? workflow_list : [workflow_list]).to_json } ) Metadata.build(response) end |
.create_tasks(task_list) ⇒ Object
POST /metadata/taskdefs Create new task definition(s) 204 success
25 26 27 28 29 30 31 |
# File 'lib/nf-conductor/http/metadata.rb', line 25 def create_tasks(task_list) response = Connection.new.post( "/metadata/taskdefs", { body: (task_list.is_a?(Array) ? task_list : [task_list]).to_json } ) Metadata.build(response) end |
.create_workflow(workflow) ⇒ Object
POST /metadata/workflow Create a new workflow definition
69 70 71 72 73 74 75 |
# File 'lib/nf-conductor/http/metadata.rb', line 69 def create_workflow(workflow) response = Connection.new.post( "/metadata/workflow", { body: workflow.to_json } ) Metadata.build(response) end |
.delete_task(task_type) ⇒ Object
DELETE /metadata/taskdefs/taskType Remove a task definition
45 46 47 48 |
# File 'lib/nf-conductor/http/metadata.rb', line 45 def delete_task(task_type) response = Connection.new.delete("/metadata/taskdefs/#{task_type}") Metadata.build(response) end |
.get_all_tasks ⇒ Object
GET /metadata/taskdefs Gets all task definition
10 11 12 13 |
# File 'lib/nf-conductor/http/metadata.rb', line 10 def get_all_tasks response = Connection.new.get("/metadata/taskdefs") Metadata.build(response) end |
.get_all_workflows ⇒ Object
GET /metadata/workflow Retrieves all workflow definition along with blueprint
52 53 54 55 |
# File 'lib/nf-conductor/http/metadata.rb', line 52 def get_all_workflows response = Connection.new.get("/metadata/workflow") Metadata.build(response) end |
.get_task(task_type) ⇒ Object
GET /metadata/taskdefs/taskType Gets the task definition
17 18 19 20 |
# File 'lib/nf-conductor/http/metadata.rb', line 17 def get_task(task_type) response = Connection.new.get("/metadata/taskdefs/#{task_type}") Metadata.build(response) end |
.get_workflow(workflow_name, version: nil) ⇒ Object
GET /metadata/workflow/name?version= Retrieves workflow definition along with blueprint
59 60 61 62 63 64 65 |
# File 'lib/nf-conductor/http/metadata.rb', line 59 def get_workflow(workflow_name, version: nil) query_string = "/metadata/workflow/#{workflow_name}?" query_string += "version=#{version}" if version response = Connection.new.get(query_string) Metadata.build(response) end |
.update_task(task_definition) ⇒ Object
PUT /metadata/taskdefs Update an existing task
35 36 37 38 39 40 41 |
# File 'lib/nf-conductor/http/metadata.rb', line 35 def update_task(task_definition) response = Connection.new.put( "/metadata/taskdefs", { body: task_definition.to_json } ) Metadata.build(response) end |