{"action":"created","comment":{"url":"https://api.github.com/repos/scaleway/scaleway-cli/pulls/comments/36523226","id":36523226,"diff_hunk":"@@ -34,36 +32,22 @@ func RunLogin(ctx CommandContext, args LoginArgs) error {\n \t}\n \n \tcfg := &api.Config{\n-\t\tAPIEndPoint:  \"https://account.scaleway.com/\",\n-\t\tOrganization: strings.Trim(args.Organization, \"\\n\"),\n-\t\tToken:        strings.Trim(args.Token, \"\\n\"),\n+\t\tAPIEndPoint:     \"https://api.scaleway.com/\",\n+\t\tACCOUNTEndPoint: \"https://account.scaleway.com/\",\n+\t\tOrganization:    strings.Trim(args.Organization, \"\\n\"),\n+\t\tToken:           strings.Trim(args.Token, \"\\n\"),\n \t}\n \n-\tapi, err := api.NewScalewayAPI(cfg.APIEndPoint, cfg.Organization, cfg.Token)\n+\tapi, err := api.NewScalewayAPI(cfg.APIEndPoint, cfg.ACCOUNTEndPoint, cfg.Organization, cfg.Token)\n \tif err != nil {\n \t\treturn fmt.Errorf(\"Unable to create ScalewayAPI: %s\", err)\n \t}\n+\tapi.EnableAccountApi()","path":"pkg/commands/login.go","position":34,"original_position":34,"commit_id":"4477f8cdaf607b5d7043a8e39492fedff858333a","original_commit_id":"4477f8cdaf607b5d7043a8e39492fedff858333a","user":{"login":"moul","id":94029,"avatar_url":"https://avatars.githubusercontent.com/u/94029?v=3","gravatar_id":"","url":"https://api.github.com/users/moul","html_url":"https://github.com/moul","followers_url":"https://api.github.com/users/moul/followers","following_url":"https://api.github.com/users/moul/following{/other_user}","gists_url":"https://api.github.com/users/moul/gists{/gist_id}","starred_url":"https://api.github.com/users/moul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moul/subscriptions","organizations_url":"https://api.github.com/users/moul/orgs","repos_url":"https://api.github.com/users/moul/repos","events_url":"https://api.github.com/users/moul/events{/privacy}","received_events_url":"https://api.github.com/users/moul/received_events","type":"User","site_admin":false},"body":"Can you move this call in `api.CheckCredentials()`, and calls `DisableAccountApi` just after but still inside the same function ?","created_at":"2015-08-07T14:22:55Z","updated_at":"2015-08-07T14:22:55Z","html_url":"https://github.com/scaleway/scaleway-cli/pull/106#discussion_r36523226","pull_request_url":"https://api.github.com/repos/scaleway/scaleway-cli/pulls/106","_links":{"self":{"href":"https://api.github.com/repos/scaleway/scaleway-cli/pulls/comments/36523226"},"html":{"href":"https://github.com/scaleway/scaleway-cli/pull/106#discussion_r36523226"},"pull_request":{"href":"https://api.github.com/repos/scaleway/scaleway-cli/pulls/106"}}},"pull_request":{"url":"https://api.github.com/repos/scaleway/scaleway-cli/pulls/106","id":41894977,"html_url":"https://github.com/scaleway/scaleway-cli/pull/106","diff_url":"https://github.com/scaleway/scaleway-cli/pull/106.diff","patch_url":"https://github.com/scaleway/scaleway-cli/pull/106.patch","issue_url":"https://api.github.com/repos/scaleway/scaleway-cli/issues/106","number":106,"state":"open","locked":false,"title":"add account api in the config file","user":{"login":"QuentinPerez","id":3081204,"avatar_url":"https://avatars.githubusercontent.com/u/3081204?v=3","gravatar_id":"","url":"https://api.github.com/users/QuentinPerez","html_url":"https://github.com/QuentinPerez","followers_url":"https://api.github.com/users/QuentinPerez/followers","following_url":"https://api.github.com/users/QuentinPerez/following{/other_user}","gists_url":"https://api.github.com/users/QuentinPerez/gists{/gist_id}","starred_url":"https://api.github.com/users/QuentinPerez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuentinPerez/subscriptions","organizations_url":"https://api.github.com/users/QuentinPerez/orgs","repos_url":"https://api.github.com/users/QuentinPerez/repos","events_url":"https://api.github.com/users/QuentinPerez/events{/privacy}","received_events_url":"https://api.github.com/users/QuentinPerez/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-07T14:05:27Z","updated_at":"2015-08-07T14:22:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"a4c4781415106a13986d3c67df4d27d43eb405e2","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/scaleway/scaleway-cli/pulls/106/commits","review_comments_url":"https://api.github.com/repos/scaleway/scaleway-cli/pulls/106/comments","review_comment_url":"https://api.github.com/repos/scaleway/scaleway-cli/pulls/comments{/number}","comments_url":"https://api.github.com/repos/scaleway/scaleway-cli/issues/106/comments","statuses_url":"https://api.github.com/repos/scaleway/scaleway-cli/statuses/4477f8cdaf607b5d7043a8e39492fedff858333a","head":{"label":"QuentinPerez:account_api","ref":"account_api","sha":"4477f8cdaf607b5d7043a8e39492fedff858333a","user":{"login":"QuentinPerez","id":3081204,"avatar_url":"https://avatars.githubusercontent.com/u/3081204?v=3","gravatar_id":"","url":"https://api.github.com/users/QuentinPerez","html_url":"https://github.com/QuentinPerez","followers_url":"https://api.github.com/users/QuentinPerez/followers","following_url":"https://api.github.com/users/QuentinPerez/following{/other_user}","gists_url":"https://api.github.com/users/QuentinPerez/gists{/gist_id}","starred_url":"https://api.github.com/users/QuentinPerez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuentinPerez/subscriptions","organizations_url":"https://api.github.com/users/QuentinPerez/orgs","repos_url":"https://api.github.com/users/QuentinPerez/repos","events_url":"https://api.github.com/users/QuentinPerez/events{/privacy}","received_events_url":"https://api.github.com/users/QuentinPerez/received_events","type":"User","site_admin":false},"repo":{"id":40306381,"name":"scaleway-cli","full_name":"QuentinPerez/scaleway-cli","owner":{"login":"QuentinPerez","id":3081204,"avatar_url":"https://avatars.githubusercontent.com/u/3081204?v=3","gravatar_id":"","url":"https://api.github.com/users/QuentinPerez","html_url":"https://github.com/QuentinPerez","followers_url":"https://api.github.com/users/QuentinPerez/followers","following_url":"https://api.github.com/users/QuentinPerez/following{/other_user}","gists_url":"https://api.github.com/users/QuentinPerez/gists{/gist_id}","starred_url":"https://api.github.com/users/QuentinPerez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/QuentinPerez/subscriptions","organizations_url":"https://api.github.com/users/QuentinPerez/orgs","repos_url":"https://api.github.com/users/QuentinPerez/repos","events_url":"https://api.github.com/users/QuentinPerez/events{/privacy}","received_events_url":"https://api.github.com/users/QuentinPerez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/QuentinPerez/scaleway-cli","description":":computer: Manage BareMetal Servers from Command Line (as easily as with Docker)","fork":true,"url":"https://api.github.com/repos/QuentinPerez/scaleway-cli","forks_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/forks","keys_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/teams","hooks_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/hooks","issue_events_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/issues/events{/number}","events_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/events","assignees_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/assignees{/user}","branches_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/branches{/branch}","tags_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/tags","blobs_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/languages","stargazers_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/stargazers","contributors_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/contributors","subscribers_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/subscribers","subscription_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/subscription","commits_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/contents/{+path}","compare_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/merges","archive_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/downloads","issues_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/issues{/number}","pulls_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/labels{/name}","releases_url":"https://api.github.com/repos/QuentinPerez/scaleway-cli/releases{/id}","created_at":"2015-08-06T13:30:40Z","updated_at":"2015-08-06T13:30:41Z","pushed_at":"2015-08-07T14:05:13Z","git_url":"git://github.com/QuentinPerez/scaleway-cli.git","ssh_url":"git@github.com:QuentinPerez/scaleway-cli.git","clone_url":"https://github.com/QuentinPerez/scaleway-cli.git","svn_url":"https://github.com/QuentinPerez/scaleway-cli","homepage":"https://blog.scaleway.com/2015/05/20/manage-baremetal-servers-with-scaleway-cli/","size":1466,"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":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"scaleway:master","ref":"master","sha":"0d048dcd74c15cbe07da743e2612c2238a35a549","user":{"login":"scaleway","id":5185491,"avatar_url":"https://avatars.githubusercontent.com/u/5185491?v=3","gravatar_id":"","url":"https://api.github.com/users/scaleway","html_url":"https://github.com/scaleway","followers_url":"https://api.github.com/users/scaleway/followers","following_url":"https://api.github.com/users/scaleway/following{/other_user}","gists_url":"https://api.github.com/users/scaleway/gists{/gist_id}","starred_url":"https://api.github.com/users/scaleway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scaleway/subscriptions","organizations_url":"https://api.github.com/users/scaleway/orgs","repos_url":"https://api.github.com/users/scaleway/repos","events_url":"https://api.github.com/users/scaleway/events{/privacy}","received_events_url":"https://api.github.com/users/scaleway/received_events","type":"Organization","site_admin":false},"repo":{"id":32575663,"name":"scaleway-cli","full_name":"scaleway/scaleway-cli","owner":{"login":"scaleway","id":5185491,"avatar_url":"https://avatars.githubusercontent.com/u/5185491?v=3","gravatar_id":"","url":"https://api.github.com/users/scaleway","html_url":"https://github.com/scaleway","followers_url":"https://api.github.com/users/scaleway/followers","following_url":"https://api.github.com/users/scaleway/following{/other_user}","gists_url":"https://api.github.com/users/scaleway/gists{/gist_id}","starred_url":"https://api.github.com/users/scaleway/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/scaleway/subscriptions","organizations_url":"https://api.github.com/users/scaleway/orgs","repos_url":"https://api.github.com/users/scaleway/repos","events_url":"https://api.github.com/users/scaleway/events{/privacy}","received_events_url":"https://api.github.com/users/scaleway/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/scaleway/scaleway-cli","description":":computer: Manage BareMetal Servers from Command Line (as easily as with Docker)","fork":false,"url":"https://api.github.com/repos/scaleway/scaleway-cli","forks_url":"https://api.github.com/repos/scaleway/scaleway-cli/forks","keys_url":"https://api.github.com/repos/scaleway/scaleway-cli/keys{/key_id}","collaborators_url":"https://api.github.com/repos/scaleway/scaleway-cli/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/scaleway/scaleway-cli/teams","hooks_url":"https://api.github.com/repos/scaleway/scaleway-cli/hooks","issue_events_url":"https://api.github.com/repos/scaleway/scaleway-cli/issues/events{/number}","events_url":"https://api.github.com/repos/scaleway/scaleway-cli/events","assignees_url":"https://api.github.com/repos/scaleway/scaleway-cli/assignees{/user}","branches_url":"https://api.github.com/repos/scaleway/scaleway-cli/branches{/branch}","tags_url":"https://api.github.com/repos/scaleway/scaleway-cli/tags","blobs_url":"https://api.github.com/repos/scaleway/scaleway-cli/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/scaleway/scaleway-cli/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/scaleway/scaleway-cli/git/refs{/sha}","trees_url":"https://api.github.com/repos/scaleway/scaleway-cli/git/trees{/sha}","statuses_url":"https://api.github.com/repos/scaleway/scaleway-cli/statuses/{sha}","languages_url":"https://api.github.com/repos/scaleway/scaleway-cli/languages","stargazers_url":"https://api.github.com/repos/scaleway/scaleway-cli/stargazers","contributors_url":"https://api.github.com/repos/scaleway/scaleway-cli/contributors","subscribers_url":"https://api.github.com/repos/scaleway/scaleway-cli/subscribers","subscription_url":"https://api.github.com/repos/scaleway/scaleway-cli/subscription","commits_url":"https://api.github.com/repos/scaleway/scaleway-cli/commits{/sha}","git_commits_url":"https://api.github.com/repos/scaleway/scaleway-cli/git/commits{/sha}","comments_url":"https://api.github.com/repos/scaleway/scaleway-cli/comments{/number}","issue_comment_url":"https://api.github.com/repos/scaleway/scaleway-cli/issues/comments{/number}","contents_url":"https://api.github.com/repos/scaleway/scaleway-cli/contents/{+path}","compare_url":"https://api.github.com/repos/scaleway/scaleway-cli/compare/{base}...{head}","merges_url":"https://api.github.com/repos/scaleway/scaleway-cli/merges","archive_url":"https://api.github.com/repos/scaleway/scaleway-cli/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/scaleway/scaleway-cli/downloads","issues_url":"https://api.github.com/repos/scaleway/scaleway-cli/issues{/number}","pulls_url":"https://api.github.com/repos/scaleway/scaleway-cli/pulls{/number}","milestones_url":"https://api.github.com/repos/scaleway/scaleway-cli/milestones{/number}","notifications_url":"https://api.github.com/repos/scaleway/scaleway-cli/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/scaleway/scaleway-cli/labels{/name}","releases_url":"https://api.github.com/repos/scaleway/scaleway-cli/releases{/id}","created_at":"2015-03-20T09:45:50Z","updated_at":"2015-08-05T05:05:03Z","pushed_at":"2015-08-07T14:05:28Z","git_url":"git://github.com/scaleway/scaleway-cli.git","ssh_url":"git@github.com:scaleway/scaleway-cli.git","clone_url":"https://github.com/scaleway/scaleway-cli.git","svn_url":"https://github.com/scaleway/scaleway-cli","homepage":"https://blog.scaleway.com/2015/05/20/manage-baremetal-servers-with-scaleway-cli/","size":2437,"stargazers_count":29,"watchers_count":29,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":16,"forks":6,"open_issues":16,"watchers":29,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/scaleway/scaleway-cli/pulls/106"},"html":{"href":"https://github.com/scaleway/scaleway-cli/pull/106"},"issue":{"href":"https://api.github.com/repos/scaleway/scaleway-cli/issues/106"},"comments":{"href":"https://api.github.com/repos/scaleway/scaleway-cli/issues/106/comments"},"review_comments":{"href":"https://api.github.com/repos/scaleway/scaleway-cli/pulls/106/comments"},"review_comment":{"href":"https://api.github.com/repos/scaleway/scaleway-cli/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/scaleway/scaleway-cli/pulls/106/commits"},"statuses":{"href":"https://api.github.com/repos/scaleway/scaleway-cli/statuses/4477f8cdaf607b5d7043a8e39492fedff858333a"}}}}