抱歉,如果这是多余的错误,但我正在寻找一个具体的解决方案。你知道吗
我正在尝试使用swaggerrestapi将模式的新版本发布到Hortonworks模式注册表。我使用python请求模块以编程方式发布新版本。你知道吗
path = '/' + schemaname + '/versions' + '/' + str(max(versions)+1)
logger.info(self.url(path))
requests.post(self.url(path), schemaText)
ERROR [2019-02-15 17:18:13.496] [dw-167124 - PUT /api/v1/schemaregistry/schemas/diff%20data/versions/2] c.h.r.c.GenericExceptionMapper - Got exception: [NotAllowedException] / message [HTTP 405 Method Not Allowed]
我尝试了“Method allowed exception”上前面的问题所建议的各种方法,比如使用PUT、POST或GET。但都没用。使用restapi编程将schema的新版本发布到hdf注册表的正确方法是什么?你知道吗
在源代码中,它是
@POST @Path("/schemas/{name}/versions")
您需要删除最后的版本号,因为它会返回一个版本。你没有给一个模式一个特定的版本
我不知道是否允许使用空格,所以您可能希望将其从
diff data
中删除用于
@GET @Path("/schemas/{name}/versions/{version}")
的地址不允许使用其他HTTP方法引用-https://github.com/hortonworks/registry/blob/HDF-2.1.0.0/schema-registry/rest-service/src/main/java/com/hortonworks/registries/schemaregistry/webservice/SchemaRegistryResource.java#L219
注意:您可以使用
swagger-codegen
为服务器创建Python代码,而不是在requests
中重新编写代码相关问题 更多 >
编程相关推荐