{"action":"created","issue":{"url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/697","repository_url":"https://api.github.com/repos/Azure/azure-sdk-for-java","labels_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/697/labels{/name}","comments_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/697/comments","events_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/697/events","html_url":"https://github.com/Azure/azure-sdk-for-java/issues/697","id":154113287,"number":697,"title":"Fluent flow in VM::OSDisk","user":{"login":"anuchandy","id":1471612,"avatar_url":"https://avatars.githubusercontent.com/u/1471612?v=3","gravatar_id":"","url":"https://api.github.com/users/anuchandy","html_url":"https://github.com/anuchandy","followers_url":"https://api.github.com/users/anuchandy/followers","following_url":"https://api.github.com/users/anuchandy/following{/other_user}","gists_url":"https://api.github.com/users/anuchandy/gists{/gist_id}","starred_url":"https://api.github.com/users/anuchandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anuchandy/subscriptions","organizations_url":"https://api.github.com/users/anuchandy/orgs","repos_url":"https://api.github.com/users/anuchandy/repos","events_url":"https://api.github.com/users/anuchandy/events{/privacy}","received_events_url":"https://api.github.com/users/anuchandy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-10T21:39:58Z","updated_at":"2016-05-14T00:50:33Z","closed_at":null,"body":"This is a thread for discussing design of `withImage`,  `defineOSDisk` variants and `withExistingOSDisk` that needs to be enabled in VM fluent definition flow. \r\n\r\nThe `withImage`  variants allows basic user to easily declare the image to be used for the VM's OS Disk (with default configuration) \r\n\r\nThe `defineOSDisk` variants allows user to declare the image along with OS disk configuration, such as caching, size, encryption settings etc..\r\n\r\nThe `withExistingOSDisk` allows user to attach an existing OS Disk VHD for the VM.\r\n\r\n![office lens 20160510-144554](https://cloud.githubusercontent.com/assets/2320445/15163605/3ba32cce-16be-11e6-8b88-6018c39d684c.jpg)\r\n\r\n```java\r\nwithImage(ImageReference imageReference);\r\nwithLatestImage(String publisher, String offer, String sku);\r\nwithKnownImage(KnownVirtualMachineImage knownImage);\r\nwithUserImage(String containerName, String vhdName);\r\n\r\nfromImage(ImageReference imageReference);\r\nfromLatestImage(String publisher, String offer, String sku);\r\nfromKnownImage(KnownVirtualMachineImage knownImage);\r\nfromUserImage(String containerName, String vhdName);\r\n\r\nwithExistingOSDisk(String containerName, String vhdName, OperatingSystemTypes osType);\r\n\r\ndefineOSDisk(String name);\r\nstoreVhdAt(String containerName, String vhdName);\r\nDefinitionWithDataDisk attach();\r\n```"},"comment":{"url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/comments/219190496","html_url":"https://github.com/Azure/azure-sdk-for-java/issues/697#issuecomment-219190496","issue_url":"https://api.github.com/repos/Azure/azure-sdk-for-java/issues/697","id":219190496,"user":{"login":"anuchandy","id":1471612,"avatar_url":"https://avatars.githubusercontent.com/u/1471612?v=3","gravatar_id":"","url":"https://api.github.com/users/anuchandy","html_url":"https://github.com/anuchandy","followers_url":"https://api.github.com/users/anuchandy/followers","following_url":"https://api.github.com/users/anuchandy/following{/other_user}","gists_url":"https://api.github.com/users/anuchandy/gists{/gist_id}","starred_url":"https://api.github.com/users/anuchandy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/anuchandy/subscriptions","organizations_url":"https://api.github.com/users/anuchandy/orgs","repos_url":"https://api.github.com/users/anuchandy/repos","events_url":"https://api.github.com/users/anuchandy/events{/privacy}","received_events_url":"https://api.github.com/users/anuchandy/received_events","type":"User","site_admin":false},"created_at":"2016-05-14T00:50:33Z","updated_at":"2016-05-14T00:50:33Z","body":"Ok, we can decide on placement of config options later.\r\n\r\nAgree, so for top-level resources renames are `provision() -> create()`, `apply() -> update()`\r\n\r\nFor optional child complex type which we start with 'defineXXXXX()' can be end with `apply() OR set()` (e.g. `defineConfiguration` in the above diagram)\r\n\r\nBelow is the diagram showing different approach we discussed to set the intermediate complex optionals.\r\n\r\n![grammar](https://cloud.githubusercontent.com/assets/1471612/15265121/f026af16-1931-11e6-9c9d-b366f4721ead.png)"}}