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:
parent
ad691505e1
commit
9b312a7cae
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue