Use google.api instead of custom googleapi package
Use the standard google.api package to not create conflicts with other
proto definition that uses the same package.
Change-Id: Ic66a0a1a0f1e68c95fd94f443112ee4fb8b1bad5
diff --git a/VERSION b/VERSION
index 4360483..d9b058f 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-3.3.2-dev
+4.0.0-dev
diff --git a/lib/xos-api/README.md b/lib/xos-api/README.md
index 0ac428a..75bf700 100644
--- a/lib/xos-api/README.md
+++ b/lib/xos-api/README.md
@@ -4,6 +4,12 @@
Xos\_api includes a python setup.py program that may be used to install the library. As part of the standard CORD build, the container image xosproject/xos-client is created with xos_api already installed, so that it may easily be used as a base image for other components.
+> NOTE: The `chameleon_client/protos/google/api` directory has files copied from the [Google
+> APIs](https://github.com/googleapis/api-common-protos), and is only included for
+> compilation of the protobuf files - these API's should be
+> installed independently via the python
+> [googleapis-common-protos](https://pypi.org/project/googleapis-common-protos/).
+
## xossh ##
Xossh is a shell for interactively using the xos client API and client ORM layer. Generally xossh is run inside a container, and the xos\_client container is configured to run xossh as its default entrypoint. A script is provided in xos/tools to assist in invoking xossh from inside the head node environment.
diff --git a/lib/xos-api/requirements.txt b/lib/xos-api/requirements.txt
index cb420c9..e957138 100644
--- a/lib/xos-api/requirements.txt
+++ b/lib/xos-api/requirements.txt
@@ -1,5 +1,5 @@
Twisted~=18.9.0
-googleapis-common-protos~=1.5.8
+googleapis-common-protos~=1.51.0
grpcio-tools~=1.19.0
grpcio~=1.19.0
multistructlog~=2.1.0
diff --git a/lib/xos-api/xosapi/chameleon_client/grpc_client.py b/lib/xos-api/xosapi/chameleon_client/grpc_client.py
index 7d3839d..2b2d1e0 100644
--- a/lib/xos-api/xosapi/chameleon_client/grpc_client.py
+++ b/lib/xos-api/xosapi/chameleon_client/grpc_client.py
@@ -60,7 +60,8 @@
self.reconnect_callback = reconnect_callback
self.credentials = credentials
self.restart_on_disconnect = restart_on_disconnect
-
+ self.google_api_dir = os.path.abspath(os.path.join(
+ os.path.dirname(__file__), 'protos'))
self.plugin_dir = os.path.abspath(os.path.join(
os.path.dirname(__file__), 'protoc_plugins'))
@@ -254,7 +255,7 @@
'cd %s && '
'env PATH=%s PYTHONPATH=%s '
'python -m grpc.tools.protoc '
- '-I. '
+ '-I. -I %s '
'--python_out=. '
'--grpc_python_out=. '
'--plugin=protoc-gen-gw=%s/gw_gen.py '
@@ -263,6 +264,7 @@
self.work_dir,
':'.join([os.environ['PATH'], self.plugin_dir]),
chameleon_base_dir,
+ self.google_api_dir,
self.plugin_dir,
fname)
)
diff --git a/lib/xos-api/xosapi/chameleon_client/protoc_plugins/gw_gen.py b/lib/xos-api/xosapi/chameleon_client/protoc_plugins/gw_gen.py
index cafee67..2bfd7f8 100755
--- a/lib/xos-api/xosapi/chameleon_client/protoc_plugins/gw_gen.py
+++ b/lib/xos-api/xosapi/chameleon_client/protoc_plugins/gw_gen.py
@@ -24,7 +24,7 @@
from jinja2 import Template
from simplejson import dumps
-from xosapi.chameleon_client.protos import http_pb2
+from google.api import http_pb2
template = Template("""
# Generated file; please do not edit
@@ -110,7 +110,7 @@
options = method.options
assert isinstance(options, MethodOptions)
for fd, http in options.ListFields():
- if fd.full_name == 'googleapi.http':
+ if fd.full_name == 'google.api.http':
assert fd.name == 'http'
assert isinstance(http, http_pb2.HttpRule)
diff --git a/lib/xos-api/xosapi/chameleon_client/protos/annotations_pb2.py b/lib/xos-api/xosapi/chameleon_client/protos/annotations_pb2.py
deleted file mode 100644
index aa451e5..0000000
--- a/lib/xos-api/xosapi/chameleon_client/protos/annotations_pb2.py
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright 2017 the original author or authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: annotations.proto
-
-from __future__ import absolute_import
-import sys
-_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-from google.protobuf import descriptor_pb2
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-from . import http_pb2 as http__pb2
-from google.protobuf import descriptor_pb2 as google_dot_protobuf_dot_descriptor__pb2
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='annotations.proto',
- package='googleapi',
- syntax='proto3',
- serialized_pb=_b('\n\x11\x61nnotations.proto\x12\tgoogleapi\x1a\nhttp.proto\x1a google/protobuf/descriptor.proto:D\n\x04http\x12\x1e.google.protobuf.MethodOptions\x18\xb0\xca\xbc\" \x01(\x0b\x32\x13.googleapi.HttpRuleBn\n\x0e\x63om.google.apiB\x10\x41nnotationsProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xa2\x02\x04GAPIb\x06proto3')
- ,
- dependencies=[http__pb2.DESCRIPTOR,google_dot_protobuf_dot_descriptor__pb2.DESCRIPTOR,])
-
-
-HTTP_FIELD_NUMBER = 72295728
-http = _descriptor.FieldDescriptor(
- name='http', full_name='googleapi.http', index=0,
- number=72295728, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=True, extension_scope=None,
- options=None, file=DESCRIPTOR)
-
-DESCRIPTOR.extensions_by_name['http'] = http
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-
-http.message_type = http__pb2._HTTPRULE
-google_dot_protobuf_dot_descriptor__pb2.MethodOptions.RegisterExtension(http)
-
-DESCRIPTOR.has_options = True
-DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\016com.google.apiB\020AnnotationsProtoP\001ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\242\002\004GAPI'))
-# @@protoc_insertion_point(module_scope)
diff --git a/lib/xos-api/xosapi/chameleon_client/protos/annotations_pb2_grpc.py b/lib/xos-api/xosapi/chameleon_client/protos/annotations_pb2_grpc.py
deleted file mode 100644
index 1ec9f40..0000000
--- a/lib/xos-api/xosapi/chameleon_client/protos/annotations_pb2_grpc.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright 2017 the original author or authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
-from __future__ import absolute_import
-import grpc
diff --git a/lib/xos-api/xosapi/chameleon_client/protos/annotations.proto b/lib/xos-api/xosapi/chameleon_client/protos/google/api/annotations.proto
similarity index 85%
rename from lib/xos-api/xosapi/chameleon_client/protos/annotations.proto
rename to lib/xos-api/xosapi/chameleon_client/protos/google/api/annotations.proto
index 2ed81a6..18dcf20 100644
--- a/lib/xos-api/xosapi/chameleon_client/protos/annotations.proto
+++ b/lib/xos-api/xosapi/chameleon_client/protos/google/api/annotations.proto
@@ -1,5 +1,4 @@
// Copyright (c) 2015, Google Inc.
-// Modififications (C) 2018, Open Networking Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -13,13 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// See NOTE in http.proto for the modifications made to these files
-
syntax = "proto3";
-package googleapi;
+package google.api;
-import "http.proto";
+import "google/api/http.proto";
import "google/protobuf/descriptor.proto";
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
@@ -31,4 +28,4 @@
extend google.protobuf.MethodOptions {
// See `HttpRule`.
HttpRule http = 72295728;
-}
+}
\ No newline at end of file
diff --git a/lib/xos-api/xosapi/chameleon_client/protos/http.proto b/lib/xos-api/xosapi/chameleon_client/protos/google/api/http.proto
similarity index 83%
rename from lib/xos-api/xosapi/chameleon_client/protos/http.proto
rename to lib/xos-api/xosapi/chameleon_client/protos/google/api/http.proto
index 99d0ce3..61168c3 100644
--- a/lib/xos-api/xosapi/chameleon_client/protos/http.proto
+++ b/lib/xos-api/xosapi/chameleon_client/protos/google/api/http.proto
@@ -1,5 +1,4 @@
// Copyright 2018 Google LLC
-// Modififications (C) 2018, Open Networking Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -13,48 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// NOTE: On the provenance of and modifications to http.proto and
-// annotations.proto
-//
-// TL;DR: The files http.proto and annotations.proto are originally from here:
-// https://github.com/googleapis/googleapis
-// They have been modified slightly to avoid a namespace conflict.
-//
-// Long winded explanation:
-// These files are designed to interact with Google's first party API's, and
-// the recommended way to use them is to compiled them to code with protoc and
-// included in your codebase before being used. Due to the fact that we're not
-// using them that way, and because of how Chameleon and XOS work (dynamically
-// defining our own API's), we have to ship these *.proto files as a part of
-// our artifacts.
-//
-// The problems start when you try to include these specific .proto files in
-// python. The protoc compiler includes the `google.protobuf` classes, which
-// python can look up in the standard python library path. Unfortunately these
-// files are namespaced with `google.api` in the path and aren't shipped with
-// protoc. This leads to a path conflict - you can't have two library paths
-// start with the same path component (`google` in this case) without getting
-// an "ImportError: No module named ..." on one of the paths when you import
-// them.
-//
-// Historically, various confusing hacks were implemented to override and
-// special-case the python `include` directive to include a file at a different
-// path than was specified. These hacks also failed when updating the base OS,
-// and would likely continue to fail in other, stranger ways as we update the
-// codebase. Specifically, Python 3 reimplemented these features in the
-// importlib section of the standard library, so there's little confidence our
-// hacks would continue to work. As an aside, there are various protobuf
-// `options` statements to deal with this sort of issue in other languages (see
-// the `go_package` and `java_package` below ) but these don't currently exist
-// for python: https://github.com/google/protobuf/issues/973
-//
-// To avoid this entire psychotic namespace hellscape, it's much easier to
-// modify these files to remove the google.api path component, and have them
-// included directly at a path of our own choice.
-
syntax = "proto3";
-package googleapi;
+package google.api;
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
@@ -337,6 +297,11 @@
// present at the top-level of request message type.
string body = 7;
+ // Optional. The name of the response field whose value is mapped to the HTTP
+ // body of response. Other response fields are ignored. When
+ // not set, the response message will be used as HTTP body of response.
+ string response_body = 12;
+
// Additional HTTP bindings for the selector. Nested bindings must
// not contain an `additional_bindings` field themselves (that is,
// the nesting may only be one level deep).
@@ -350,4 +315,4 @@
// The path matched by this custom verb.
string path = 2;
-}
+}
\ No newline at end of file
diff --git a/lib/xos-api/xosapi/chameleon_client/protos/http_pb2.py b/lib/xos-api/xosapi/chameleon_client/protos/http_pb2.py
deleted file mode 100644
index 8e359f5..0000000
--- a/lib/xos-api/xosapi/chameleon_client/protos/http_pb2.py
+++ /dev/null
@@ -1,261 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright 2017 the original author or authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Generated by the protocol buffer compiler. DO NOT EDIT!
-# source: http.proto
-
-from __future__ import absolute_import
-import sys
-_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
-from google.protobuf import descriptor as _descriptor
-from google.protobuf import message as _message
-from google.protobuf import reflection as _reflection
-from google.protobuf import symbol_database as _symbol_database
-from google.protobuf import descriptor_pb2
-# @@protoc_insertion_point(imports)
-
-_sym_db = _symbol_database.Default()
-
-
-
-
-DESCRIPTOR = _descriptor.FileDescriptor(
- name='http.proto',
- package='googleapi',
- syntax='proto3',
- serialized_pb=_b('\n\nhttp.proto\x12\tgoogleapi\"S\n\x04Http\x12\"\n\x05rules\x18\x01 \x03(\x0b\x32\x13.googleapi.HttpRule\x12\'\n\x1f\x66ully_decode_reserved_expansion\x18\x02 \x01(\x08\"\xe8\x01\n\x08HttpRule\x12\x10\n\x08selector\x18\x01 \x01(\t\x12\r\n\x03get\x18\x02 \x01(\tH\x00\x12\r\n\x03put\x18\x03 \x01(\tH\x00\x12\x0e\n\x04post\x18\x04 \x01(\tH\x00\x12\x10\n\x06\x64\x65lete\x18\x05 \x01(\tH\x00\x12\x0f\n\x05patch\x18\x06 \x01(\tH\x00\x12.\n\x06\x63ustom\x18\x08 \x01(\x0b\x32\x1c.googleapi.CustomHttpPatternH\x00\x12\x0c\n\x04\x62ody\x18\x07 \x01(\t\x12\x30\n\x13\x61\x64\x64itional_bindings\x18\x0b \x03(\x0b\x32\x13.googleapi.HttpRuleB\t\n\x07pattern\"/\n\x11\x43ustomHttpPattern\x12\x0c\n\x04kind\x18\x01 \x01(\t\x12\x0c\n\x04path\x18\x02 \x01(\tBj\n\x0e\x63om.google.apiB\tHttpProtoP\x01ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\xf8\x01\x01\xa2\x02\x04GAPIb\x06proto3')
-)
-
-
-
-
-_HTTP = _descriptor.Descriptor(
- name='Http',
- full_name='googleapi.Http',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='rules', full_name='googleapi.Http.rules', index=0,
- number=1, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='fully_decode_reserved_expansion', full_name='googleapi.Http.fully_decode_reserved_expansion', index=1,
- number=2, type=8, cpp_type=7, label=1,
- has_default_value=False, default_value=False,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=25,
- serialized_end=108,
-)
-
-
-_HTTPRULE = _descriptor.Descriptor(
- name='HttpRule',
- full_name='googleapi.HttpRule',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='selector', full_name='googleapi.HttpRule.selector', index=0,
- number=1, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=_b("").decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='get', full_name='googleapi.HttpRule.get', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=_b("").decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='put', full_name='googleapi.HttpRule.put', index=2,
- number=3, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=_b("").decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='post', full_name='googleapi.HttpRule.post', index=3,
- number=4, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=_b("").decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='delete', full_name='googleapi.HttpRule.delete', index=4,
- number=5, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=_b("").decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='patch', full_name='googleapi.HttpRule.patch', index=5,
- number=6, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=_b("").decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='custom', full_name='googleapi.HttpRule.custom', index=6,
- number=8, type=11, cpp_type=10, label=1,
- has_default_value=False, default_value=None,
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='body', full_name='googleapi.HttpRule.body', index=7,
- number=7, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=_b("").decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='additional_bindings', full_name='googleapi.HttpRule.additional_bindings', index=8,
- number=11, type=11, cpp_type=10, label=3,
- has_default_value=False, default_value=[],
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- _descriptor.OneofDescriptor(
- name='pattern', full_name='googleapi.HttpRule.pattern',
- index=0, containing_type=None, fields=[]),
- ],
- serialized_start=111,
- serialized_end=343,
-)
-
-
-_CUSTOMHTTPPATTERN = _descriptor.Descriptor(
- name='CustomHttpPattern',
- full_name='googleapi.CustomHttpPattern',
- filename=None,
- file=DESCRIPTOR,
- containing_type=None,
- fields=[
- _descriptor.FieldDescriptor(
- name='kind', full_name='googleapi.CustomHttpPattern.kind', index=0,
- number=1, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=_b("").decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
- _descriptor.FieldDescriptor(
- name='path', full_name='googleapi.CustomHttpPattern.path', index=1,
- number=2, type=9, cpp_type=9, label=1,
- has_default_value=False, default_value=_b("").decode('utf-8'),
- message_type=None, enum_type=None, containing_type=None,
- is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
- ],
- extensions=[
- ],
- nested_types=[],
- enum_types=[
- ],
- options=None,
- is_extendable=False,
- syntax='proto3',
- extension_ranges=[],
- oneofs=[
- ],
- serialized_start=345,
- serialized_end=392,
-)
-
-_HTTP.fields_by_name['rules'].message_type = _HTTPRULE
-_HTTPRULE.fields_by_name['custom'].message_type = _CUSTOMHTTPPATTERN
-_HTTPRULE.fields_by_name['additional_bindings'].message_type = _HTTPRULE
-_HTTPRULE.oneofs_by_name['pattern'].fields.append(
- _HTTPRULE.fields_by_name['get'])
-_HTTPRULE.fields_by_name['get'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern']
-_HTTPRULE.oneofs_by_name['pattern'].fields.append(
- _HTTPRULE.fields_by_name['put'])
-_HTTPRULE.fields_by_name['put'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern']
-_HTTPRULE.oneofs_by_name['pattern'].fields.append(
- _HTTPRULE.fields_by_name['post'])
-_HTTPRULE.fields_by_name['post'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern']
-_HTTPRULE.oneofs_by_name['pattern'].fields.append(
- _HTTPRULE.fields_by_name['delete'])
-_HTTPRULE.fields_by_name['delete'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern']
-_HTTPRULE.oneofs_by_name['pattern'].fields.append(
- _HTTPRULE.fields_by_name['patch'])
-_HTTPRULE.fields_by_name['patch'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern']
-_HTTPRULE.oneofs_by_name['pattern'].fields.append(
- _HTTPRULE.fields_by_name['custom'])
-_HTTPRULE.fields_by_name['custom'].containing_oneof = _HTTPRULE.oneofs_by_name['pattern']
-DESCRIPTOR.message_types_by_name['Http'] = _HTTP
-DESCRIPTOR.message_types_by_name['HttpRule'] = _HTTPRULE
-DESCRIPTOR.message_types_by_name['CustomHttpPattern'] = _CUSTOMHTTPPATTERN
-_sym_db.RegisterFileDescriptor(DESCRIPTOR)
-
-Http = _reflection.GeneratedProtocolMessageType('Http', (_message.Message,), dict(
- DESCRIPTOR = _HTTP,
- __module__ = 'http_pb2'
- # @@protoc_insertion_point(class_scope:googleapi.Http)
- ))
-_sym_db.RegisterMessage(Http)
-
-HttpRule = _reflection.GeneratedProtocolMessageType('HttpRule', (_message.Message,), dict(
- DESCRIPTOR = _HTTPRULE,
- __module__ = 'http_pb2'
- # @@protoc_insertion_point(class_scope:googleapi.HttpRule)
- ))
-_sym_db.RegisterMessage(HttpRule)
-
-CustomHttpPattern = _reflection.GeneratedProtocolMessageType('CustomHttpPattern', (_message.Message,), dict(
- DESCRIPTOR = _CUSTOMHTTPPATTERN,
- __module__ = 'http_pb2'
- # @@protoc_insertion_point(class_scope:googleapi.CustomHttpPattern)
- ))
-_sym_db.RegisterMessage(CustomHttpPattern)
-
-
-DESCRIPTOR.has_options = True
-DESCRIPTOR._options = _descriptor._ParseOptions(descriptor_pb2.FileOptions(), _b('\n\016com.google.apiB\tHttpProtoP\001ZAgoogle.golang.org/genproto/googleapis/api/annotations;annotations\370\001\001\242\002\004GAPI'))
-# @@protoc_insertion_point(module_scope)
diff --git a/lib/xos-api/xosapi/chameleon_client/protos/http_pb2_grpc.py b/lib/xos-api/xosapi/chameleon_client/protos/http_pb2_grpc.py
deleted file mode 100644
index 1ec9f40..0000000
--- a/lib/xos-api/xosapi/chameleon_client/protos/http_pb2_grpc.py
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-
-# Copyright 2017 the original author or authors.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
-from __future__ import absolute_import
-import grpc
diff --git a/lib/xos-api/xosapi/chameleon_client/protos/schema_pb2.py b/lib/xos-api/xosapi/chameleon_client/protos/schema_pb2.py
index 0e0159a..6a8ae28 100644
--- a/lib/xos-api/xosapi/chameleon_client/protos/schema_pb2.py
+++ b/lib/xos-api/xosapi/chameleon_client/protos/schema_pb2.py
@@ -18,14 +18,12 @@
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: schema.proto
-from __future__ import absolute_import
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
-from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)
_sym_db = _symbol_database.Default()
@@ -38,6 +36,7 @@
name='schema.proto',
package='schema',
syntax='proto3',
+ serialized_options=None,
serialized_pb=_b('\n\x0cschema.proto\x12\x06schema\x1a\x1bgoogle/protobuf/empty.proto\"A\n\tProtoFile\x12\x11\n\tfile_name\x18\x01 \x01(\t\x12\r\n\x05proto\x18\x02 \x01(\t\x12\x12\n\ndescriptor\x18\x03 \x01(\x0c\"B\n\x07Schemas\x12!\n\x06protos\x18\x01 \x03(\x0b\x32\x11.schema.ProtoFile\x12\x14\n\x0cswagger_from\x18\x02 \x01(\t2G\n\rSchemaService\x12\x36\n\tGetSchema\x12\x16.google.protobuf.Empty\x1a\x0f.schema.Schemas\"\x00\x62\x06proto3')
,
dependencies=[google_dot_protobuf_dot_empty__pb2.DESCRIPTOR,])
@@ -58,28 +57,28 @@
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='proto', full_name='schema.ProtoFile.proto', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='descriptor', full_name='schema.ProtoFile.descriptor', index=2,
number=3, type=12, cpp_type=9, label=1,
has_default_value=False, default_value=_b(""),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
+ serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
- options=None,
+ serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
@@ -103,21 +102,21 @@
has_default_value=False, default_value=[],
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
+ serialized_options=None, file=DESCRIPTOR),
_descriptor.FieldDescriptor(
name='swagger_from', full_name='schema.Schemas.swagger_from', index=1,
number=2, type=9, cpp_type=9, label=1,
has_default_value=False, default_value=_b("").decode('utf-8'),
message_type=None, enum_type=None, containing_type=None,
is_extension=False, extension_scope=None,
- options=None, file=DESCRIPTOR),
+ serialized_options=None, file=DESCRIPTOR),
],
extensions=[
],
nested_types=[],
enum_types=[
],
- options=None,
+ serialized_options=None,
is_extendable=False,
syntax='proto3',
extension_ranges=[],
@@ -153,7 +152,7 @@
full_name='schema.SchemaService',
file=DESCRIPTOR,
index=0,
- options=None,
+ serialized_options=None,
serialized_start=188,
serialized_end=259,
methods=[
@@ -164,7 +163,7 @@
containing_service=None,
input_type=google_dot_protobuf_dot_empty__pb2._EMPTY,
output_type=_SCHEMAS,
- options=None,
+ serialized_options=None,
),
])
_sym_db.RegisterServiceDescriptor(_SCHEMASERVICE)
diff --git a/lib/xos-api/xosapi/chameleon_client/protos/schema_pb2_grpc.py b/lib/xos-api/xosapi/chameleon_client/protos/schema_pb2_grpc.py
index 06c1456..2c8867b 100644
--- a/lib/xos-api/xosapi/chameleon_client/protos/schema_pb2_grpc.py
+++ b/lib/xos-api/xosapi/chameleon_client/protos/schema_pb2_grpc.py
@@ -22,7 +22,6 @@
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from . import schema_pb2 as schema__pb2
-
class SchemaServiceStub(object):
"""Schema services
"""
diff --git a/lib/xos-genx/xosgenx/targets/protoapi.xtarget b/lib/xos-genx/xosgenx/targets/protoapi.xtarget
index 0359c46..65e0d26 100644
--- a/lib/xos-genx/xosgenx/targets/protoapi.xtarget
+++ b/lib/xos-genx/xosgenx/targets/protoapi.xtarget
@@ -3,7 +3,7 @@
package xos;
import "google/protobuf/empty.proto";
-import "annotations.proto";
+import "google/api/annotations.proto";
import "common.proto";
import "xosoptions.proto";
@@ -50,7 +50,7 @@
{% for object in proto.messages | selectattr("is_included") | sort(attribute='name')%}
{% if object.name != 'XOSBase' -%}
rpc List{{ object.name }}(google.protobuf.Empty) returns ({{ xproto_pluralize(object) }}) {
- option (googleapi.http) = {
+ option (google.api.http) = {
{%- if object.name=='CordSubscriberRoot' %}
get: "/xosapi/v1/rcord/{{ xproto_pluralize(object) | lower }}"
{%- else %}
@@ -61,7 +61,7 @@
rpc Filter{{ object.name }}(Query) returns ({{ xproto_pluralize(object) }}) {
}
rpc Get{{ object.name }}(ID) returns ({{ object.name }}) {
- option (googleapi.http) = {
+ option (google.api.http) = {
{%- if object.name=='CordSubscriberRoot' %}
get: "/xosapi/v1/rcord/{{ xproto_pluralize(object) | lower }}/{id}"
{%- else %}
@@ -70,19 +70,19 @@
};
}
rpc Create{{ object.name }}({{ object.name }}) returns ({{ object.name }}) {
- option (googleapi.http) = {
+ option (google.api.http) = {
post: "/xosapi/v1/{{ xproto_unquote(xproto_first_non_empty([object.options.name, object.options.app_label, options.name, context.app_label])) }}/{{ xproto_pluralize(object) | lower }}"
body: "*"
};
}
rpc Update{{ object.name }}({{ object.name }}) returns ({{ object.name }}) {
- option (googleapi.http) = {
+ option (google.api.http) = {
put: "/xosapi/v1/{{ xproto_unquote(xproto_first_non_empty([object.options.name, object.options.app_label, options.name, context.app_label])) }}/{{ xproto_pluralize(object) | lower }}/{id}"
body: "*"
};
}
rpc Delete{{ object.name }}(ID) returns (google.protobuf.Empty) {
- option (googleapi.http) = {
+ option (google.api.http) = {
delete: "/xosapi/v1/{{ xproto_unquote(xproto_first_non_empty([object.options.name, object.options.app_label, options.name, context.app_label])) }}/{{ xproto_pluralize(object) | lower }}/{id}"
};
}
diff --git a/requirements.txt b/requirements.txt
index 3478295..9762cfa 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -6,3 +6,4 @@
psycopg2-binary~=2.8.2
pytz~=2019.1
semver~=2.8.1
+googleapis-common-protos~=1.51.0
diff --git a/xos/coreapi/protos/annotations.proto b/xos/coreapi/protos/annotations.proto
deleted file mode 100644
index 2ed81a6..0000000
--- a/xos/coreapi/protos/annotations.proto
+++ /dev/null
@@ -1,34 +0,0 @@
-// Copyright (c) 2015, Google Inc.
-// Modififications (C) 2018, Open Networking Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// See NOTE in http.proto for the modifications made to these files
-
-syntax = "proto3";
-
-package googleapi;
-
-import "http.proto";
-import "google/protobuf/descriptor.proto";
-
-option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
-option java_multiple_files = true;
-option java_outer_classname = "AnnotationsProto";
-option java_package = "com.google.api";
-option objc_class_prefix = "GAPI";
-
-extend google.protobuf.MethodOptions {
- // See `HttpRule`.
- HttpRule http = 72295728;
-}
diff --git a/xos/coreapi/protos/dynamicload.proto b/xos/coreapi/protos/dynamicload.proto
index f65021e..e7913a7 100644
--- a/xos/coreapi/protos/dynamicload.proto
+++ b/xos/coreapi/protos/dynamicload.proto
@@ -3,7 +3,7 @@
package xos;
import "google/protobuf/empty.proto";
-import "annotations.proto";
+import "google/api/annotations.proto";
message Xproto {
string filename = 1;
@@ -83,24 +83,24 @@
service dynamicload {
rpc LoadModels(LoadModelsRequest) returns (LoadModelsReply) {
- option (googleapi.http) = {
+ option (google.api.http) = {
post: "/xosapi/v1/dynamicload/load_models"
body: "*"
};
}
rpc UnloadModels(UnloadModelsRequest) returns (LoadModelsReply) {
- option (googleapi.http) = {
+ option (google.api.http) = {
post: "/xosapi/v1/dynamicload/unload_models"
body: "*"
};
}
rpc GetLoadStatus(google.protobuf.Empty) returns (LoadStatusReply) {
- option (googleapi.http) = {
+ option (google.api.http) = {
get: "/xosapi/v1/dynamicload/load_status"
};
}
rpc GetConvenienceMethods(google.protobuf.Empty) returns (ListConvenienceMethodsReply) {
- option (googleapi.http) = {
+ option (google.api.http) = {
// NOTE do we need to expose this via rest? maybe for debug...
get: "/xosapi/v1/dynamicload/convenience_methods"
};
diff --git a/lib/xos-api/xosapi/chameleon_client/protos/annotations.proto b/xos/coreapi/protos/google/api/annotations.proto
similarity index 85%
copy from lib/xos-api/xosapi/chameleon_client/protos/annotations.proto
copy to xos/coreapi/protos/google/api/annotations.proto
index 2ed81a6..18dcf20 100644
--- a/lib/xos-api/xosapi/chameleon_client/protos/annotations.proto
+++ b/xos/coreapi/protos/google/api/annotations.proto
@@ -1,5 +1,4 @@
// Copyright (c) 2015, Google Inc.
-// Modififications (C) 2018, Open Networking Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -13,13 +12,11 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// See NOTE in http.proto for the modifications made to these files
-
syntax = "proto3";
-package googleapi;
+package google.api;
-import "http.proto";
+import "google/api/http.proto";
import "google/protobuf/descriptor.proto";
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
@@ -31,4 +28,4 @@
extend google.protobuf.MethodOptions {
// See `HttpRule`.
HttpRule http = 72295728;
-}
+}
\ No newline at end of file
diff --git a/lib/xos-api/xosapi/chameleon_client/protos/http.proto b/xos/coreapi/protos/google/api/http.proto
similarity index 83%
copy from lib/xos-api/xosapi/chameleon_client/protos/http.proto
copy to xos/coreapi/protos/google/api/http.proto
index 99d0ce3..61168c3 100644
--- a/lib/xos-api/xosapi/chameleon_client/protos/http.proto
+++ b/xos/coreapi/protos/google/api/http.proto
@@ -1,5 +1,4 @@
// Copyright 2018 Google LLC
-// Modififications (C) 2018, Open Networking Foundation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@@ -13,48 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.
-// NOTE: On the provenance of and modifications to http.proto and
-// annotations.proto
-//
-// TL;DR: The files http.proto and annotations.proto are originally from here:
-// https://github.com/googleapis/googleapis
-// They have been modified slightly to avoid a namespace conflict.
-//
-// Long winded explanation:
-// These files are designed to interact with Google's first party API's, and
-// the recommended way to use them is to compiled them to code with protoc and
-// included in your codebase before being used. Due to the fact that we're not
-// using them that way, and because of how Chameleon and XOS work (dynamically
-// defining our own API's), we have to ship these *.proto files as a part of
-// our artifacts.
-//
-// The problems start when you try to include these specific .proto files in
-// python. The protoc compiler includes the `google.protobuf` classes, which
-// python can look up in the standard python library path. Unfortunately these
-// files are namespaced with `google.api` in the path and aren't shipped with
-// protoc. This leads to a path conflict - you can't have two library paths
-// start with the same path component (`google` in this case) without getting
-// an "ImportError: No module named ..." on one of the paths when you import
-// them.
-//
-// Historically, various confusing hacks were implemented to override and
-// special-case the python `include` directive to include a file at a different
-// path than was specified. These hacks also failed when updating the base OS,
-// and would likely continue to fail in other, stranger ways as we update the
-// codebase. Specifically, Python 3 reimplemented these features in the
-// importlib section of the standard library, so there's little confidence our
-// hacks would continue to work. As an aside, there are various protobuf
-// `options` statements to deal with this sort of issue in other languages (see
-// the `go_package` and `java_package` below ) but these don't currently exist
-// for python: https://github.com/google/protobuf/issues/973
-//
-// To avoid this entire psychotic namespace hellscape, it's much easier to
-// modify these files to remove the google.api path component, and have them
-// included directly at a path of our own choice.
-
syntax = "proto3";
-package googleapi;
+package google.api;
option cc_enable_arenas = true;
option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
@@ -337,6 +297,11 @@
// present at the top-level of request message type.
string body = 7;
+ // Optional. The name of the response field whose value is mapped to the HTTP
+ // body of response. Other response fields are ignored. When
+ // not set, the response message will be used as HTTP body of response.
+ string response_body = 12;
+
// Additional HTTP bindings for the selector. Nested bindings must
// not contain an `additional_bindings` field themselves (that is,
// the nesting may only be one level deep).
@@ -350,4 +315,4 @@
// The path matched by this custom verb.
string path = 2;
-}
+}
\ No newline at end of file
diff --git a/xos/coreapi/protos/http.proto b/xos/coreapi/protos/http.proto
deleted file mode 100644
index 99d0ce3..0000000
--- a/xos/coreapi/protos/http.proto
+++ /dev/null
@@ -1,353 +0,0 @@
-// Copyright 2018 Google LLC
-// Modififications (C) 2018, Open Networking Foundation
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// NOTE: On the provenance of and modifications to http.proto and
-// annotations.proto
-//
-// TL;DR: The files http.proto and annotations.proto are originally from here:
-// https://github.com/googleapis/googleapis
-// They have been modified slightly to avoid a namespace conflict.
-//
-// Long winded explanation:
-// These files are designed to interact with Google's first party API's, and
-// the recommended way to use them is to compiled them to code with protoc and
-// included in your codebase before being used. Due to the fact that we're not
-// using them that way, and because of how Chameleon and XOS work (dynamically
-// defining our own API's), we have to ship these *.proto files as a part of
-// our artifacts.
-//
-// The problems start when you try to include these specific .proto files in
-// python. The protoc compiler includes the `google.protobuf` classes, which
-// python can look up in the standard python library path. Unfortunately these
-// files are namespaced with `google.api` in the path and aren't shipped with
-// protoc. This leads to a path conflict - you can't have two library paths
-// start with the same path component (`google` in this case) without getting
-// an "ImportError: No module named ..." on one of the paths when you import
-// them.
-//
-// Historically, various confusing hacks were implemented to override and
-// special-case the python `include` directive to include a file at a different
-// path than was specified. These hacks also failed when updating the base OS,
-// and would likely continue to fail in other, stranger ways as we update the
-// codebase. Specifically, Python 3 reimplemented these features in the
-// importlib section of the standard library, so there's little confidence our
-// hacks would continue to work. As an aside, there are various protobuf
-// `options` statements to deal with this sort of issue in other languages (see
-// the `go_package` and `java_package` below ) but these don't currently exist
-// for python: https://github.com/google/protobuf/issues/973
-//
-// To avoid this entire psychotic namespace hellscape, it's much easier to
-// modify these files to remove the google.api path component, and have them
-// included directly at a path of our own choice.
-
-syntax = "proto3";
-
-package googleapi;
-
-option cc_enable_arenas = true;
-option go_package = "google.golang.org/genproto/googleapis/api/annotations;annotations";
-option java_multiple_files = true;
-option java_outer_classname = "HttpProto";
-option java_package = "com.google.api";
-option objc_class_prefix = "GAPI";
-
-
-// Defines the HTTP configuration for an API service. It contains a list of
-// [HttpRule][google.api.HttpRule], each specifying the mapping of an RPC method
-// to one or more HTTP REST API methods.
-message Http {
- // A list of HTTP configuration rules that apply to individual API methods.
- //
- // **NOTE:** All service configuration rules follow "last one wins" order.
- repeated HttpRule rules = 1;
-
- // When set to true, URL path parmeters will be fully URI-decoded except in
- // cases of single segment matches in reserved expansion, where "%2F" will be
- // left encoded.
- //
- // The default behavior is to not decode RFC 6570 reserved characters in multi
- // segment matches.
- bool fully_decode_reserved_expansion = 2;
-}
-
-// `HttpRule` defines the mapping of an RPC method to one or more HTTP
-// REST API methods. The mapping specifies how different portions of the RPC
-// request message are mapped to URL path, URL query parameters, and
-// HTTP request body. The mapping is typically specified as an
-// `google.api.http` annotation on the RPC method,
-// see "google/api/annotations.proto" for details.
-//
-// The mapping consists of a field specifying the path template and
-// method kind. The path template can refer to fields in the request
-// message, as in the example below which describes a REST GET
-// operation on a resource collection of messages:
-//
-//
-// service Messaging {
-// rpc GetMessage(GetMessageRequest) returns (Message) {
-// option (google.api.http).get = "/v1/messages/{message_id}/{sub.subfield}";
-// }
-// }
-// message GetMessageRequest {
-// message SubMessage {
-// string subfield = 1;
-// }
-// string message_id = 1; // mapped to the URL
-// SubMessage sub = 2; // `sub.subfield` is url-mapped
-// }
-// message Message {
-// string text = 1; // content of the resource
-// }
-//
-// The same http annotation can alternatively be expressed inside the
-// `GRPC API Configuration` YAML file.
-//
-// http:
-// rules:
-// - selector: <proto_package_name>.Messaging.GetMessage
-// get: /v1/messages/{message_id}/{sub.subfield}
-//
-// This definition enables an automatic, bidrectional mapping of HTTP
-// JSON to RPC. Example:
-//
-// HTTP | RPC
-// -----|-----
-// `GET /v1/messages/123456/foo` | `GetMessage(message_id: "123456" sub: SubMessage(subfield: "foo"))`
-//
-// In general, not only fields but also field paths can be referenced
-// from a path pattern. Fields mapped to the path pattern cannot be
-// repeated and must have a primitive (non-message) type.
-//
-// Any fields in the request message which are not bound by the path
-// pattern automatically become (optional) HTTP query
-// parameters. Assume the following definition of the request message:
-//
-//
-// service Messaging {
-// rpc GetMessage(GetMessageRequest) returns (Message) {
-// option (google.api.http).get = "/v1/messages/{message_id}";
-// }
-// }
-// message GetMessageRequest {
-// message SubMessage {
-// string subfield = 1;
-// }
-// string message_id = 1; // mapped to the URL
-// int64 revision = 2; // becomes a parameter
-// SubMessage sub = 3; // `sub.subfield` becomes a parameter
-// }
-//
-//
-// This enables a HTTP JSON to RPC mapping as below:
-//
-// HTTP | RPC
-// -----|-----
-// `GET /v1/messages/123456?revision=2&sub.subfield=foo` | `GetMessage(message_id: "123456" revision: 2 sub: SubMessage(subfield: "foo"))`
-//
-// Note that fields which are mapped to HTTP parameters must have a
-// primitive type or a repeated primitive type. Message types are not
-// allowed. In the case of a repeated type, the parameter can be
-// repeated in the URL, as in `...?param=A¶m=B`.
-//
-// For HTTP method kinds which allow a request body, the `body` field
-// specifies the mapping. Consider a REST update method on the
-// message resource collection:
-//
-//
-// service Messaging {
-// rpc UpdateMessage(UpdateMessageRequest) returns (Message) {
-// option (google.api.http) = {
-// put: "/v1/messages/{message_id}"
-// body: "message"
-// };
-// }
-// }
-// message UpdateMessageRequest {
-// string message_id = 1; // mapped to the URL
-// Message message = 2; // mapped to the body
-// }
-//
-//
-// The following HTTP JSON to RPC mapping is enabled, where the
-// representation of the JSON in the request body is determined by
-// protos JSON encoding:
-//
-// HTTP | RPC
-// -----|-----
-// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" message { text: "Hi!" })`
-//
-// The special name `*` can be used in the body mapping to define that
-// every field not bound by the path template should be mapped to the
-// request body. This enables the following alternative definition of
-// the update method:
-//
-// service Messaging {
-// rpc UpdateMessage(Message) returns (Message) {
-// option (google.api.http) = {
-// put: "/v1/messages/{message_id}"
-// body: "*"
-// };
-// }
-// }
-// message Message {
-// string message_id = 1;
-// string text = 2;
-// }
-//
-//
-// The following HTTP JSON to RPC mapping is enabled:
-//
-// HTTP | RPC
-// -----|-----
-// `PUT /v1/messages/123456 { "text": "Hi!" }` | `UpdateMessage(message_id: "123456" text: "Hi!")`
-//
-// Note that when using `*` in the body mapping, it is not possible to
-// have HTTP parameters, as all fields not bound by the path end in
-// the body. This makes this option more rarely used in practice of
-// defining REST APIs. The common usage of `*` is in custom methods
-// which don't use the URL at all for transferring data.
-//
-// It is possible to define multiple HTTP methods for one RPC by using
-// the `additional_bindings` option. Example:
-//
-// service Messaging {
-// rpc GetMessage(GetMessageRequest) returns (Message) {
-// option (google.api.http) = {
-// get: "/v1/messages/{message_id}"
-// additional_bindings {
-// get: "/v1/users/{user_id}/messages/{message_id}"
-// }
-// };
-// }
-// }
-// message GetMessageRequest {
-// string message_id = 1;
-// string user_id = 2;
-// }
-//
-//
-// This enables the following two alternative HTTP JSON to RPC
-// mappings:
-//
-// HTTP | RPC
-// -----|-----
-// `GET /v1/messages/123456` | `GetMessage(message_id: "123456")`
-// `GET /v1/users/me/messages/123456` | `GetMessage(user_id: "me" message_id: "123456")`
-//
-// # Rules for HTTP mapping
-//
-// The rules for mapping HTTP path, query parameters, and body fields
-// to the request message are as follows:
-//
-// 1. The `body` field specifies either `*` or a field path, or is
-// omitted. If omitted, it indicates there is no HTTP request body.
-// 2. Leaf fields (recursive expansion of nested messages in the
-// request) can be classified into three types:
-// (a) Matched in the URL template.
-// (b) Covered by body (if body is `*`, everything except (a) fields;
-// else everything under the body field)
-// (c) All other fields.
-// 3. URL query parameters found in the HTTP request are mapped to (c) fields.
-// 4. Any body sent with an HTTP request can contain only (b) fields.
-//
-// The syntax of the path template is as follows:
-//
-// Template = "/" Segments [ Verb ] ;
-// Segments = Segment { "/" Segment } ;
-// Segment = "*" | "**" | LITERAL | Variable ;
-// Variable = "{" FieldPath [ "=" Segments ] "}" ;
-// FieldPath = IDENT { "." IDENT } ;
-// Verb = ":" LITERAL ;
-//
-// The syntax `*` matches a single path segment. The syntax `**` matches zero
-// or more path segments, which must be the last part of the path except the
-// `Verb`. The syntax `LITERAL` matches literal text in the path.
-//
-// The syntax `Variable` matches part of the URL path as specified by its
-// template. A variable template must not contain other variables. If a variable
-// matches a single path segment, its template may be omitted, e.g. `{var}`
-// is equivalent to `{var=*}`.
-//
-// If a variable contains exactly one path segment, such as `"{var}"` or
-// `"{var=*}"`, when such a variable is expanded into a URL path, all characters
-// except `[-_.~0-9a-zA-Z]` are percent-encoded. Such variables show up in the
-// Discovery Document as `{var}`.
-//
-// If a variable contains one or more path segments, such as `"{var=foo/*}"`
-// or `"{var=**}"`, when such a variable is expanded into a URL path, all
-// characters except `[-_.~/0-9a-zA-Z]` are percent-encoded. Such variables
-// show up in the Discovery Document as `{+var}`.
-//
-// NOTE: While the single segment variable matches the semantics of
-// [RFC 6570](https://tools.ietf.org/html/rfc6570) Section 3.2.2
-// Simple String Expansion, the multi segment variable **does not** match
-// RFC 6570 Reserved Expansion. The reason is that the Reserved Expansion
-// does not expand special characters like `?` and `#`, which would lead
-// to invalid URLs.
-//
-// NOTE: the field paths in variables and in the `body` must not refer to
-// repeated fields or map fields.
-message HttpRule {
- // Selects methods to which this rule applies.
- //
- // Refer to [selector][google.api.DocumentationRule.selector] for syntax details.
- string selector = 1;
-
- // Determines the URL pattern is matched by this rules. This pattern can be
- // used with any of the {get|put|post|delete|patch} methods. A custom method
- // can be defined using the 'custom' field.
- oneof pattern {
- // Used for listing and getting information about resources.
- string get = 2;
-
- // Used for updating a resource.
- string put = 3;
-
- // Used for creating a resource.
- string post = 4;
-
- // Used for deleting a resource.
- string delete = 5;
-
- // Used for updating a resource.
- string patch = 6;
-
- // The custom pattern is used for specifying an HTTP method that is not
- // included in the `pattern` field, such as HEAD, or "*" to leave the
- // HTTP method unspecified for this rule. The wild-card rule is useful
- // for services that provide content to Web (HTML) clients.
- CustomHttpPattern custom = 8;
- }
-
- // The name of the request field whose value is mapped to the HTTP body, or
- // `*` for mapping all fields not captured by the path pattern to the HTTP
- // body. NOTE: the referred field must not be a repeated field and must be
- // present at the top-level of request message type.
- string body = 7;
-
- // Additional HTTP bindings for the selector. Nested bindings must
- // not contain an `additional_bindings` field themselves (that is,
- // the nesting may only be one level deep).
- repeated HttpRule additional_bindings = 11;
-}
-
-// A custom pattern is used for defining custom HTTP verb.
-message CustomHttpPattern {
- // The name of this custom HTTP verb.
- string kind = 1;
-
- // The path matched by this custom verb.
- string path = 2;
-}
diff --git a/xos/coreapi/protos/modeldefs.proto b/xos/coreapi/protos/modeldefs.proto
index 0dc0a6a..d259d41 100644
--- a/xos/coreapi/protos/modeldefs.proto
+++ b/xos/coreapi/protos/modeldefs.proto
@@ -3,7 +3,7 @@
package xos;
import "google/protobuf/empty.proto";
-import "annotations.proto";
+import "google/api/annotations.proto";
// This API is used by the UI to validate fields.
@@ -56,7 +56,7 @@
service modeldefs {
rpc ListModelDefs(google.protobuf.Empty) returns (ModelDefs) {
- option (googleapi.http) = {
+ option (google.api.http) = {
get: "/xosapi/v1/modeldefs"
};
}
diff --git a/xos/coreapi/protos/schema.proto b/xos/coreapi/protos/schema.proto
index d6e4e01..1ef2508 100644
--- a/xos/coreapi/protos/schema.proto
+++ b/xos/coreapi/protos/schema.proto
@@ -3,7 +3,7 @@
package schema;
import "google/protobuf/empty.proto";
-import "annotations.proto";
+import "google/api/annotations.proto";
// Contains the name and content of a *.proto file
message ProtoFile {
@@ -30,7 +30,7 @@
// Return active grpc schemas
rpc GetSchema(google.protobuf.Empty) returns (Schemas) {
- option (googleapi.http) = {
+ option (google.api.http) = {
get: "/schema"
};
}
diff --git a/xos/coreapi/protos/utility.proto b/xos/coreapi/protos/utility.proto
index b0203de..ca63452 100644
--- a/xos/coreapi/protos/utility.proto
+++ b/xos/coreapi/protos/utility.proto
@@ -3,7 +3,7 @@
package xos;
import "google/protobuf/empty.proto";
-import "annotations.proto";
+import "google/api/annotations.proto";
import "common.proto";
import "xosoptions.proto";
@@ -79,66 +79,66 @@
service utility {
rpc Login(LoginRequest) returns (LoginResponse) {
- option (googleapi.http) = {
+ option (google.api.http) = {
post: "/xosapi/v1/utility/login"
body: "*"
};
}
rpc Logout(google.protobuf.Empty) returns (google.protobuf.Empty) {
- option (googleapi.http) = {
+ option (google.api.http) = {
post: "/xosapi/v1/utility/logout"
body: "*"
};
}
rpc NoOp(google.protobuf.Empty) returns (google.protobuf.Empty) {
- option (googleapi.http) = {
+ option (google.api.http) = {
post: "/xosapi/v1/utility/noop"
body: "*"
};
}
rpc AuthenticatedNoOp(google.protobuf.Empty) returns (google.protobuf.Empty) {
- option (googleapi.http) = {
+ option (google.api.http) = {
post: "/xosapi/v1/utility/auth_noop"
body: "*"
};
}
rpc SetDirtyModels(ModelFilter) returns (ModelList) {
- option (googleapi.http) = {
+ option (google.api.http) = {
post: "/xosapi/v1/utility/dirty_models"
body: "*"
};
}
rpc ListDirtyModels(ModelFilter) returns (ModelList) {
- option (googleapi.http) = {
+ option (google.api.http) = {
get: "/xosapi/v1/utility/dirty_models"
};
}
rpc GetXproto(google.protobuf.Empty) returns (XProtos) {
- option (googleapi.http) = {
+ option (google.api.http) = {
get: "/xosapi/v1/xproto"
};
}
rpc GetPopulatedServiceInstances(ID) returns (PopulatedServiceInstance) {
- option (googleapi.http) = {
+ option (google.api.http) = {
get: "/xosapi/v1/core/populatedserviceinstance/{id}"
};
}
rpc GetVersion(google.protobuf.Empty) returns (VersionInfo) {
- option (googleapi.http) = {
+ option (google.api.http) = {
get: "/xosapi/v1/version"
};
}
rpc GetDatabaseInfo(google.protobuf.Empty) returns (DatabaseInfo) {
- option (googleapi.http) = {
+ option (google.api.http) = {
get: "/xosapi/v1/dbinfo"
};
}