Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Provide an API to search for a resource by workflow step id #279

Closed
Tracked by #88
dbwiddis opened this issue Dec 12, 2023 · 2 comments
Closed
Tracked by #88
Assignees
Labels
enhancement New feature or request

Comments

@dbwiddis
Copy link
Member

Is your feature request related to a problem?

The user provisioning a resource is not always the same user who needs to use the resource.

For example, the user provisioning a template to create an agent (typically a back-end role) may not be the same user who needs the agent ID to query the agent (typically a front-end role).

What solution would you like?

We currently provide a status API for a specific workflow which returns created resources, for example

        {
            "workflow_step_name": "register_agent",
            "workflow_step_id": "root_agent",
            "agent_id": "OtjCQYwBLmvn802B6YwB"
        }

Of note, the "workflow_step_id" is a user-provided, unique id that could be used as a search term.

We need an API to search all created resources, regardless of which workflow created them, identifying a match based on the worfklow step id.

@joshpalis
Copy link
Member

The directional idea is to modify the index mapping of the workflow state index such that resources created are static fields rather than dynamic, and to expose a new API to search the workflow state index using OS DSL. This is to allow for querying the workflow state index for specific term values within the objects of the array. Created resources should be changed to the following format :

{
  ...,
  ...,
  ...,
  "resources_created": [
    {
      "workflow_step_name": "register_agent_1",
      "workflow_step_id": "sub_agent",
      "resource_type": "agent_id",
      "resource_id": "OtjCQYwBLmvn802B6YwB"
    },
    {
      "workflow_step_name": "register_agent_2",
      "workflow_step_id": "root_agent",
      "resource_type": "agent_id",
      "resource_id": "hs9WO4wBO6ocj3mOqRNy"
    }
  ]
}

@joshpalis
Copy link
Member

Closed by #284

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants