conductor_ruby 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +142 -0
  3. data/LICENSE +190 -0
  4. data/README.md +517 -0
  5. data/examples/agentic_workflows/llm_chat.rb +106 -0
  6. data/examples/dynamic_workflow.rb +177 -0
  7. data/examples/event_handler.rb +94 -0
  8. data/examples/event_listener_examples.rb +430 -0
  9. data/examples/helloworld/greetings_worker.rb +24 -0
  10. data/examples/helloworld/helloworld.rb +99 -0
  11. data/examples/kitchensink.rb +213 -0
  12. data/examples/metadata_journey.rb +189 -0
  13. data/examples/metrics_example.rb +284 -0
  14. data/examples/new_dsl_demo.rb +141 -0
  15. data/examples/orkes/http_poll.rb +83 -0
  16. data/examples/orkes/secrets_example.rb +69 -0
  17. data/examples/orkes/wait_for_webhook.rb +90 -0
  18. data/examples/prompt_journey.rb +245 -0
  19. data/examples/rag_workflow.rb +167 -0
  20. data/examples/schedule_journey.rb +244 -0
  21. data/examples/simple_worker.rb +125 -0
  22. data/examples/simple_workflow.rb +89 -0
  23. data/examples/task_context_example.rb +257 -0
  24. data/examples/task_listener_example.rb +192 -0
  25. data/examples/worker_configuration_example.rb +282 -0
  26. data/examples/workflow_dsl.rb +316 -0
  27. data/examples/workflow_ops.rb +305 -0
  28. data/lib/conductor/client/authorization_client.rb +238 -0
  29. data/lib/conductor/client/integration_client.rb +108 -0
  30. data/lib/conductor/client/metadata_client.rb +139 -0
  31. data/lib/conductor/client/prompt_client.rb +58 -0
  32. data/lib/conductor/client/scheduler_client.rb +132 -0
  33. data/lib/conductor/client/schema_client.rb +32 -0
  34. data/lib/conductor/client/secret_client.rb +48 -0
  35. data/lib/conductor/client/task_client.rb +168 -0
  36. data/lib/conductor/client/workflow_client.rb +242 -0
  37. data/lib/conductor/configuration/authentication_settings.rb +17 -0
  38. data/lib/conductor/configuration.rb +103 -0
  39. data/lib/conductor/exceptions.rb +86 -0
  40. data/lib/conductor/http/api/application_resource_api.rb +107 -0
  41. data/lib/conductor/http/api/authorization_resource_api.rb +56 -0
  42. data/lib/conductor/http/api/event_resource_api.rb +133 -0
  43. data/lib/conductor/http/api/gateway_auth_resource_api.rb +48 -0
  44. data/lib/conductor/http/api/group_resource_api.rb +76 -0
  45. data/lib/conductor/http/api/integration_resource_api.rb +145 -0
  46. data/lib/conductor/http/api/metadata_resource_api.rb +231 -0
  47. data/lib/conductor/http/api/prompt_resource_api.rb +81 -0
  48. data/lib/conductor/http/api/role_resource_api.rb +60 -0
  49. data/lib/conductor/http/api/scheduler_resource_api.rb +211 -0
  50. data/lib/conductor/http/api/schema_resource_api.rb +82 -0
  51. data/lib/conductor/http/api/secret_resource_api.rb +134 -0
  52. data/lib/conductor/http/api/task_resource_api.rb +321 -0
  53. data/lib/conductor/http/api/token_resource_api.rb +42 -0
  54. data/lib/conductor/http/api/user_resource_api.rb +59 -0
  55. data/lib/conductor/http/api/workflow_bulk_resource_api.rb +91 -0
  56. data/lib/conductor/http/api/workflow_resource_api.rb +451 -0
  57. data/lib/conductor/http/api_client.rb +437 -0
  58. data/lib/conductor/http/models/authentication_config.rb +67 -0
  59. data/lib/conductor/http/models/authorization_request.rb +39 -0
  60. data/lib/conductor/http/models/base_model.rb +162 -0
  61. data/lib/conductor/http/models/bulk_response.rb +39 -0
  62. data/lib/conductor/http/models/conductor_application.rb +39 -0
  63. data/lib/conductor/http/models/conductor_user.rb +53 -0
  64. data/lib/conductor/http/models/create_or_update_application_request.rb +24 -0
  65. data/lib/conductor/http/models/create_or_update_role_request.rb +27 -0
  66. data/lib/conductor/http/models/event_handler.rb +130 -0
  67. data/lib/conductor/http/models/generate_token_request.rb +27 -0
  68. data/lib/conductor/http/models/group.rb +36 -0
  69. data/lib/conductor/http/models/integration.rb +70 -0
  70. data/lib/conductor/http/models/integration_api.rb +53 -0
  71. data/lib/conductor/http/models/integration_api_update.rb +43 -0
  72. data/lib/conductor/http/models/integration_update.rb +36 -0
  73. data/lib/conductor/http/models/permission.rb +24 -0
  74. data/lib/conductor/http/models/poll_data.rb +33 -0
  75. data/lib/conductor/http/models/prompt_template.rb +59 -0
  76. data/lib/conductor/http/models/prompt_template_test_request.rb +43 -0
  77. data/lib/conductor/http/models/rerun_workflow_request.rb +37 -0
  78. data/lib/conductor/http/models/role.rb +27 -0
  79. data/lib/conductor/http/models/schema_def.rb +59 -0
  80. data/lib/conductor/http/models/search_result.rb +187 -0
  81. data/lib/conductor/http/models/skip_task_request.rb +27 -0
  82. data/lib/conductor/http/models/start_workflow_request.rb +68 -0
  83. data/lib/conductor/http/models/subject_ref.rb +35 -0
  84. data/lib/conductor/http/models/tag_object.rb +36 -0
  85. data/lib/conductor/http/models/target_ref.rb +39 -0
  86. data/lib/conductor/http/models/task.rb +156 -0
  87. data/lib/conductor/http/models/task_def.rb +95 -0
  88. data/lib/conductor/http/models/task_exec_log.rb +30 -0
  89. data/lib/conductor/http/models/task_result.rb +115 -0
  90. data/lib/conductor/http/models/task_result_status.rb +24 -0
  91. data/lib/conductor/http/models/token.rb +33 -0
  92. data/lib/conductor/http/models/upsert_group_request.rb +30 -0
  93. data/lib/conductor/http/models/upsert_user_request.rb +39 -0
  94. data/lib/conductor/http/models/workflow.rb +202 -0
  95. data/lib/conductor/http/models/workflow_def.rb +73 -0
  96. data/lib/conductor/http/models/workflow_schedule.rb +100 -0
  97. data/lib/conductor/http/models/workflow_state_update.rb +30 -0
  98. data/lib/conductor/http/models/workflow_status_constants.rb +57 -0
  99. data/lib/conductor/http/models/workflow_task.rb +169 -0
  100. data/lib/conductor/http/models/workflow_test_request.rb +67 -0
  101. data/lib/conductor/http/rest_client.rb +211 -0
  102. data/lib/conductor/orkes/models/access_key.rb +56 -0
  103. data/lib/conductor/orkes/models/granted_permission.rb +27 -0
  104. data/lib/conductor/orkes/models/metadata_tag.rb +15 -0
  105. data/lib/conductor/orkes/models/rate_limit_tag.rb +15 -0
  106. data/lib/conductor/orkes/orkes_clients.rb +69 -0
  107. data/lib/conductor/version.rb +5 -0
  108. data/lib/conductor/worker/events/conductor_event.rb +40 -0
  109. data/lib/conductor/worker/events/global_dispatcher.rb +37 -0
  110. data/lib/conductor/worker/events/http_events.rb +25 -0
  111. data/lib/conductor/worker/events/listener_registry.rb +40 -0
  112. data/lib/conductor/worker/events/listeners.rb +34 -0
  113. data/lib/conductor/worker/events/sync_event_dispatcher.rb +78 -0
  114. data/lib/conductor/worker/events/task_runner_events.rb +271 -0
  115. data/lib/conductor/worker/events/workflow_events.rb +49 -0
  116. data/lib/conductor/worker/fiber_executor.rb +532 -0
  117. data/lib/conductor/worker/ractor_task_runner.rb +501 -0
  118. data/lib/conductor/worker/task_context.rb +114 -0
  119. data/lib/conductor/worker/task_definition_registrar.rb +322 -0
  120. data/lib/conductor/worker/task_handler.rb +360 -0
  121. data/lib/conductor/worker/task_in_progress.rb +60 -0
  122. data/lib/conductor/worker/task_runner.rb +538 -0
  123. data/lib/conductor/worker/telemetry/metrics_collector.rb +196 -0
  124. data/lib/conductor/worker/telemetry/prometheus_backend.rb +224 -0
  125. data/lib/conductor/worker/worker.rb +355 -0
  126. data/lib/conductor/worker/worker_config.rb +154 -0
  127. data/lib/conductor/worker/worker_registry.rb +71 -0
  128. data/lib/conductor/workflow/dsl/input_ref.rb +37 -0
  129. data/lib/conductor/workflow/dsl/output_ref.rb +44 -0
  130. data/lib/conductor/workflow/dsl/parallel_builder.rb +49 -0
  131. data/lib/conductor/workflow/dsl/switch_builder.rb +74 -0
  132. data/lib/conductor/workflow/dsl/task_ref.rb +178 -0
  133. data/lib/conductor/workflow/dsl/workflow_builder.rb +1016 -0
  134. data/lib/conductor/workflow/dsl/workflow_definition.rb +150 -0
  135. data/lib/conductor/workflow/llm/chat_message.rb +47 -0
  136. data/lib/conductor/workflow/llm/embedding_model.rb +19 -0
  137. data/lib/conductor/workflow/llm/tool_call.rb +43 -0
  138. data/lib/conductor/workflow/llm/tool_spec.rb +46 -0
  139. data/lib/conductor/workflow/task_type.rb +68 -0
  140. data/lib/conductor/workflow/timeout_policy.rb +31 -0
  141. data/lib/conductor/workflow/workflow_executor.rb +373 -0
  142. data/lib/conductor.rb +192 -0
  143. metadata +359 -0
