コード例 #1
0
 def setUp(self):
     _mock_auth(200)
     self.conn = Connection('1', 'dfw', password='******')
     self.client = Client(self.conn)
     self.agent = agent.from_dict(agent_mock.agent(), self.conn)
コード例 #2
0
 def setUp(self):
     _mock_auth(200)
     self.conn = Connection('1', 'dfw', password='******')
     self.client = Client(self.conn)
     self.agent = agent.from_dict(agent_mock.agent(), self.conn)
コード例 #3
0
 def get_agent(self, agent_id):
     url = '{0}/{1}/{2}'.format(self._connection.host, 'agent',
                                agent_id)
     resp = self._connection.request(Http.get, url)
     return agent.from_dict(resp.json(), connection=self._connection)
コード例 #4
0
 def agents(self):
     url = self._connection.host + '/user/agents'
     resp = self._connection.request(Http.get, url)
     return (agent.from_dict(a, connection=self._connection)
             for a in resp.json())
コード例 #5
0
 def get_agent(self, agent_id):
     url = '{0}/{1}/{2}'.format(self._connection.host, 'agent', agent_id)
     resp = self._connection.request(Http.get, url)
     return agent.from_dict(resp.json(), connection=self._connection)
コード例 #6
0
 def agents(self):
     url = self._connection.host + '/user/agents'
     resp = self._connection.request(Http.get, url)
     return (agent.from_dict(a, connection=self._connection)
             for a in resp.json())