Add python make_client helper factory function

There are two little gRPC things a user needs to do to use oaktreemodel.
Let's wrap them in a function.

Change-Id: I4c27977802066a9f26f74df0d8386e9c4f85739e
This commit is contained in:
Monty Taylor 2017-08-10 07:52:30 -05:00
parent ad691505e1
commit 9b312a7cae
No known key found for this signature in database
GPG Key ID: 7BAE94BC7141A594
1 changed files with 7 additions and 0 deletions

View File

@ -14,6 +14,8 @@
# limitations under the License.
# flake8: noqa
import grpc
from oaktreemodel.common_pb2 import Project, Location, Filter
from oaktreemodel.flavor_pb2 import Flavor, FlavorList
from oaktreemodel.floating_ip_pb2 import FloatingIP, FloatingIPList
@ -21,3 +23,8 @@ from oaktreemodel.image_pb2 import Image, ImageList
from oaktreemodel.security_group_pb2 import SecurityGroup, SecurityGroupList
from oaktreemodel.security_group_pb2 import SecurityGroupRule
from oaktreemodel.security_group_pb2 import SecurityGroupRuleList
def make_client(location):
channel = grpc.insecure_channel(location)
return oaktree_pb2.OaktreeStub(channel)