Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to docs for MaaS /views/connections when they become available #531

Open
ksheedlo opened this issue Feb 11, 2016 · 0 comments
Open

Comments

@ksheedlo
Copy link
Contributor

The following code implements a new API call in the MaaS mock:

mimic/mimic/rest/maas_api.py

Lines 1161 to 1188 in 3b4039e

@app.route('/v1.0/<string:tenant_id>/views/connections', methods=['GET'])
def view_connections(self, request, tenant_id):
"""
Lists agent connections.
"""
maas_store = self._entity_cache_for_tenant(tenant_id).maas_store
if b'agentId' not in request.args:
request.setResponseCode(400)
return json.dumps({'type': 'badRequest',
'code': 400,
'message': 'Validation error for key \'agentId\'',
'details': 'You must specify an agentId',
'txnId': '.fake.mimic.transaction.id.c-1111111.ts-123444444.v-12344frf'})
agent_ids = request.args[b'agentId']
decoded_agent_ids = [agent_id.decode("utf-8") for agent_id in agent_ids]
connections = [{'agent_id': agent_id,
'connections': [connection.to_json()
for connection in maas_store.list_connections_for_agent(
agent_id)]}
for agent_id in decoded_agent_ids]
return json.dumps({'values': connections,
'metadata': {'count': len(connections),
'limit': None,
'marker': None,
'next_marker': None,
'next_href': None}})

No official docs are available yet for this call. We should link to them when they become available. Docs will most likely become available in the Agent Operations section or the Views section.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant