Class: Conductor::Http::Api::MetadataResourceApi
- Inherits:
-
Object
- Object
- Conductor::Http::Api::MetadataResourceApi
- Defined in:
- lib/conductor/http/api/metadata_resource_api.rb
Overview
MetadataResourceApi - API for workflow and task metadata operations Manages task definitions and workflow definitions
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_workflow(body, overwrite: false) ⇒ Object
Create a new workflow definition.
-
#create_workflow_metadata(name, body, version: nil) ⇒ void
Store metadata (tags) associated with a workflow.
-
#delete_workflow_metadata(name, version:) ⇒ void
Delete metadata (tags) associated with a workflow.
-
#get_all_task_defs(access: nil) ⇒ Array<TaskDef>
Get all task definitions.
-
#get_all_workflows(access: nil) ⇒ Array<WorkflowDef>
Get all workflow definitions.
-
#get_task_def(task_type) ⇒ TaskDef
Get a task definition by name.
-
#get_workflow_def(name, version: nil) ⇒ WorkflowDef
Get a workflow definition by name.
-
#get_workflow_metadata(name, version: nil) ⇒ Object
Get metadata (tags) associated with a workflow.
-
#initialize(api_client = nil) ⇒ MetadataResourceApi
constructor
Initialize MetadataResourceApi.
-
#register_task_def(body) ⇒ Object
Register (create) task definition(s).
-
#unregister_task_def(task_type) ⇒ void
Unregister (delete) a task definition.
-
#unregister_workflow_def(name, version:) ⇒ void
Unregister (delete) a workflow definition.
-
#update_task_def(body) ⇒ Object
Update an existing task definition.
-
#update_workflows(body, overwrite: true) ⇒ Object
Update workflow definition(s).
Constructor Details
#initialize(api_client = nil) ⇒ MetadataResourceApi
Initialize MetadataResourceApi
15 16 17 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 15 def initialize(api_client = nil) @api_client = api_client || ApiClient.new end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
11 12 13 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 11 def api_client @api_client end |
Instance Method Details
#create_workflow(body, overwrite: false) ⇒ Object
Create a new workflow definition
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 27 def create_workflow(body, overwrite: false) @api_client.call_api( '/metadata/workflow', 'POST', query_params: { overwrite: overwrite }, body: body, return_type: 'Object', return_http_data_only: true ) end |
#create_workflow_metadata(name, body, version: nil) ⇒ void
This method returns an undefined value.
Store metadata (tags) associated with a workflow
183 184 185 186 187 188 189 190 191 192 193 194 195 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 183 def (name, body, version: nil) query_params = {} query_params[:version] = version if version @api_client.call_api( '/metadata/tags/workflow/{name}', 'POST', path_params: { name: name }, query_params: query_params, body: body, return_http_data_only: true ) end |
#delete_workflow_metadata(name, version:) ⇒ void
This method returns an undefined value.
Delete metadata (tags) associated with a workflow
219 220 221 222 223 224 225 226 227 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 219 def (name, version:) @api_client.call_api( '/metadata/tags/workflow/{name}', 'DELETE', path_params: { name: name }, query_params: { version: version }, return_http_data_only: true ) end |
#get_all_task_defs(access: nil) ⇒ Array<TaskDef>
Get all task definitions
149 150 151 152 153 154 155 156 157 158 159 160 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 149 def get_all_task_defs(access: nil) query_params = {} query_params[:access] = access if access @api_client.call_api( '/metadata/taskdefs', 'GET', query_params: query_params, return_type: 'Array<TaskDef>', return_http_data_only: true ) end |
#get_all_workflows(access: nil) ⇒ Array<WorkflowDef>
Get all workflow definitions
74 75 76 77 78 79 80 81 82 83 84 85 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 74 def get_all_workflows(access: nil) query_params = {} query_params[:access] = access if access @api_client.call_api( '/metadata/workflow', 'GET', query_params: query_params, return_type: 'Array<WorkflowDef>', return_http_data_only: true ) end |
#get_task_def(task_type) ⇒ TaskDef
Get a task definition by name
136 137 138 139 140 141 142 143 144 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 136 def get_task_def(task_type) @api_client.call_api( '/metadata/taskdefs/{tasktype}', 'GET', path_params: { tasktype: task_type }, return_type: 'TaskDef', return_http_data_only: true ) end |
#get_workflow_def(name, version: nil) ⇒ WorkflowDef
Get a workflow definition by name
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 57 def get_workflow_def(name, version: nil) query_params = {} query_params[:version] = version if version @api_client.call_api( '/metadata/workflow/{name}', 'GET', path_params: { name: name }, query_params: query_params, return_type: 'WorkflowDef', return_http_data_only: true ) end |
#get_workflow_metadata(name, version: nil) ⇒ Object
Get metadata (tags) associated with a workflow
201 202 203 204 205 206 207 208 209 210 211 212 213 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 201 def (name, version: nil) query_params = {} query_params[:version] = version if version @api_client.call_api( '/metadata/tags/workflow/{name}', 'GET', path_params: { name: name }, query_params: query_params, return_type: 'Object', return_http_data_only: true ) end |
#register_task_def(body) ⇒ Object
Register (create) task definition(s)
107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 107 def register_task_def(body) # Ensure body is an array task_defs = body.is_a?(Array) ? body : [body] @api_client.call_api( '/metadata/taskdefs', 'POST', body: task_defs, return_type: 'Object', return_http_data_only: true ) end |
#unregister_task_def(task_type) ⇒ void
This method returns an undefined value.
Unregister (delete) a task definition
165 166 167 168 169 170 171 172 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 165 def unregister_task_def(task_type) @api_client.call_api( '/metadata/taskdefs/{tasktype}', 'DELETE', path_params: { tasktype: task_type }, return_http_data_only: true ) end |
#unregister_workflow_def(name, version:) ⇒ void
This method returns an undefined value.
Unregister (delete) a workflow definition
91 92 93 94 95 96 97 98 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 91 def unregister_workflow_def(name, version:) @api_client.call_api( '/metadata/workflow/{name}/{version}', 'DELETE', path_params: { name: name, version: version }, return_http_data_only: true ) end |
#update_task_def(body) ⇒ Object
Update an existing task definition
123 124 125 126 127 128 129 130 131 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 123 def update_task_def(body) @api_client.call_api( '/metadata/taskdefs', 'PUT', body: body, return_type: 'Object', return_http_data_only: true ) end |
#update_workflows(body, overwrite: true) ⇒ Object
Update workflow definition(s)
42 43 44 45 46 47 48 49 50 51 |
# File 'lib/conductor/http/api/metadata_resource_api.rb', line 42 def update_workflows(body, overwrite: true) @api_client.call_api( '/metadata/workflow', 'PUT', query_params: { overwrite: overwrite }, body: body, return_type: 'Object', return_http_data_only: true ) end |