コード例 #1
0
 def add_user(self, user="******"):
     user_to_add = endpoints_pb2.User(username=user, age=23)
     metadata = addMetadata()
     from jwt_token import service_account
     metadata.append(('authorization', 'Bearer ' + service_account('k8s')))
     response = self.stub.addUser(user_to_add, metadata=metadata)
     return response
コード例 #2
0
 def delete_user(self, user="******"):
     user_to_delete = endpoints_pb2.User(username=user)
     metadata = addMetadata()
     response = self.stub.deleteUser(user_to_delete, metadata=metadata)
     return response
コード例 #3
0
 def get_user(self, user="******"):
     user_to_get = endpoints_pb2.User(username=user)
     metadata = addMetadata()
     response = self.stub.getUser(user_to_get, metadata=metadata)
     return response
コード例 #4
0
 def add_user(self, user="******"):
     user_to_add = endpoints_pb2.User(username=user, age=23)
     response = self.stub.addUser(user_to_add, metadata=addMetadata())
     return response