Smart Show Command for OSC Client

Registered by sandeep nandal

Summary
=======
OpenStack Client should have support for a Smart Show Command Functionality, which is an updated and enhanced version of current Show Command. This Command will be modification to the current show command with the following guidelines:-
1. After receiving the argument from the user, It will use a function(mechanism) to detect weather the argument is a resource-name or resource-id.
2. Then, if it finds the argument as resource-id, then it directly fetch the resource by passing the argument as resource-id.
3. And if it finds the argument as resource-name, then it will try to fetch the list of resources by passing it as resource-name, and then process the result accordingly.

Motivation
========
1. By the smart-show modification we can reduce the number of unnecessary request which returns error log 404 whenever a user passes resource-name as argument.
2. It will help in cleaner logs and efficient resource fetching.

Description
=========
Current Show command for various project resources can be used with either resource-name or resource-id to fetch the details of the resource, However it follows the given process:-
1. by default consider the argument as resource-id first and tries to fetch the resource by passing that argument as resource-id.
2. If it finds a resource with the given argument as resource-id, it returns the values to the user.
3. But it doesn't find any resource with given argument as resource-id, It logs 404 error, and then look for a list of resource by considering argument as name of the resource.
4. If it get only single resource in the result list, it returns the details of resource to the user.
5. If it get multiple resources with the given argument as resource-name, It instructs the user to use resource-id as argument instead of resource-name.

In the current existing approach, there is always unnecessary request which returns error log 404 whenever a user passes resource-name as argument.

Therefore, the Smart Show Command will be modification to the current show command with the following guidelines:-
1. After recieving the argument from the user, It will use a function(mechanism) to detect weather the argument is a resource-name or resource-id.
2. Then, if it finds the argument as resource-id, then it directly fetch the resource by passing the argument as resource-id.
3. And if it finds the argument as resource-name, then it will try to fetch the list of resources by passing it as resource-name, and then process the result accordingly.

UX
===
- No change is needed for User Interface, User Interface will remain same.

Testing
======
Proper Tests would be added to check the system's behavior after adding this feature.

Outside Dependencies
==================
Functionality must be added to openstack cli.

Requirements Update Required
========================
No specific Update is required for this change, if some external module is planned to be used for this functionality, then we only we will have to update the requirements list.

Doc Impact
=========
OSC Documentation will be updated in order to inform the user about the changes that will be introduced. UI will remain unchanged as there will not be any changes to the User Interface, However the OSC documentation should be updated with the details of this new mechanism.

Blueprint information

Status:
Not started
Approver:
Dean Troyer
Priority:
Undefined
Drafter:
sandeep nandal
Direction:
Needs approval
Assignee:
None
Definition:
New
Series goal:
None
Implementation:
Unknown
Milestone target:
None

Related branches

Sprints

Whiteboard

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.