示例#1
0
文件: role.py 项目: rb-nr/pybanyan
 def update(self):
     policy_spec = Base.get_json_input(self.app.pargs.role_spec)
     policy = Role.Schema().load(policy_spec)
     policy_info = self._client.update(policy)
     self.app.render(RoleInfo.Schema().dump(policy_info),
                     handler='json',
                     indent=2,
                     sort_keys=True)
示例#2
0
 def update(self):
     spec = Base.get_json_input(self.app.pargs.service_spec)
     service: ServiceInfo = Service.Schema().load(spec)
     info = self._client.update(service)
     self.app.render(ServiceInfo.Schema().dump(info),
                     handler='json',
                     indent=2,
                     sort_keys=True)
示例#3
0
文件: policy.py 项目: rb-nr/pybanyan
 def create(self):
     policy_spec = Base.get_json_input(self.app.pargs.policy_spec)
     policy = Policy.Schema().load(policy_spec)
     policy_info = self._client.create(policy)
     self.app.render(PolicyInfo.Schema().dump(policy_info),
                     handler='json',
                     indent=2,
                     sort_keys=True)
示例#4
0
文件: role.py 项目: rb-nr/pybanyan
 def create(self):
     spec = Base.get_json_input(self.app.pargs.role_spec)
     role = Role.Schema().load(spec)
     role_id = self._client.create(role)
     self.app.print(f'Role ID: {role_id}')