-
Notifications
You must be signed in to change notification settings - Fork 70
Add support for excluding a list of parameters from an API response #163
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
(test) 🐱 > list zones exclude=zonetoken,id
{
"count": 2,
"zone": [
{
"allocationstate": "Enabled",
"allowuserspecifyvrmtu": false,
"asnrange": "",
"dhcpprovider": "VirtualRouter",
"dns1": "10.147.28.6",
"guestcidraddress": "10.1.1.0/24",
"hasannotations": false,
"internaldns1": "10.147.28.6",
"ismultiarch": false,
"isnsxenabled": false,
"localstorageenabled": false,
"name": "zim1",
"networktype": "Advanced",
"routedmodeenabled": true,
"routerprivateinterfacemaxmtu": 1500,
"routerpublicinterfacemaxmtu": 1500,
"securitygroupsenabled": false,
"tags": [],
"type": "Core"
},
{
"allocationstate": "Enabled",
"allowuserspecifyvrmtu": false,
"asnrange": "",
"dhcpprovider": "VirtualRouter",
"dns1": "10.147.29.6",
"guestcidraddress": "10.1.2.0/24",
"hasannotations": false,
"internaldns1": "10.147.29.6",
"ismultiarch": false,
"isnsxenabled": false,
"localstorageenabled": false,
"name": "zim2",
"networktype": "Advanced",
"routedmodeenabled": true,
"routerprivateinterfacemaxmtu": 1500,
"routerpublicinterfacemaxmtu": 1500,
"securitygroupsenabled": false,
"tags": [],
"type": "Core"
}
]
}
Others can comment if the parameter name can be improved. Though this works too
@Pearl1594 can we name the new param - |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code LGTM
I feel "exclude" is fine @shwstppr, we already have another field "filter" to filter (default include) out the given names. filterexclude does not feel the right word to me. my 2cents. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clgtm, tested and works in isolation, we will have to decide whether to merge this and revisit #164 or vice versa
This PR address ##149, it adds an exclude parameter to remove fields from the response
For example, without the exclude parameter, the listAccounts response looks like:
With this patch, if user wants to remove
user
field from the response, they could do so using the exclude param: