Repository navigation
Link to docs for MaaS /views/connections when they become available #531
Copy link
Copy link
Open
Description
The following code implements a new API call in the MaaS mock:
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity