ManageIQ / ManageIQ/manageiq-api-client

Need to support keyword attributes in action calls

Open
#69 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement help wanted
Dominant language
Ruby
Stars
11
Forks
24
PR merge metrics
No merged PRs in 30d

Description

For the Automate usage, users call model methods with just the arguments as needed.

From the API server usage, we're expecting the json representation,

for example, in the model:

```
ar = AutomationRequest.find(15)
ar.authorized?(userid)
```

From the API server side, to expose authorized?, we'd take in a user reference or userid,

```
miq.automation_requests.find(15).authorized?(:userid => userid)
```

However, the expectation, is that the following would work:

```
miq.automation_requests.find(15).authorized?(userid)
```

The API Server needs to be able to expose keyword name list for method and when the client defined such actions, it would be able to check for hash signatures or otherwise treat them as an array of parameter. In the latter case, the Client would convert the array to the proper json to send up to the server.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No files or tests are named. Start by tracing how the Ruby client exposes and serializes action calls, then inspect the API server's method metadata for keyword names. Done means calls such as authorized?(userid) are accepted and converted to the expected JSON representation, while existing hash-style calls continue to work.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.