{"action":"created","comment":{"url":"https://api.github.com/repos/mikelangelo-project/unik/pulls/comments/76743297","id":76743297,"diff_hunk":"@@ -0,0 +1,97 @@\n+package openstack\n+\n+import (\n+\t\"fmt\"\n+\t\"github.com/emc-advanced-dev/unik/pkg/config\"\n+\t\"github.com/rackspace/gophercloud\"\n+\t\"github.com/rackspace/gophercloud/openstack\"\n+\t\"os\"\n+)\n+\n+type OpenStackHandle struct {\n+\tAuthClient *gophercloud.ProviderClient\n+\tRegion     string\n+}\n+\n+func ObtainCredentials(conf config.Openstack) (*gophercloud.AuthOptions, error) {\n+\t// Obtain credentials passed in config file\n+\tauth := gophercloud.AuthOptions{\n+\t\tIdentityEndpoint: conf.OSAuthUrl,\n+\t\tUserID:           conf.OSUserId,\n+\t\tUsername:         conf.OSUserName,\n+\t\tPassword:         conf.OSPassword,\n+\t\tTenantID:         conf.OSTenantId,\n+\t\tTenantName:       conf.OSTenantName,\n+\t\tDomainID:         conf.OSDomainId,\n+\t\tDomainName:       conf.OSDomainName,\n+\t}\n+\n+\t// Override with environment variables\n+\tif v := os.Getenv(\"OS_AUTH_URL\"); v != \"\" {\n+\t\tauth.IdentityEndpoint = v\n+\t}\n+\tif v := os.Getenv(\"OS_USER_ID\"); v != \"\" {\n+\t\tauth.UserID = v\n+\t}\n+\tif v := os.Getenv(\"OS_USERNAME\"); v != \"\" {\n+\t\tauth.Username = v\n+\t}\n+\tif v := os.Getenv(\"OS_PASSWORD\"); v != \"\" {\n+\t\tauth.Password = v\n+\t}\n+\tif v := os.Getenv(\"OS_TENANT_ID\"); v != \"\" {\n+\t\tauth.TenantID = v\n+\t}\n+\tif v := os.Getenv(\"OS_TENANT_NAME\"); v != \"\" {\n+\t\tauth.TenantName = v\n+\t}\n+\tif v := os.Getenv(\"OS_DOMAIN_ID\"); v != \"\" {\n+\t\tauth.DomainID = v\n+\t}\n+\tif v := os.Getenv(\"OS_DOMAIN_NAME\"); v != \"\" {\n+\t\tauth.DomainName = v\n+\t}\n+\n+\t// Validate\n+\tif auth.IdentityEndpoint == \"\" {\n+\t\treturn nil, fmt.Errorf(\"Argument OS_AUTH_URL needs to be set.\")\n+\t}\n+\tif auth.UserID == \"\" && auth.Username == \"\" {\n+\t\treturn nil, fmt.Errorf(\"Argument OS_USER_ID or OS_USERNAME needs to be set.\")\n+\t}\n+\tif auth.Password == \"\" {\n+\t\treturn nil, fmt.Errorf(\"Argument OS_PASSWORD needs to be set.\")\n+\t}\n+\tif auth.TenantID == \"\" && auth.TenantName == \"\" {\n+\t\treturn nil, fmt.Errorf(\"Argument OS_TENANT_ID or OS_TENANT_NAME needs to be set.\")\n+\t}\n+\n+\treturn &auth, nil\n+}\n+\n+func GetOpenStackHandle(conf config.Openstack) (*OpenStackHandle, error) {\n+\tcredentials, err := ObtainCredentials(conf)\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\tauthClient, err := openstack.AuthenticatedClient(*credentials)\n+\tif err != nil {\n+\t\treturn nil, err\n+\t}\n+\treturn &OpenStackHandle{\n+\t\tAuthClient: authClient,\n+\t\tRegion:     conf.OSRegion,\n+\t}, nil\n+}\n+\n+func GetNovaClient(handle *OpenStackHandle) (*gophercloud.ServiceClient, error) {","path":"pkg/providers/openstack/openstack_auth.go","position":87,"original_position":87,"commit_id":"7b0ec58ab55b53050e2f6d2b3145bfd63cb24b22","original_commit_id":"4b6fb018c8f50273d4b50a759e79c00d3033be1a","user":{"login":"miha-plesko","id":8102426,"avatar_url":"https://avatars.githubusercontent.com/u/8102426?v=3","gravatar_id":"","url":"https://api.github.com/users/miha-plesko","html_url":"https://github.com/miha-plesko","followers_url":"https://api.github.com/users/miha-plesko/followers","following_url":"https://api.github.com/users/miha-plesko/following{/other_user}","gists_url":"https://api.github.com/users/miha-plesko/gists{/gist_id}","starred_url":"https://api.github.com/users/miha-plesko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miha-plesko/subscriptions","organizations_url":"https://api.github.com/users/miha-plesko/orgs","repos_url":"https://api.github.com/users/miha-plesko/repos","events_url":"https://api.github.com/users/miha-plesko/events{/privacy}","received_events_url":"https://api.github.com/users/miha-plesko/received_events","type":"User","site_admin":false},"body":"Good point, there is actually no need!","created_at":"2016-08-30T07:36:34Z","updated_at":"2016-08-30T07:36:34Z","html_url":"https://github.com/mikelangelo-project/unik/pull/1#discussion_r76743297","pull_request_url":"https://api.github.com/repos/mikelangelo-project/unik/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/mikelangelo-project/unik/pulls/comments/76743297"},"html":{"href":"https://github.com/mikelangelo-project/unik/pull/1#discussion_r76743297"},"pull_request":{"href":"https://api.github.com/repos/mikelangelo-project/unik/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/mikelangelo-project/unik/pulls/1","id":83095684,"html_url":"https://github.com/mikelangelo-project/unik/pull/1","diff_url":"https://github.com/mikelangelo-project/unik/pull/1.diff","patch_url":"https://github.com/mikelangelo-project/unik/pull/1.patch","issue_url":"https://api.github.com/repos/mikelangelo-project/unik/issues/1","number":1,"state":"open","locked":false,"title":"Openstack integr basic","user":{"login":"miha-plesko","id":8102426,"avatar_url":"https://avatars.githubusercontent.com/u/8102426?v=3","gravatar_id":"","url":"https://api.github.com/users/miha-plesko","html_url":"https://github.com/miha-plesko","followers_url":"https://api.github.com/users/miha-plesko/followers","following_url":"https://api.github.com/users/miha-plesko/following{/other_user}","gists_url":"https://api.github.com/users/miha-plesko/gists{/gist_id}","starred_url":"https://api.github.com/users/miha-plesko/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/miha-plesko/subscriptions","organizations_url":"https://api.github.com/users/miha-plesko/orgs","repos_url":"https://api.github.com/users/miha-plesko/repos","events_url":"https://api.github.com/users/miha-plesko/events{/privacy}","received_events_url":"https://api.github.com/users/miha-plesko/received_events","type":"User","site_admin":false},"body":"# Purpose or Intent\r\nThis PR introduces OpenStack provider. It consists of three commits:\r\n- vendor code only\r\n- stubs for OpenStack only\r\n- implementation of basic functions\r\n\r\nPlease consult commit messages for more details.\r\n\r\n# Testing\r\n0. start DevStack and obtain it's IP address\r\n1. add openstack provider to the daemon-config.yml, as described [here](https://github.com/mikelangelo-project/unik/blob/openstack-integr-basic/docs/providers/openstack.md)\r\n2. run daemon\r\n3. `cd` into this folder: \r\n[Example-JavaBurekMinimal.zip](https://github.com/mikelangelo-project/unik/files/442427/Example-JavaBurekMinimal.zip)\r\nand run to STAGE IMAGE + RUN INSTANCE :\r\n```\r\n./unik_openstack_up.sh\r\n```\r\nand then to DELETE IMAGE and DELETE INSTANCE:\r\n```\r\n./unik_openstack_down.sh\r\n```\r\n\r\nAfter the first command an image and instance should appear on your OpenStack - instanc should print \"BUREK\" to the console 10 times.\r\n\r\n\r\n","created_at":"2016-08-29T13:06:31Z","updated_at":"2016-08-30T07:36:34Z","closed_at":null,"merged_at":null,"merge_commit_sha":"12632e9d8691a5e71f4b65b984864fa4ff08e776","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mikelangelo-project/unik/pulls/1/commits","review_comments_url":"https://api.github.com/repos/mikelangelo-project/unik/pulls/1/comments","review_comment_url":"https://api.github.com/repos/mikelangelo-project/unik/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mikelangelo-project/unik/issues/1/comments","statuses_url":"https://api.github.com/repos/mikelangelo-project/unik/statuses/7b0ec58ab55b53050e2f6d2b3145bfd63cb24b22","head":{"label":"mikelangelo-project:openstack-integr-basic","ref":"openstack-integr-basic","sha":"7b0ec58ab55b53050e2f6d2b3145bfd63cb24b22","user":{"login":"mikelangelo-project","id":19607578,"avatar_url":"https://avatars.githubusercontent.com/u/19607578?v=3","gravatar_id":"","url":"https://api.github.com/users/mikelangelo-project","html_url":"https://github.com/mikelangelo-project","followers_url":"https://api.github.com/users/mikelangelo-project/followers","following_url":"https://api.github.com/users/mikelangelo-project/following{/other_user}","gists_url":"https://api.github.com/users/mikelangelo-project/gists{/gist_id}","starred_url":"https://api.github.com/users/mikelangelo-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikelangelo-project/subscriptions","organizations_url":"https://api.github.com/users/mikelangelo-project/orgs","repos_url":"https://api.github.com/users/mikelangelo-project/repos","events_url":"https://api.github.com/users/mikelangelo-project/events{/privacy}","received_events_url":"https://api.github.com/users/mikelangelo-project/received_events","type":"Organization","site_admin":false},"repo":{"id":65882279,"name":"unik","full_name":"mikelangelo-project/unik","owner":{"login":"mikelangelo-project","id":19607578,"avatar_url":"https://avatars.githubusercontent.com/u/19607578?v=3","gravatar_id":"","url":"https://api.github.com/users/mikelangelo-project","html_url":"https://github.com/mikelangelo-project","followers_url":"https://api.github.com/users/mikelangelo-project/followers","following_url":"https://api.github.com/users/mikelangelo-project/following{/other_user}","gists_url":"https://api.github.com/users/mikelangelo-project/gists{/gist_id}","starred_url":"https://api.github.com/users/mikelangelo-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikelangelo-project/subscriptions","organizations_url":"https://api.github.com/users/mikelangelo-project/orgs","repos_url":"https://api.github.com/users/mikelangelo-project/repos","events_url":"https://api.github.com/users/mikelangelo-project/events{/privacy}","received_events_url":"https://api.github.com/users/mikelangelo-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mikelangelo-project/unik","description":"The Unikernel Compilation and Deployment Platform","fork":true,"url":"https://api.github.com/repos/mikelangelo-project/unik","forks_url":"https://api.github.com/repos/mikelangelo-project/unik/forks","keys_url":"https://api.github.com/repos/mikelangelo-project/unik/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikelangelo-project/unik/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikelangelo-project/unik/teams","hooks_url":"https://api.github.com/repos/mikelangelo-project/unik/hooks","issue_events_url":"https://api.github.com/repos/mikelangelo-project/unik/issues/events{/number}","events_url":"https://api.github.com/repos/mikelangelo-project/unik/events","assignees_url":"https://api.github.com/repos/mikelangelo-project/unik/assignees{/user}","branches_url":"https://api.github.com/repos/mikelangelo-project/unik/branches{/branch}","tags_url":"https://api.github.com/repos/mikelangelo-project/unik/tags","blobs_url":"https://api.github.com/repos/mikelangelo-project/unik/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikelangelo-project/unik/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikelangelo-project/unik/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikelangelo-project/unik/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikelangelo-project/unik/statuses/{sha}","languages_url":"https://api.github.com/repos/mikelangelo-project/unik/languages","stargazers_url":"https://api.github.com/repos/mikelangelo-project/unik/stargazers","contributors_url":"https://api.github.com/repos/mikelangelo-project/unik/contributors","subscribers_url":"https://api.github.com/repos/mikelangelo-project/unik/subscribers","subscription_url":"https://api.github.com/repos/mikelangelo-project/unik/subscription","commits_url":"https://api.github.com/repos/mikelangelo-project/unik/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikelangelo-project/unik/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikelangelo-project/unik/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikelangelo-project/unik/issues/comments{/number}","contents_url":"https://api.github.com/repos/mikelangelo-project/unik/contents/{+path}","compare_url":"https://api.github.com/repos/mikelangelo-project/unik/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikelangelo-project/unik/merges","archive_url":"https://api.github.com/repos/mikelangelo-project/unik/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikelangelo-project/unik/downloads","issues_url":"https://api.github.com/repos/mikelangelo-project/unik/issues{/number}","pulls_url":"https://api.github.com/repos/mikelangelo-project/unik/pulls{/number}","milestones_url":"https://api.github.com/repos/mikelangelo-project/unik/milestones{/number}","notifications_url":"https://api.github.com/repos/mikelangelo-project/unik/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikelangelo-project/unik/labels{/name}","releases_url":"https://api.github.com/repos/mikelangelo-project/unik/releases{/id}","deployments_url":"https://api.github.com/repos/mikelangelo-project/unik/deployments","created_at":"2016-08-17T06:35:58Z","updated_at":"2016-08-17T06:36:00Z","pushed_at":"2016-08-29T13:06:31Z","git_url":"git://github.com/mikelangelo-project/unik.git","ssh_url":"git@github.com:mikelangelo-project/unik.git","clone_url":"https://github.com/mikelangelo-project/unik.git","svn_url":"https://github.com/mikelangelo-project/unik","homepage":null,"size":25495,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"mikelangelo-project:develop","ref":"develop","sha":"3b687bf0b4b2a6877f2b3c320a922f9e813a06e6","user":{"login":"mikelangelo-project","id":19607578,"avatar_url":"https://avatars.githubusercontent.com/u/19607578?v=3","gravatar_id":"","url":"https://api.github.com/users/mikelangelo-project","html_url":"https://github.com/mikelangelo-project","followers_url":"https://api.github.com/users/mikelangelo-project/followers","following_url":"https://api.github.com/users/mikelangelo-project/following{/other_user}","gists_url":"https://api.github.com/users/mikelangelo-project/gists{/gist_id}","starred_url":"https://api.github.com/users/mikelangelo-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikelangelo-project/subscriptions","organizations_url":"https://api.github.com/users/mikelangelo-project/orgs","repos_url":"https://api.github.com/users/mikelangelo-project/repos","events_url":"https://api.github.com/users/mikelangelo-project/events{/privacy}","received_events_url":"https://api.github.com/users/mikelangelo-project/received_events","type":"Organization","site_admin":false},"repo":{"id":65882279,"name":"unik","full_name":"mikelangelo-project/unik","owner":{"login":"mikelangelo-project","id":19607578,"avatar_url":"https://avatars.githubusercontent.com/u/19607578?v=3","gravatar_id":"","url":"https://api.github.com/users/mikelangelo-project","html_url":"https://github.com/mikelangelo-project","followers_url":"https://api.github.com/users/mikelangelo-project/followers","following_url":"https://api.github.com/users/mikelangelo-project/following{/other_user}","gists_url":"https://api.github.com/users/mikelangelo-project/gists{/gist_id}","starred_url":"https://api.github.com/users/mikelangelo-project/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mikelangelo-project/subscriptions","organizations_url":"https://api.github.com/users/mikelangelo-project/orgs","repos_url":"https://api.github.com/users/mikelangelo-project/repos","events_url":"https://api.github.com/users/mikelangelo-project/events{/privacy}","received_events_url":"https://api.github.com/users/mikelangelo-project/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mikelangelo-project/unik","description":"The Unikernel Compilation and Deployment Platform","fork":true,"url":"https://api.github.com/repos/mikelangelo-project/unik","forks_url":"https://api.github.com/repos/mikelangelo-project/unik/forks","keys_url":"https://api.github.com/repos/mikelangelo-project/unik/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mikelangelo-project/unik/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mikelangelo-project/unik/teams","hooks_url":"https://api.github.com/repos/mikelangelo-project/unik/hooks","issue_events_url":"https://api.github.com/repos/mikelangelo-project/unik/issues/events{/number}","events_url":"https://api.github.com/repos/mikelangelo-project/unik/events","assignees_url":"https://api.github.com/repos/mikelangelo-project/unik/assignees{/user}","branches_url":"https://api.github.com/repos/mikelangelo-project/unik/branches{/branch}","tags_url":"https://api.github.com/repos/mikelangelo-project/unik/tags","blobs_url":"https://api.github.com/repos/mikelangelo-project/unik/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mikelangelo-project/unik/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mikelangelo-project/unik/git/refs{/sha}","trees_url":"https://api.github.com/repos/mikelangelo-project/unik/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mikelangelo-project/unik/statuses/{sha}","languages_url":"https://api.github.com/repos/mikelangelo-project/unik/languages","stargazers_url":"https://api.github.com/repos/mikelangelo-project/unik/stargazers","contributors_url":"https://api.github.com/repos/mikelangelo-project/unik/contributors","subscribers_url":"https://api.github.com/repos/mikelangelo-project/unik/subscribers","subscription_url":"https://api.github.com/repos/mikelangelo-project/unik/subscription","commits_url":"https://api.github.com/repos/mikelangelo-project/unik/commits{/sha}","git_commits_url":"https://api.github.com/repos/mikelangelo-project/unik/git/commits{/sha}","comments_url":"https://api.github.com/repos/mikelangelo-project/unik/comments{/number}","issue_comment_url":"https://api.github.com/repos/mikelangelo-project/unik/issues/comments{/number}","contents_url":"https://api.github.com/repos/mikelangelo-project/unik/contents/{+path}","compare_url":"https://api.github.com/repos/mikelangelo-project/unik/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mikelangelo-project/unik/merges","archive_url":"https://api.github.com/repos/mikelangelo-project/unik/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mikelangelo-project/unik/downloads","issues_url":"https://api.github.com/repos/mikelangelo-project/unik/issues{/number}","pulls_url":"https://api.github.com/repos/mikelangelo-project/unik/pulls{/number}","milestones_url":"https://api.github.com/repos/mikelangelo-project/unik/milestones{/number}","notifications_url":"https://api.github.com/repos/mikelangelo-project/unik/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mikelangelo-project/unik/labels{/name}","releases_url":"https://api.github.com/repos/mikelangelo-project/unik/releases{/id}","deployments_url":"https://api.github.com/repos/mikelangelo-project/unik/deployments","created_at":"2016-08-17T06:35:58Z","updated_at":"2016-08-17T06:36:00Z","pushed_at":"2016-08-29T13:06:31Z","git_url":"git://github.com/mikelangelo-project/unik.git","ssh_url":"git@github.com:mikelangelo-project/unik.git","clone_url":"https://github.com/mikelangelo-project/unik.git","svn_url":"https://github.com/mikelangelo-project/unik","homepage":null,"size":25495,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mikelangelo-project/unik/pulls/1"},"html":{"href":"https://github.com/mikelangelo-project/unik/pull/1"},"issue":{"href":"https://api.github.com/repos/mikelangelo-project/unik/issues/1"},"comments":{"href":"https://api.github.com/repos/mikelangelo-project/unik/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/mikelangelo-project/unik/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/mikelangelo-project/unik/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mikelangelo-project/unik/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/mikelangelo-project/unik/statuses/7b0ec58ab55b53050e2f6d2b3145bfd63cb24b22"}}}}
{"actor":{"display_login":"miha-plesko"}}