Vijay-1 commented on issue #2029: [Issue 1907] TO API for backup edge cachegroup
URL: 
https://github.com/apache/incubator-trafficcontrol/pull/2029#issuecomment-383509104
 
 
   @mitchell852 
   
   I spent some time in the GoLang version implementation today and i have some 
doubts on GoLang version's flexibility over Perl.
   
   Request you to point me to existing GoLang implementation for the cases 
described below which will help me in implementing GoLang version of Endpoints
   
   Given below are my observations:
   
   **DELETE**
   
   With GoLang, looks like we can have either one of the APIs and not both. 
Some of the modules i explored in GoLang version, I see only one format of 
delete query. If yes, should we stick with #2?
   
   1. DELETE all the fallbacks for a cache
       Example: DELETE api/{Version}/cachegroup_fallbacks?cacheGroupId=1
   
   2. DELETE a specific fallback for a cache
       Example: DELETE 
api/{Version}/cachegroup_fallbacks?cacheGroupId=1&fallbackId=5"
   
   ===================================================================
   GET:
   I am not sure whether we can return the following for GET
   
    { "cacheGroupId":1, "cacheGroupName":"GROUP1", "fallbackId":2, 
"fallbackOrder":10, "fallbackName":"GROUP2" }
   
    Since CacheGroupName and fallbackName are not cachegroup_fallback's column 
(cachegroup's column), i am not sure we can return them in GoLang version.
   
   ===============================================================
   
   POST:
   
   Can you point me to a GoLang module which handles json array.
   
   This works fine for me:
    my $json = '{"primaryId":3, "backupId": 1, "setOrder": 142}';
   
   But when i use arrays like the following, i am seeing the following error:
   >>>>cannot unmarshal array into Go value of type 
cachegroupfallback.TOCACHEGROUPFALLBACK]
   
    my $json = '[{"primaryId":3, "backupId": 1, "setOrder": 142}]';
   
   Post only for creates
   ===================================================================
    PUT:
    I belive we may have to support PUT 
/cachegroup_fallbacks[?cachegroupId=4&fallbackId=6]
   
   PUT for updates
   =================================================================== 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to