@@ -0,0 +1,81 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../api_client'
4
+
5
+ module Conductor
6
+ module Http
7
+ module Api
8
+ # PromptResourceApi - API for prompt template management operations (Orkes)
9
+ class PromptResourceApi
10
+ attr_accessor :api_client
11
+
12
+ def initialize(api_client = nil)
13
+ @api_client = api_client || ApiClient.new
14
+ end
15
+
16
+ # Save a prompt template
17
+ # @param [String] name Prompt name
18
+ # @param [String] body Prompt template text
19
+ # @param [String] description Description
20
+ # @param [Array<String>] models Associated models
21
+ # @param [Integer] version Version number
22
+ # @param [Boolean] auto_increment Auto increment version
23
+ def save_prompt(name, body, description: nil, models: nil, version: nil, auto_increment: false)
24
+ query = {}
25
+ query[:description] = description if description
26
+ query[:models] = models if models
27
+ query[:version] = version if version
28
+ query[:autoIncrement] = auto_increment if auto_increment
29
+
30
+ @api_client.call_api(
31
+ '/prompts/{name}',
32
+ 'POST',
33
+ path_params: { name: name },
34
+ query_params: query,
35
+ body: body,
36
+ return_http_data_only: true
37
+ )
38
+ end
39
+
40
+ # Get a prompt template
41
+ def get_prompt(name)
42
+ @api_client.call_api('/prompts/{name}', 'GET', path_params: { name: name }, return_type: 'PromptTemplate',
43
+ return_http_data_only: true)
44
+ end
45
+
46
+ # Get all prompt templates
47
+ def get_prompts
48
+ @api_client.call_api('/prompts', 'GET', return_type: 'Array<PromptTemplate>', return_http_data_only: true)
49
+ end
50
+
51
+ # Delete a prompt template
52
+ def delete_prompt(name)
53
+ @api_client.call_api('/prompts/{name}', 'DELETE', path_params: { name: name }, return_http_data_only: true)
54
+ end
55
+
56
+ # Get tags for a prompt template
57
+ def get_tags_for_prompt_template(name)
58
+ @api_client.call_api('/prompts/{name}/tags', 'GET', path_params: { name: name },
59
+ return_type: 'Array<TagObject>', return_http_data_only: true)
60
+ end
61
+
62
+ # Update tags for a prompt template
63
+ def update_tag_for_prompt_template(name, tags)
64
+ @api_client.call_api('/prompts/{name}/tags', 'PUT', path_params: { name: name }, body: tags,
65
+ return_http_data_only: true)
66
+ end
67
+
68
+ # Delete tags for a prompt template
69
+ def delete_tag_for_prompt_template(name, tags)
70
+ @api_client.call_api('/prompts/{name}/tags', 'DELETE', path_params: { name: name }, body: tags,
71
+ return_http_data_only: true)
72
+ end
73
+
74
+ # Test a prompt template
75
+ def test_prompt(body)
76
+ @api_client.call_api('/prompts/test', 'POST', body: body, return_type: 'String', return_http_data_only: true)
77
+ end
78
+ end
79
+ end
80
+ end
81
+ end
@@ -0,0 +1,60 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../api_client'
4
+
5
+ module Conductor
6
+ module Http
7
+ module Api
8
+ # RoleResourceApi - API for role management operations (Orkes)
9
+ class RoleResourceApi
10
+ attr_accessor :api_client
11
+
12
+ def initialize(api_client = nil)
13
+ @api_client = api_client || ApiClient.new
14
+ end
15
+
16
+ # List all roles
17
+ def list_all_roles
18
+ @api_client.call_api('/roles', 'GET', return_type: 'Array<Role>', return_http_data_only: true)
19
+ end
20
+
21
+ # List system roles
22
+ def list_system_roles
23
+ @api_client.call_api('/roles/system', 'GET', return_type: 'Object', return_http_data_only: true)
24
+ end
25
+
26
+ # List custom roles
27
+ def list_custom_roles
28
+ @api_client.call_api('/roles/custom', 'GET', return_type: 'Array<Role>', return_http_data_only: true)
29
+ end
30
+
31
+ # List available permissions
32
+ def list_available_permissions
33
+ @api_client.call_api('/roles/permissions', 'GET', return_type: 'Object', return_http_data_only: true)
34
+ end
35
+
36
+ # Create a role
37
+ def create_role(body)
38
+ @api_client.call_api('/roles', 'POST', body: body, return_type: 'Object', return_http_data_only: true)
39
+ end
40
+
41
+ # Get a role by name
42
+ def get_role(name)
43
+ @api_client.call_api('/roles/{name}', 'GET', path_params: { name: name }, return_type: 'Object',
44
+ return_http_data_only: true)
45
+ end
46
+
47
+ # Update a role
48
+ def update_role(name, body)
49
+ @api_client.call_api('/roles/{name}', 'PUT', path_params: { name: name }, body: body, return_type: 'Object',
50
+ return_http_data_only: true)
51
+ end
52
+
53
+ # Delete a role
54
+ def delete_role(name)
55
+ @api_client.call_api('/roles/{name}', 'DELETE', path_params: { name: name }, return_http_data_only: true)
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -0,0 +1,211 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../api_client'
4
+
5
+ module Conductor
6
+ module Http
7
+ module Api
8
+ # SchedulerResourceApi - API for workflow schedule operations
9
+ class SchedulerResourceApi
10
+ attr_accessor :api_client
11
+
12
+ def initialize(api_client = nil)
13
+ @api_client = api_client || ApiClient.new
14
+ end
15
+
16
+ # Save (create/update) a workflow schedule
17
+ # @param [SaveScheduleRequest] body Schedule request
18
+ # @return [void]
19
+ def save_schedule(body)
20
+ @api_client.call_api(
21
+ '/scheduler/schedules',
22
+ 'POST',
23
+ body: body,
24
+ return_http_data_only: true
25
+ )
26
+ end
27
+
28
+ # Get a schedule by name
29
+ # @param [String] name Schedule name
30
+ # @return [WorkflowSchedule]
31
+ def get_schedule(name)
32
+ @api_client.call_api(
33
+ '/scheduler/schedules/{name}',
34
+ 'GET',
35
+ path_params: { name: name },
36
+ return_type: 'WorkflowSchedule',
37
+ return_http_data_only: true
38
+ )
39
+ end
40
+
41
+ # Get all schedules
42
+ # @param [String] workflow_name Filter by workflow name (optional)
43
+ # @return [Array<WorkflowSchedule>]
44
+ def get_all_schedules(workflow_name: nil)
45
+ query_params = {}
46
+ query_params[:workflowName] = workflow_name if workflow_name
47
+
48
+ @api_client.call_api(
49
+ '/scheduler/schedules',
50
+ 'GET',
51
+ query_params: query_params,
52
+ return_type: 'Array<WorkflowSchedule>',
53
+ return_http_data_only: true
54
+ )
55
+ end
56
+
57
+ # Delete a schedule
58
+ # @param [String] name Schedule name
59
+ # @return [void]
60
+ def delete_schedule(name)
61
+ @api_client.call_api(
62
+ '/scheduler/schedules/{name}',
63
+ 'DELETE',
64
+ path_params: { name: name },
65
+ return_http_data_only: true
66
+ )
67
+ end
68
+
69
+ # Pause a schedule
70
+ # @param [String] name Schedule name
71
+ # @return [void]
72
+ def pause_schedule(name)
73
+ @api_client.call_api(
74
+ '/scheduler/schedules/{name}/pause',
75
+ 'GET',
76
+ path_params: { name: name },
77
+ return_http_data_only: true
78
+ )
79
+ end
80
+
81
+ # Resume a schedule
82
+ # @param [String] name Schedule name
83
+ # @return [void]
84
+ def resume_schedule(name)
85
+ @api_client.call_api(
86
+ '/scheduler/schedules/{name}/resume',
87
+ 'GET',
88
+ path_params: { name: name },
89
+ return_http_data_only: true
90
+ )
91
+ end
92
+
93
+ # Pause all schedules
94
+ # @return [Hash]
95
+ def pause_all_schedules
96
+ @api_client.call_api(
97
+ '/scheduler/admin/pause',
98
+ 'GET',
99
+ return_type: 'Hash<String, Object>',
100
+ return_http_data_only: true
101
+ )
102
+ end
103
+
104
+ # Resume all schedules
105
+ # @return [Hash]
106
+ def resume_all_schedules
107
+ @api_client.call_api(
108
+ '/scheduler/admin/resume',
109
+ 'GET',
110
+ return_type: 'Hash<String, Object>',
111
+ return_http_data_only: true
112
+ )
113
+ end
114
+
115
+ # Get next few schedule execution times
116
+ # @param [String] cron_expression Cron expression
117
+ # @param [Integer] schedule_start_time Start time (epoch ms, optional)
118
+ # @param [Integer] schedule_end_time End time (epoch ms, optional)
119
+ # @param [Integer] limit Number of times to return (optional)
120
+ # @return [Array<Integer>]
121
+ def get_next_few_schedules(cron_expression, schedule_start_time: nil, schedule_end_time: nil, limit: nil)
122
+ query_params = { cronExpression: cron_expression }
123
+ query_params[:scheduleStartTime] = schedule_start_time if schedule_start_time
124
+ query_params[:scheduleEndTime] = schedule_end_time if schedule_end_time
125
+ query_params[:limit] = limit if limit
126
+
127
+ @api_client.call_api(
128
+ '/scheduler/nextFewSchedules',
129
+ 'GET',
130
+ query_params: query_params,
131
+ return_type: 'Array<Integer>',
132
+ return_http_data_only: true
133
+ )
134
+ end
135
+
136
+ # Search schedule executions
137
+ # @param [Integer] start Start index (default: 0)
138
+ # @param [Integer] size Page size (default: 100)
139
+ # @param [String] sort Sort order (optional)
140
+ # @param [String] free_text Free text search (default: '*')
141
+ # @param [String] query Query string (optional)
142
+ # @return [SearchResult]
143
+ def search_v2(start: 0, size: 100, sort: nil, free_text: '*', query: nil)
144
+ query_params = { start: start, size: size, freeText: free_text }
145
+ query_params[:sort] = sort if sort
146
+ query_params[:query] = query if query
147
+
148
+ @api_client.call_api(
149
+ '/scheduler/search/executions',
150
+ 'GET',
151
+ query_params: query_params,
152
+ return_type: 'SearchResult',
153
+ return_http_data_only: true
154
+ )
155
+ end
156
+
157
+ # Requeue all execution records
158
+ # @return [Hash]
159
+ def requeue_all_execution_records
160
+ @api_client.call_api(
161
+ '/scheduler/admin/requeue',
162
+ 'GET',
163
+ return_type: 'Hash<String, Object>',
164
+ return_http_data_only: true
165
+ )
166
+ end
167
+
168
+ # Set tags for a schedule
169
+ # @param [String] name Schedule name
170
+ # @param [Array<Hash>] tags List of tags
171
+ # @return [void]
172
+ def put_tag_for_schedule(name, tags)
173
+ @api_client.call_api(
174
+ '/scheduler/schedules/{name}/tags',
175
+ 'PUT',
176
+ path_params: { name: name },
177
+ body: tags,
178
+ return_http_data_only: true
179
+ )
180
+ end
181
+
182
+ # Get tags for a schedule
183
+ # @param [String] name Schedule name
184
+ # @return [Array<Hash>]
185
+ def get_tags_for_schedule(name)
186
+ @api_client.call_api(
187
+ '/scheduler/schedules/{name}/tags',
188
+ 'GET',
189
+ path_params: { name: name },
190
+ return_type: 'Array<Object>',
191
+ return_http_data_only: true
192
+ )
193
+ end
194
+
195
+ # Delete tags for a schedule
196
+ # @param [String] name Schedule name
197
+ # @param [Array<Hash>] tags List of tags to delete
198
+ # @return [void]
199
+ def delete_tag_for_schedule(name, tags)
200
+ @api_client.call_api(
201
+ '/scheduler/schedules/{name}/tags',
202
+ 'DELETE',
203
+ path_params: { name: name },
204
+ body: tags,
205
+ return_http_data_only: true
206
+ )
207
+ end
208
+ end
209
+ end
210
+ end
211
+ end
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../api_client'
4
+
5
+ module Conductor
6
+ module Http
7
+ module Api
8
+ # SchemaResourceApi - API for schema management operations (Orkes)
9
+ class SchemaResourceApi
10
+ attr_accessor :api_client
11
+
12
+ def initialize(api_client = nil)
13
+ @api_client = api_client || ApiClient.new
14
+ end
15
+
16
+ # Save a schema definition
17
+ # @param [SchemaDef] body Schema definition
18
+ # @param [Boolean] new_version Whether to create a new version
19
+ # @return [void]
20
+ def save(body, new_version: false)
21
+ @api_client.call_api(
22
+ '/schema',
23
+ 'POST',
24
+ query_params: { newVersion: new_version },
25
+ body: body,
26
+ return_http_data_only: true
27
+ )
28
+ end
29
+
30
+ # Get a schema by name and version
31
+ # @param [String] name Schema name
32
+ # @param [Integer] version Schema version
33
+ # @return [SchemaDef]
34
+ def get_schema_by_name_and_version(name, version)
35
+ @api_client.call_api(
36
+ '/schema/{name}/{version}',
37
+ 'GET',
38
+ path_params: { name: name, version: version },
39
+ return_type: 'SchemaDef',
40
+ return_http_data_only: true
41
+ )
42
+ end
43
+
44
+ # Get all schemas
45
+ # @return [Array<SchemaDef>]
46
+ def get_all_schemas
47
+ @api_client.call_api(
48
+ '/schema',
49
+ 'GET',
50
+ return_type: 'Array<SchemaDef>',
51
+ return_http_data_only: true
52
+ )
53
+ end
54
+
55
+ # Delete a schema by name and version
56
+ # @param [String] name Schema name
57
+ # @param [Integer] version Schema version
58
+ # @return [void]
59
+ def delete_schema_by_name_and_version(name, version)
60
+ @api_client.call_api(
61
+ '/schema/{name}/{version}',
62
+ 'DELETE',
63
+ path_params: { name: name, version: version },
64
+ return_http_data_only: true
65
+ )
66
+ end
67
+
68
+ # Delete all versions of a schema by name
69
+ # @param [String] name Schema name
70
+ # @return [void]
71
+ def delete_schema_by_name(name)
72
+ @api_client.call_api(
73
+ '/schema/{name}',
74
+ 'DELETE',
75
+ path_params: { name: name },
76
+ return_http_data_only: true
77
+ )
78
+ end
79
+ end
80
+ end
81
+ end
82
+ end
@@ -0,0 +1,134 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../api_client'
4
+
5
+ module Conductor
6
+ module Http
7
+ module Api
8
+ # SecretResourceApi - API for secret management operations (Orkes)
9
+ class SecretResourceApi
10
+ attr_accessor :api_client
11
+
12
+ def initialize(api_client = nil)
13
+ @api_client = api_client || ApiClient.new
14
+ end
15
+
16
+ # Store a secret value
17
+ # @param [String] key Secret key
18
+ # @param [String] value Secret value
19
+ # @return [void]
20
+ def put_secret(value, key)
21
+ @api_client.call_api(
22
+ '/secrets/{key}',
23
+ 'PUT',
24
+ path_params: { key: key },
25
+ body: value,
26
+ return_http_data_only: true
27
+ )
28
+ end
29
+
30
+ # Get a secret value
31
+ # @param [String] key Secret key
32
+ # @return [String]
33
+ def get_secret(key)
34
+ @api_client.call_api(
35
+ '/secrets/{key}',
36
+ 'GET',
37
+ path_params: { key: key },
38
+ return_type: 'String',
39
+ return_http_data_only: true
40
+ )
41
+ end
42
+
43
+ # List all secret names
44
+ # @return [Array<String>]
45
+ def list_all_secret_names
46
+ @api_client.call_api(
47
+ '/secrets',
48
+ 'POST',
49
+ return_type: 'Array<String>',
50
+ return_http_data_only: true
51
+ )
52
+ end
53
+
54
+ # List secrets that user can grant access to
55
+ # @return [Array<String>]
56
+ def list_secrets_that_user_can_grant_access_to
57
+ @api_client.call_api(
58
+ '/secrets',
59
+ 'GET',
60
+ return_type: 'Array<String>',
61
+ return_http_data_only: true
62
+ )
63
+ end
64
+
65
+ # Delete a secret
66
+ # @param [String] key Secret key
67
+ # @return [void]
68
+ def delete_secret(key)
69
+ @api_client.call_api(
70
+ '/secrets/{key}',
71
+ 'DELETE',
72
+ path_params: { key: key },
73
+ return_http_data_only: true
74
+ )
75
+ end
76
+
77
+ # Check if a secret exists
78
+ # @param [String] key Secret key
79
+ # @return [Boolean]
80
+ def secret_exists(key)
81
+ @api_client.call_api(
82
+ '/secrets/{key}/exists',
83
+ 'GET',
84
+ path_params: { key: key },
85
+ return_type: 'Boolean',
86
+ return_http_data_only: true
87
+ )
88
+ end
89
+
90
+ # Set tags for a secret
91
+ # @param [Array<TagObject>] tags Tags to set
92
+ # @param [String] key Secret key
93
+ # @return [void]
94
+ def put_tag_for_secret(tags, key)
95
+ @api_client.call_api(
96
+ '/secrets/{key}/tags',
97
+ 'PUT',
98
+ path_params: { key: key },
99
+ body: tags,
100
+ return_http_data_only: true
101
+ )
102
+ end
103
+
104
+ # Get tags for a secret
105
+ # @param [String] key Secret key
106
+ # @return [Array<TagObject>]
107
+ def get_tags(key)
108
+ @api_client.call_api(
109
+ '/secrets/{key}/tags',
110
+ 'GET',
111
+ path_params: { key: key },
112
+ return_type: 'Array<TagObject>',
113
+ return_http_data_only: true
114
+ )
115
+ end
116
+
117
+ # Delete tags for a secret
118
+ # @param [Array<TagObject>] tags Tags to delete
119
+ # @param [String] key Secret key
120
+ # @return [Array<TagObject>]
121
+ def delete_tag_for_secret(tags, key)
122
+ @api_client.call_api(
123
+ '/secrets/{key}/tags',
124
+ 'DELETE',
125
+ path_params: { key: key },
126
+ body: tags,
127
+ return_type: 'Array<TagObject>',
128
+ return_http_data_only: true
129
+ )
130
+ end
131
+ end
132
+ end
133
+ end
134
+ end