Skip to content

Commit

Permalink
Add agent installer command.
Browse files Browse the repository at this point in the history
  • Loading branch information
Tokunbo committed Feb 5, 2015
1 parent 0dc8f4b commit f71e383
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mimic/rest/maas_api.py
Expand Up @@ -631,6 +631,17 @@ def view_agent_host_info(self, request, tenant_id):
"txnId": ".fake.mimic.transaction.id.c-1111111.ts-123444444.v-12344frf"
})

@app.route('/v1.0/<string:tenant_id>/agent_installers', methods=['GET'])
def agent_installer(self, request, tenant_id):
"""
URL of agent install script
"""
xsil = "https://monitoring.api.rackspacecloud.com/"
xsil += "v1.0/747440/agent_installers/c69b2ceafc0444506fb32255af3d9be3.sh"
request.setResponseCode(201)
request.setHeader('x-shell-installer-location', xsil)
return ''

@app.route('/v1.0/<string:tenant_id>/notifications', methods=['POST'])
def create_notification(self, request, tenant_id):
"""
Expand Down
14 changes: 14 additions & 0 deletions mimic/test/test_maas.py
Expand Up @@ -388,6 +388,20 @@ def test_agenthostinfo(self):
data = self.get_responsebody(resp)
self.assertEquals(True, 'Agent does not exist' in json.dumps(data))

def test_agentinstallers(self):
"""
fetch agent installer
"""
req = request(self, self.root, "GET", self.uri + '/agent_installers', '')
resp = self.successResultOf(req)
self.assertEquals(resp.code, 201)
xsil = None
for h in resp.headers.getAllRawHeaders():
if h[0].lower() == 'x-shell-installer-location':
xsil = h[1][0]
break
self.assertTrue('monitoring.api' in xsil)

def test_metriclist(self):
"""
get available metrics
Expand Down

0 comments on commit f71e383

Please sign in to comment.