{"action":"created","comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/comments/37298464","id":37298464,"diff_hunk":"@@ -0,0 +1,129 @@\n+# Copyright 2015 Google Inc. All rights reserved.\n+#\n+# Licensed under the Apache License, Version 2.0 (the \"License\");\n+# you may not use this file except in compliance with the License.\n+# You may obtain a copy of the License at\n+#\n+#   http://www.apache.org/licenses/LICENSE-2.0\n+#\n+# Unless required by applicable law or agreed to in writing, software\n+# distributed under the License is distributed on an \"AS IS\" BASIS,\n+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+# See the License for the specific language governing permissions and\n+# limitations under the License.\n+\n+# ./pkb.py --cloud=Centurylink --machine_type=UBUNTU-12-64-TEMPLATE\n+# --benchmarks=iperf\n+\n+from perfkitbenchmarker import linux_virtual_machine\n+from perfkitbenchmarker import virtual_machine\n+from perfkitbenchmarker import vm_util\n+from perfkitbenchmarker.centurylink import clc_disk\n+from perfkitbenchmarker.centurylink import util\n+\n+\n+class CenturylinkVirtualMachine(virtual_machine.BaseVirtualMachine):\n+    \"\"\"Object representing a Centurylink Virtual Machine.\"\"\"\n+\n+    DEFAULT_ZONE = 'NY1'\n+    DEFAULT_MACHINE_TYPE = 'UBUNTU-12-64-TEMPLATE'\n+    DEFAULT_IMAGE = 'ubuntu-14-04-x64'\n+\n+    def __init__(self, vm_spec):\n+        \"\"\"Initialize a Centurylink virtual machine.\"\"\"\n+\n+        super(CenturylinkVirtualMachine, self).__init__(vm_spec)\n+        self.server_name = ''\n+        self.disk_size = 1\n+        self.max_local_disks = 1\n+        self.local_disk_counter = 0\n+\n+        env = util.GetDefaultCenturylinkEnv()\n+        self.api_key = env['API_KEY']\n+        self.api_passwd = env['API_PASSWD']\n+\n+    @classmethod\n+    def SetVmSpecDefaults(cls, vm_spec):\n+        \"\"\"Updates the VM spec with cloud specific defaults.\"\"\"\n+\n+        if vm_spec.machine_type is None:\n+            vm_spec.machine_type = cls.DEFAULT_MACHINE_TYPE\n+        if vm_spec.zone is None:\n+            vm_spec.zone = cls.DEFAULT_ZONE\n+        if vm_spec.image is None:\n+            vm_spec.image = cls.DEFAULT_IMAGE\n+\n+    def _Create(self):\n+        \"\"\"Create a Centurylink VM instance.\"\"\"\n+\n+        env = util.GetDefaultCenturylinkEnv()\n+        GROUP = env['GROUP']\n+        LOCATION = env['LOCATION']\n+        MACHINE_TYPE = self.machine_type\n+        NAME = env['VM_NAME']\n+        DESC = env['VM_DESC']\n+        BACKUP_LEVEL = env['BACKUP_LEVEL']\n+        NETWORK = env['NETWORK']\n+        CPU = env['CPU']\n+        RAM = env['RAM']\n+\n+        # Create a server with the specified inputs\n+        create_cmd = \"clc \\\n+            --v1-api-key %s \\\n+            --v1-api-passwd %s servers create \\\n+            --name %s \\\n+            --location %s \\\n+            --group '%s' \\\n+            --description '%s' \\\n+            --template %s \\\n+            --backup-level %s \\\n+            --network %s \\\n+            --cpu %d \\\n+            --ram %d\" % (\n+            self.api_key,\n+            self.api_passwd,\n+            NAME,\n+            LOCATION,","path":"perfkitbenchmarker/centurylink/clc_virtual_machine.py","position":86,"original_position":86,"commit_id":"faecf8660f539fbe761837584269b9fc1b902c71","original_commit_id":"faecf8660f539fbe761837584269b9fc1b902c71","user":{"login":"cloudspectator","id":7634426,"avatar_url":"https://avatars.githubusercontent.com/u/7634426?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudspectator","html_url":"https://github.com/cloudspectator","followers_url":"https://api.github.com/users/cloudspectator/followers","following_url":"https://api.github.com/users/cloudspectator/following{/other_user}","gists_url":"https://api.github.com/users/cloudspectator/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudspectator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudspectator/subscriptions","organizations_url":"https://api.github.com/users/cloudspectator/orgs","repos_url":"https://api.github.com/users/cloudspectator/repos","events_url":"https://api.github.com/users/cloudspectator/events{/privacy}","received_events_url":"https://api.github.com/users/cloudspectator/received_events","type":"User","site_admin":false},"body":"Location is same as zone. Will implement as you have suggested.","created_at":"2015-08-18T13:41:42Z","updated_at":"2015-08-18T13:41:42Z","html_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/423#discussion_r37298464","pull_request_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/423","_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/comments/37298464"},"html":{"href":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/423#discussion_r37298464"},"pull_request":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/423"}}},"pull_request":{"url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/423","id":42464815,"html_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/423","diff_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/423.diff","patch_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/423.patch","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/423","number":423,"state":"open","locked":false,"title":"Adding Cloud Provider CenturyLink","user":{"login":"kennymuli","id":9436761,"avatar_url":"https://avatars.githubusercontent.com/u/9436761?v=3","gravatar_id":"","url":"https://api.github.com/users/kennymuli","html_url":"https://github.com/kennymuli","followers_url":"https://api.github.com/users/kennymuli/followers","following_url":"https://api.github.com/users/kennymuli/following{/other_user}","gists_url":"https://api.github.com/users/kennymuli/gists{/gist_id}","starred_url":"https://api.github.com/users/kennymuli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kennymuli/subscriptions","organizations_url":"https://api.github.com/users/kennymuli/orgs","repos_url":"https://api.github.com/users/kennymuli/repos","events_url":"https://api.github.com/users/kennymuli/events{/privacy}","received_events_url":"https://api.github.com/users/kennymuli/received_events","type":"User","site_admin":false},"body":"Tested with iperf, ping, hpcc, and sysbench_oltp.","created_at":"2015-08-14T15:01:58Z","updated_at":"2015-08-18T13:41:42Z","closed_at":null,"merged_at":null,"merge_commit_sha":"751cbb2e075a0f2702e53734e265494e7a8e1fa8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/423/commits","review_comments_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/423/comments","review_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/423/comments","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/statuses/faecf8660f539fbe761837584269b9fc1b902c71","head":{"label":"cloudspectator:CloudSpectator","ref":"CloudSpectator","sha":"faecf8660f539fbe761837584269b9fc1b902c71","user":{"login":"cloudspectator","id":7634426,"avatar_url":"https://avatars.githubusercontent.com/u/7634426?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudspectator","html_url":"https://github.com/cloudspectator","followers_url":"https://api.github.com/users/cloudspectator/followers","following_url":"https://api.github.com/users/cloudspectator/following{/other_user}","gists_url":"https://api.github.com/users/cloudspectator/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudspectator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudspectator/subscriptions","organizations_url":"https://api.github.com/users/cloudspectator/orgs","repos_url":"https://api.github.com/users/cloudspectator/repos","events_url":"https://api.github.com/users/cloudspectator/events{/privacy}","received_events_url":"https://api.github.com/users/cloudspectator/received_events","type":"User","site_admin":false},"repo":{"id":40720206,"name":"PerfKitBenchmarker","full_name":"cloudspectator/PerfKitBenchmarker","owner":{"login":"cloudspectator","id":7634426,"avatar_url":"https://avatars.githubusercontent.com/u/7634426?v=3","gravatar_id":"","url":"https://api.github.com/users/cloudspectator","html_url":"https://github.com/cloudspectator","followers_url":"https://api.github.com/users/cloudspectator/followers","following_url":"https://api.github.com/users/cloudspectator/following{/other_user}","gists_url":"https://api.github.com/users/cloudspectator/gists{/gist_id}","starred_url":"https://api.github.com/users/cloudspectator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloudspectator/subscriptions","organizations_url":"https://api.github.com/users/cloudspectator/orgs","repos_url":"https://api.github.com/users/cloudspectator/repos","events_url":"https://api.github.com/users/cloudspectator/events{/privacy}","received_events_url":"https://api.github.com/users/cloudspectator/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cloudspectator/PerfKitBenchmarker","description":"Perfkit Benchmarker contains set of benchmarks to measure and compare cloud offerings. The benchmarks are not tuned (i.e. use defaults) to reflect what most users will see. PerfKit Benchmarker is licensed under the Apache 2 license terms. Please make sure to read, understand and agree to the terms of the LICENSE and CONTRIBUTING files before proceeding.","fork":true,"url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker","forks_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/forks","keys_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/teams","hooks_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/hooks","issue_events_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/issues/events{/number}","events_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/events","assignees_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/assignees{/user}","branches_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/branches{/branch}","tags_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/tags","blobs_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/git/refs{/sha}","trees_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/statuses/{sha}","languages_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/languages","stargazers_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/stargazers","contributors_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/contributors","subscribers_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/subscribers","subscription_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/subscription","commits_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/commits{/sha}","git_commits_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/git/commits{/sha}","comments_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/comments{/number}","issue_comment_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/issues/comments{/number}","contents_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/contents/{+path}","compare_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/merges","archive_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/downloads","issues_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/issues{/number}","pulls_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/pulls{/number}","milestones_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/milestones{/number}","notifications_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/labels{/name}","releases_url":"https://api.github.com/repos/cloudspectator/PerfKitBenchmarker/releases{/id}","created_at":"2015-08-14T14:50:04Z","updated_at":"2015-08-14T14:50:05Z","pushed_at":"2015-08-17T19:18:24Z","git_url":"git://github.com/cloudspectator/PerfKitBenchmarker.git","ssh_url":"git@github.com:cloudspectator/PerfKitBenchmarker.git","clone_url":"https://github.com/cloudspectator/PerfKitBenchmarker.git","svn_url":"https://github.com/cloudspectator/PerfKitBenchmarker","homepage":"","size":2641,"stargazers_count":0,"watchers_count":0,"language":"Python","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":"GoogleCloudPlatform:master","ref":"master","sha":"8099410ce71287b329a0d1d06ef09d2cad79e1d0","user":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"repo":{"id":21950910,"name":"PerfKitBenchmarker","full_name":"GoogleCloudPlatform/PerfKitBenchmarker","owner":{"login":"GoogleCloudPlatform","id":2810941,"avatar_url":"https://avatars.githubusercontent.com/u/2810941?v=3","gravatar_id":"","url":"https://api.github.com/users/GoogleCloudPlatform","html_url":"https://github.com/GoogleCloudPlatform","followers_url":"https://api.github.com/users/GoogleCloudPlatform/followers","following_url":"https://api.github.com/users/GoogleCloudPlatform/following{/other_user}","gists_url":"https://api.github.com/users/GoogleCloudPlatform/gists{/gist_id}","starred_url":"https://api.github.com/users/GoogleCloudPlatform/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/GoogleCloudPlatform/subscriptions","organizations_url":"https://api.github.com/users/GoogleCloudPlatform/orgs","repos_url":"https://api.github.com/users/GoogleCloudPlatform/repos","events_url":"https://api.github.com/users/GoogleCloudPlatform/events{/privacy}","received_events_url":"https://api.github.com/users/GoogleCloudPlatform/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker","description":"Perfkit Benchmarker contains set of benchmarks to measure and compare cloud offerings. The benchmarks are not tuned (i.e. use defaults) to reflect what most users will see. PerfKit Benchmarker is licensed under the Apache 2 license terms. Please make sure to read, understand and agree to the terms of the LICENSE and CONTRIBUTING files before proceeding.","fork":false,"url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker","forks_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/forks","keys_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/teams","hooks_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/hooks","issue_events_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/events{/number}","events_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/events","assignees_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/assignees{/user}","branches_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/branches{/branch}","tags_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/tags","blobs_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/refs{/sha}","trees_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/statuses/{sha}","languages_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/languages","stargazers_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/stargazers","contributors_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/contributors","subscribers_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/subscribers","subscription_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/subscription","commits_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/commits{/sha}","git_commits_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/git/commits{/sha}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/comments{/number}","issue_comment_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/comments{/number}","contents_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/contents/{+path}","compare_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/merges","archive_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/downloads","issues_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues{/number}","pulls_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls{/number}","milestones_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/milestones{/number}","notifications_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/labels{/name}","releases_url":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/releases{/id}","created_at":"2014-07-17T17:23:26Z","updated_at":"2015-08-18T06:08:27Z","pushed_at":"2015-08-18T11:09:59Z","git_url":"git://github.com/GoogleCloudPlatform/PerfKitBenchmarker.git","ssh_url":"git@github.com:GoogleCloudPlatform/PerfKitBenchmarker.git","clone_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker.git","svn_url":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker","homepage":"","size":150978,"stargazers_count":474,"watchers_count":474,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":70,"mirror_url":null,"open_issues_count":83,"forks":70,"open_issues":83,"watchers":474,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/423"},"html":{"href":"https://github.com/GoogleCloudPlatform/PerfKitBenchmarker/pull/423"},"issue":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/423"},"comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/issues/423/comments"},"review_comments":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/423/comments"},"review_comment":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/pulls/423/commits"},"statuses":{"href":"https://api.github.com/repos/GoogleCloudPlatform/PerfKitBenchmarker/statuses/faecf8660f539fbe761837584269b9fc1b902c71"}}}}