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)
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)
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)
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}')