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

Return picture href for generic objects subcollections #126

Merged
merged 1 commit into from
Oct 16, 2017
Merged

Return picture href for generic objects subcollections #126

merged 1 commit into from
Oct 16, 2017

Conversation

jntullo
Copy link

@jntullo jntullo commented Oct 16, 2017

This enhancement automatically returns the picture href if the picture attribute is specified for generic objects.

Example Usage

GET /api/services/10r1?expand=generic_objects&attributes=generic_objects.picture

@miq-bot add_label enhancement
@miq-bot assign @abellotti

cc: @chalettu

@chalettu
Copy link

@jntullo this is great. Can you show an example of the output? The output we were seeing last week didn't include the pictures file extension and the correct path.

Verified

This commit was signed with the committer’s verified signature.
sagikazarmark Márk Sági-Kazár
…pecified
@miq-bot
Copy link
Member

miq-bot commented Oct 16, 2017

Checked commit jntullo@7395fed with ruby 2.3.3, rubocop 0.47.1, and haml-lint 0.20.0
2 files checked, 0 offenses detected
Everything looks fine. 🍪

@jntullo
Copy link
Author

jntullo commented Oct 16, 2017

@chalettu

{  
   "href":"http://localhost:3000/api/services/10000000000645",
   "id":"10000000000645",
   "name":"Jillian's Azure Service",
   "description":"Azure",
   "guid":"6ce8f6c2-7f93-4a7e-b618-da9acab470ac",
   "options":{  

   },
   "display":false,
   "created_at":"2017-08-07T16:52:46Z",
   "updated_at":"2017-08-07T16:52:46Z",
   "miq_group_id":"10000000000001",
   "retired":false,
   "tenant_id":"10000000000001",
   "initiator":"user",
   "generic_objects":[  
      {  
         "href":"http://localhost:3000/api/services/10000000000645/generic_objects/10000000000001",
         "id":"10000000000001",
         "name":"GO 2",
         "generic_object_definition_id":"10000000000001",
         "created_at":"2017-08-15T17:35:08Z",
         "updated_at":"2017-09-07T12:05:14Z",
         "properties":{  
            "vms":[  
               10000000000615
            ],
            "start":true
         },
         "picture":{  
            "href":"http://localhost:3000/api/picture/10000000000001",
            "id":"10000000000001",
            "resource_id":"10000000000001",
            "resource_type":"GenericObjectDefinition",
            "image_href":"http://localhost:3000/pictures/10r1.png",
            "extension":"png"
         }
      }
   ],
   "actions"   {  
      ...
   }
}

@chalettu
Copy link

That looks perfect. Great addition

@abellotti
Copy link
Member

@jntullo I wonder if the above change will cause expectation that we always return that attr even if just querying pictures. Do you think we should add image_href to additional_attributes for picture resources ?

Doesn't need to be changed here, just something to think about, could be follow-up PR.

@jntullo
Copy link
Author

jntullo commented Oct 16, 2017

@abellotti was just putting that together, actually 😆 👍 (separate PR)

@abellotti
Copy link
Member

btw, is this still needed if the other PR #127 gets merged ?

@jntullo
Copy link
Author

jntullo commented Oct 16, 2017

@abellotti yes it is

@abellotti abellotti added this to the Sprint 71 Ending Oct 16, 2017 milestone Oct 16, 2017
@abellotti abellotti merged commit 1981fd7 into ManageIQ:master Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants