Static Catalog Api definition (#12)
* Setup buf to see and process protos correctly. This commit adds a proposed directory structure for protos. Included is a rough draft of the Ec2Catalog protos. * Add host and host_catalog service apis. This also has for the first time the move away from holding individual ids for resources and instead using the full uri path as the api facing identifier. There are some issues with the swagger generation stripping out the format of the path matching so currently only PATCH uses the approach I would like to move to. In follow up commits I'll try to either get swagger to display the correct expected paths or I'll resolve if that is even needed by our clients. * Move all protos and generated files to under the internal directory. This also required updating the buf config to explicitly name the exluded linted proto files under oplog since previously /internal/ was listed as a root in buf. Future commit will move oplog proto files to be with the others. * Moved oplog related protos to under the proto directory and regenerated. * Update the oplog protos to be compliant with buf lint. * Clean up comments in tools. * Merged in recent changes to oplog protos. * Add resource result messages to contain the read only fields and separate them from the writable fields. * Merge the ec2 catalog resources in with the more generic host_catalog resource. * Cleaning the generated swagger. This included adding summaries for each proto rpc method, Making the resources be the full fqn, removing the default error, and a few other tweaks. * Make project plural in the paths. * Adding the ability to add and remove hosts from a host set. * Add the ignore result limit for host set request. * Make size and host lists read only. * Add documentation about what host references are allowed to be added. * Remove ignore result limit when listing items. These can be added in later. * Add handlers and tests for unimplemented services. * Add bootstrap target and update how tools are built (#13) * Update tool installation method, add bootstrap target to makefile * Changing org to orgs in all paths and org param to org_id. * Adding tests for unimplemented service implementations. Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
This commit is contained in:
1 parent
4d86db6ba5
commit
c7126ae69b
32 files changed
+10935
-29
No files matched your search
@@ -5,6 +5,9 @@ THIS_FILE := $(lastword $(MAKEFILE_LIST))
|
||||
TMP_DIR := $(shell mktemp -d)
|
||||
REPO_PATH := github.com/hashicorp/watchtower
|
||||
|
||||
bootstrap:
|
||||
go generate -tags tools tools/tools.go
|
||||
|
||||
### oplog requires protoc-gen-go v1.20.0 or later
|
||||
# GO111MODULE=on go get -u github.com/golang/protobuf/protoc-gen-go@v1.40
|
||||
proto: protolint protobuild cleanup
|
||||
|
||||
@@ -9,3 +9,9 @@ lint:
|
||||
ignore:
|
||||
- protoc-gen-swagger
|
||||
- google
|
||||
ignore_only:
|
||||
# These api enums break these lint checks in order to appear nice in swagger.
|
||||
ENUM_VALUE_PREFIX:
|
||||
- controller/api/view/v1/view.proto
|
||||
ENUM_ZERO_VALUE_SUFFIX:
|
||||
- controller/api/view/v1/view.proto
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,271 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.21.0
|
||||
// protoc v3.11.4
|
||||
// source: controller/api/v1/error.proto
|
||||
|
||||
package api
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type ErrorDetails struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
TraceId string `protobuf:"bytes,1,opt,name=trace_id,json=traceId,proto3" json:"trace_id,omitempty"`
|
||||
RequestId string `protobuf:"bytes,2,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
|
||||
RequestFields []string `protobuf:"bytes,3,rep,name=request_fields,json=requestFields,proto3" json:"request_fields,omitempty"`
|
||||
}
|
||||
|
||||
func (x *ErrorDetails) Reset() {
|
||||
*x = ErrorDetails{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_controller_api_v1_error_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ErrorDetails) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*ErrorDetails) ProtoMessage() {}
|
||||
|
||||
func (x *ErrorDetails) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_controller_api_v1_error_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use ErrorDetails.ProtoReflect.Descriptor instead.
|
||||
func (*ErrorDetails) Descriptor() ([]byte, []int) {
|
||||
return file_controller_api_v1_error_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *ErrorDetails) GetTraceId() string {
|
||||
if x != nil {
|
||||
return x.TraceId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ErrorDetails) GetRequestId() string {
|
||||
if x != nil {
|
||||
return x.RequestId
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *ErrorDetails) GetRequestFields() []string {
|
||||
if x != nil {
|
||||
return x.RequestFields
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// Error is returned by the JSON API when an error occurs.
|
||||
type Error struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The HTTP Status code applicable to this error.
|
||||
Status int32 `protobuf:"varint,1,opt,name=status,proto3" json:"status,omitempty"`
|
||||
// An application-specific error string.
|
||||
Code string `protobuf:"bytes,2,opt,name=code,proto3" json:"code,omitempty"`
|
||||
// A human readable explanation specific to this occurrence of the error.
|
||||
Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
|
||||
// Additional metadata regarding the error. Depending on the error different fields will be populated.
|
||||
Details *ErrorDetails `protobuf:"bytes,4,opt,name=details,proto3" json:"details,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Error) Reset() {
|
||||
*x = Error{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_controller_api_v1_error_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Error) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Error) ProtoMessage() {}
|
||||
|
||||
func (x *Error) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_controller_api_v1_error_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Error.ProtoReflect.Descriptor instead.
|
||||
func (*Error) Descriptor() ([]byte, []int) {
|
||||
return file_controller_api_v1_error_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *Error) GetStatus() int32 {
|
||||
if x != nil {
|
||||
return x.Status
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *Error) GetCode() string {
|
||||
if x != nil {
|
||||
return x.Code
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Error) GetMessage() string {
|
||||
if x != nil {
|
||||
return x.Message
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Error) GetDetails() *ErrorDetails {
|
||||
if x != nil {
|
||||
return x.Details
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_controller_api_v1_error_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_controller_api_v1_error_proto_rawDesc = []byte{
|
||||
0x0a, 0x1d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69,
|
||||
0x2f, 0x76, 0x31, 0x2f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x11, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
||||
0x76, 0x31, 0x22, 0x6f, 0x0a, 0x0c, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x44, 0x65, 0x74, 0x61, 0x69,
|
||||
0x6c, 0x73, 0x12, 0x19, 0x0a, 0x08, 0x74, 0x72, 0x61, 0x63, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x74, 0x72, 0x61, 0x63, 0x65, 0x49, 0x64, 0x12, 0x1d, 0x0a,
|
||||
0x0a, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x09, 0x52, 0x09, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e,
|
||||
0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x5f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x73, 0x18, 0x03,
|
||||
0x20, 0x03, 0x28, 0x09, 0x52, 0x0d, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x46, 0x69, 0x65,
|
||||
0x6c, 0x64, 0x73, 0x22, 0x88, 0x01, 0x0a, 0x05, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x12, 0x16, 0x0a,
|
||||
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x73,
|
||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x12, 0x0a, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x04, 0x63, 0x6f, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73,
|
||||
0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73,
|
||||
0x61, 0x67, 0x65, 0x12, 0x39, 0x0a, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x04,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65,
|
||||
0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x72, 0x72, 0x6f, 0x72, 0x44, 0x65,
|
||||
0x74, 0x61, 0x69, 0x6c, 0x73, 0x52, 0x07, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x42, 0x41,
|
||||
0x5a, 0x3f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73,
|
||||
0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65,
|
||||
0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63,
|
||||
0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x3b, 0x61, 0x70,
|
||||
0x69, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_controller_api_v1_error_proto_rawDescOnce sync.Once
|
||||
file_controller_api_v1_error_proto_rawDescData = file_controller_api_v1_error_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_controller_api_v1_error_proto_rawDescGZIP() []byte {
|
||||
file_controller_api_v1_error_proto_rawDescOnce.Do(func() {
|
||||
file_controller_api_v1_error_proto_rawDescData = protoimpl.X.CompressGZIP(file_controller_api_v1_error_proto_rawDescData)
|
||||
})
|
||||
return file_controller_api_v1_error_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_controller_api_v1_error_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_controller_api_v1_error_proto_goTypes = []interface{}{
|
||||
(*ErrorDetails)(nil), // 0: controller.api.v1.ErrorDetails
|
||||
(*Error)(nil), // 1: controller.api.v1.Error
|
||||
}
|
||||
var file_controller_api_v1_error_proto_depIdxs = []int32{
|
||||
0, // 0: controller.api.v1.Error.details:type_name -> controller.api.v1.ErrorDetails
|
||||
1, // [1:1] is the sub-list for method output_type
|
||||
1, // [1:1] is the sub-list for method input_type
|
||||
1, // [1:1] is the sub-list for extension type_name
|
||||
1, // [1:1] is the sub-list for extension extendee
|
||||
0, // [0:1] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_controller_api_v1_error_proto_init() }
|
||||
func file_controller_api_v1_error_proto_init() {
|
||||
if File_controller_api_v1_error_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_controller_api_v1_error_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ErrorDetails); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_controller_api_v1_error_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Error); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_controller_api_v1_error_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 2,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_controller_api_v1_error_proto_goTypes,
|
||||
DependencyIndexes: file_controller_api_v1_error_proto_depIdxs,
|
||||
MessageInfos: file_controller_api_v1_error_proto_msgTypes,
|
||||
}.Build()
|
||||
File_controller_api_v1_error_proto = out.File
|
||||
file_controller_api_v1_error_proto_rawDesc = nil
|
||||
file_controller_api_v1_error_proto_goTypes = nil
|
||||
file_controller_api_v1_error_proto_depIdxs = nil
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,871 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: controller/api/v1/host_catalog_service.proto
|
||||
|
||||
/*
|
||||
Package api is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/golang/protobuf/descriptor"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = descriptor.ForMessage
|
||||
|
||||
var (
|
||||
filter_HostCatalogService_GetHostCatalog_0 = &utilities.DoubleArray{Encoding: map[string]int{"org_id": 0, "project_id": 1, "id": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}}
|
||||
)
|
||||
|
||||
func request_HostCatalogService_GetHostCatalog_0(ctx context.Context, marshaler runtime.Marshaler, client HostCatalogServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetHostCatalogRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
}
|
||||
|
||||
protoReq.Id, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_HostCatalogService_GetHostCatalog_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetHostCatalog(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_HostCatalogService_GetHostCatalog_0(ctx context.Context, marshaler runtime.Marshaler, server HostCatalogServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetHostCatalogRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
}
|
||||
|
||||
protoReq.Id, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_HostCatalogService_GetHostCatalog_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetHostCatalog(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_HostCatalogService_ListHostCatalogs_0 = &utilities.DoubleArray{Encoding: map[string]int{"org_id": 0, "project_id": 1}, Base: []int{1, 1, 2, 0, 0}, Check: []int{0, 1, 1, 2, 3}}
|
||||
)
|
||||
|
||||
func request_HostCatalogService_ListHostCatalogs_0(ctx context.Context, marshaler runtime.Marshaler, client HostCatalogServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListHostCatalogsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_HostCatalogService_ListHostCatalogs_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ListHostCatalogs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_HostCatalogService_ListHostCatalogs_0(ctx context.Context, marshaler runtime.Marshaler, server HostCatalogServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListHostCatalogsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_HostCatalogService_ListHostCatalogs_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.ListHostCatalogs(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_HostCatalogService_CreateHostCatalog_0(ctx context.Context, marshaler runtime.Marshaler, client HostCatalogServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CreateHostCatalogRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
msg, err := client.CreateHostCatalog(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_HostCatalogService_CreateHostCatalog_0(ctx context.Context, marshaler runtime.Marshaler, server HostCatalogServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CreateHostCatalogRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
msg, err := server.CreateHostCatalog(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_HostCatalogService_UpdateHostCatalog_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "org_id": 1, "project_id": 2, "id": 3}, Base: []int{1, 1, 2, 3, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 1, 2, 3, 4, 5}}
|
||||
)
|
||||
|
||||
func request_HostCatalogService_UpdateHostCatalog_0(ctx context.Context, marshaler runtime.Marshaler, client HostCatalogServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq UpdateHostCatalogRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
|
||||
_, md := descriptor.ForMessage(protoReq.Item)
|
||||
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), md); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
} else {
|
||||
protoReq.UpdateMask = fieldMask
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
}
|
||||
|
||||
protoReq.Id, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_HostCatalogService_UpdateHostCatalog_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.UpdateHostCatalog(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_HostCatalogService_UpdateHostCatalog_0(ctx context.Context, marshaler runtime.Marshaler, server HostCatalogServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq UpdateHostCatalogRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
|
||||
_, md := descriptor.ForMessage(protoReq.Item)
|
||||
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), md); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
} else {
|
||||
protoReq.UpdateMask = fieldMask
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
}
|
||||
|
||||
protoReq.Id, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_HostCatalogService_UpdateHostCatalog_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.UpdateHostCatalog(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_HostCatalogService_DeleteHostCatalog_0(ctx context.Context, marshaler runtime.Marshaler, client HostCatalogServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq DeleteHostCatalogRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
}
|
||||
|
||||
protoReq.Id, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||
}
|
||||
|
||||
msg, err := client.DeleteHostCatalog(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_HostCatalogService_DeleteHostCatalog_0(ctx context.Context, marshaler runtime.Marshaler, server HostCatalogServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq DeleteHostCatalogRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
}
|
||||
|
||||
protoReq.Id, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||
}
|
||||
|
||||
msg, err := server.DeleteHostCatalog(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterHostCatalogServiceHandlerServer registers the http handlers for service HostCatalogService to "mux".
|
||||
// UnaryRPC :call HostCatalogServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
func RegisterHostCatalogServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HostCatalogServiceServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_HostCatalogService_GetHostCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_HostCatalogService_GetHostCatalog_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostCatalogService_GetHostCatalog_0(ctx, mux, outboundMarshaler, w, req, response_HostCatalogService_GetHostCatalog_0{resp}, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_HostCatalogService_ListHostCatalogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_HostCatalogService_ListHostCatalogs_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostCatalogService_ListHostCatalogs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_HostCatalogService_CreateHostCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_HostCatalogService_CreateHostCatalog_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostCatalogService_CreateHostCatalog_0(ctx, mux, outboundMarshaler, w, req, response_HostCatalogService_CreateHostCatalog_0{resp}, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PATCH", pattern_HostCatalogService_UpdateHostCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_HostCatalogService_UpdateHostCatalog_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostCatalogService_UpdateHostCatalog_0(ctx, mux, outboundMarshaler, w, req, response_HostCatalogService_UpdateHostCatalog_0{resp}, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_HostCatalogService_DeleteHostCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_HostCatalogService_DeleteHostCatalog_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostCatalogService_DeleteHostCatalog_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterHostCatalogServiceHandlerFromEndpoint is same as RegisterHostCatalogServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterHostCatalogServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.Dial(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterHostCatalogServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterHostCatalogServiceHandler registers the http handlers for service HostCatalogService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterHostCatalogServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterHostCatalogServiceHandlerClient(ctx, mux, NewHostCatalogServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterHostCatalogServiceHandlerClient registers the http handlers for service HostCatalogService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HostCatalogServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HostCatalogServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "HostCatalogServiceClient" to call the correct interceptors.
|
||||
func RegisterHostCatalogServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HostCatalogServiceClient) error {
|
||||
|
||||
mux.Handle("GET", pattern_HostCatalogService_GetHostCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_HostCatalogService_GetHostCatalog_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostCatalogService_GetHostCatalog_0(ctx, mux, outboundMarshaler, w, req, response_HostCatalogService_GetHostCatalog_0{resp}, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_HostCatalogService_ListHostCatalogs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_HostCatalogService_ListHostCatalogs_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostCatalogService_ListHostCatalogs_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_HostCatalogService_CreateHostCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_HostCatalogService_CreateHostCatalog_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostCatalogService_CreateHostCatalog_0(ctx, mux, outboundMarshaler, w, req, response_HostCatalogService_CreateHostCatalog_0{resp}, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PATCH", pattern_HostCatalogService_UpdateHostCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_HostCatalogService_UpdateHostCatalog_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostCatalogService_UpdateHostCatalog_0(ctx, mux, outboundMarshaler, w, req, response_HostCatalogService_UpdateHostCatalog_0{resp}, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_HostCatalogService_DeleteHostCatalog_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_HostCatalogService_DeleteHostCatalog_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostCatalogService_DeleteHostCatalog_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type response_HostCatalogService_GetHostCatalog_0 struct {
|
||||
proto.Message
|
||||
}
|
||||
|
||||
func (m response_HostCatalogService_GetHostCatalog_0) XXX_ResponseBody() interface{} {
|
||||
response := m.Message.(*GetHostCatalogResponse)
|
||||
return response.Item
|
||||
}
|
||||
|
||||
type response_HostCatalogService_CreateHostCatalog_0 struct {
|
||||
proto.Message
|
||||
}
|
||||
|
||||
func (m response_HostCatalogService_CreateHostCatalog_0) XXX_ResponseBody() interface{} {
|
||||
response := m.Message.(*CreateHostCatalogResponse)
|
||||
return response.Item
|
||||
}
|
||||
|
||||
type response_HostCatalogService_UpdateHostCatalog_0 struct {
|
||||
proto.Message
|
||||
}
|
||||
|
||||
func (m response_HostCatalogService_UpdateHostCatalog_0) XXX_ResponseBody() interface{} {
|
||||
response := m.Message.(*UpdateHostCatalogResponse)
|
||||
return response.Item
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_HostCatalogService_GetHostCatalog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"v1", "orgs", "org_id", "projects", "project_id", "host-catalogs", "id"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_HostCatalogService_ListHostCatalogs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"v1", "orgs", "org_id", "projects", "project_id", "host-catalogs"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_HostCatalogService_CreateHostCatalog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"v1", "orgs", "org_id", "projects", "project_id", "host-catalogs"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_HostCatalogService_UpdateHostCatalog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"v1", "orgs", "org_id", "projects", "project_id", "host-catalogs", "id"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_HostCatalogService_DeleteHostCatalog_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6}, []string{"v1", "orgs", "org_id", "projects", "project_id", "host-catalogs", "id"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_HostCatalogService_GetHostCatalog_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_HostCatalogService_ListHostCatalogs_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_HostCatalogService_CreateHostCatalog_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_HostCatalogService_UpdateHostCatalog_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_HostCatalogService_DeleteHostCatalog_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,981 @@
|
||||
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
|
||||
// source: controller/api/v1/host_service.proto
|
||||
|
||||
/*
|
||||
Package api is a reverse proxy.
|
||||
|
||||
It translates gRPC into RESTful JSON APIs.
|
||||
*/
|
||||
package api
|
||||
|
||||
import (
|
||||
"context"
|
||||
"io"
|
||||
"net/http"
|
||||
|
||||
"github.com/golang/protobuf/descriptor"
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/grpc-ecosystem/grpc-gateway/utilities"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/grpclog"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
// Suppress "imported and not used" errors
|
||||
var _ codes.Code
|
||||
var _ io.Reader
|
||||
var _ status.Status
|
||||
var _ = runtime.String
|
||||
var _ = utilities.NewDoubleArray
|
||||
var _ = descriptor.ForMessage
|
||||
|
||||
var (
|
||||
filter_HostService_GetHost_0 = &utilities.DoubleArray{Encoding: map[string]int{"org_id": 0, "project_id": 1, "host_catalog_id": 2, "id": 3}, Base: []int{1, 1, 2, 3, 4, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 1, 2, 3, 4, 5}}
|
||||
)
|
||||
|
||||
func request_HostService_GetHost_0(ctx context.Context, marshaler runtime.Marshaler, client HostServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetHostRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["host_catalog_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "host_catalog_id")
|
||||
}
|
||||
|
||||
protoReq.HostCatalogId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "host_catalog_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
}
|
||||
|
||||
protoReq.Id, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_HostService_GetHost_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.GetHost(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_HostService_GetHost_0(ctx context.Context, marshaler runtime.Marshaler, server HostServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq GetHostRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["host_catalog_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "host_catalog_id")
|
||||
}
|
||||
|
||||
protoReq.HostCatalogId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "host_catalog_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
}
|
||||
|
||||
protoReq.Id, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_HostService_GetHost_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.GetHost(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_HostService_ListHosts_0 = &utilities.DoubleArray{Encoding: map[string]int{"org_id": 0, "project_id": 1, "host_catalog_id": 2}, Base: []int{1, 1, 2, 3, 0, 0, 0}, Check: []int{0, 1, 1, 1, 2, 3, 4}}
|
||||
)
|
||||
|
||||
func request_HostService_ListHosts_0(ctx context.Context, marshaler runtime.Marshaler, client HostServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListHostsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["host_catalog_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "host_catalog_id")
|
||||
}
|
||||
|
||||
protoReq.HostCatalogId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "host_catalog_id", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_HostService_ListHosts_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.ListHosts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_HostService_ListHosts_0(ctx context.Context, marshaler runtime.Marshaler, server HostServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq ListHostsRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["host_catalog_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "host_catalog_id")
|
||||
}
|
||||
|
||||
protoReq.HostCatalogId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "host_catalog_id", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_HostService_ListHosts_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.ListHosts(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_HostService_CreateHost_0(ctx context.Context, marshaler runtime.Marshaler, client HostServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CreateHostRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["host_catalog_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "host_catalog_id")
|
||||
}
|
||||
|
||||
protoReq.HostCatalogId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "host_catalog_id", err)
|
||||
}
|
||||
|
||||
msg, err := client.CreateHost(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_HostService_CreateHost_0(ctx context.Context, marshaler runtime.Marshaler, server HostServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq CreateHostRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["host_catalog_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "host_catalog_id")
|
||||
}
|
||||
|
||||
protoReq.HostCatalogId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "host_catalog_id", err)
|
||||
}
|
||||
|
||||
msg, err := server.CreateHost(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
var (
|
||||
filter_HostService_UpdateHost_0 = &utilities.DoubleArray{Encoding: map[string]int{"item": 0, "org_id": 1, "project_id": 2, "host_catalog_id": 3, "id": 4}, Base: []int{1, 1, 2, 3, 4, 5, 0, 0, 0, 0, 0}, Check: []int{0, 1, 1, 1, 1, 1, 2, 3, 4, 5, 6}}
|
||||
)
|
||||
|
||||
func request_HostService_UpdateHost_0(ctx context.Context, marshaler runtime.Marshaler, client HostServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq UpdateHostRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
|
||||
_, md := descriptor.ForMessage(protoReq.Item)
|
||||
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), md); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
} else {
|
||||
protoReq.UpdateMask = fieldMask
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["host_catalog_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "host_catalog_id")
|
||||
}
|
||||
|
||||
protoReq.HostCatalogId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "host_catalog_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
}
|
||||
|
||||
protoReq.Id, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||
}
|
||||
|
||||
if err := req.ParseForm(); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_HostService_UpdateHost_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := client.UpdateHost(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_HostService_UpdateHost_0(ctx context.Context, marshaler runtime.Marshaler, server HostServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq UpdateHostRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
newReader, berr := utilities.IOReaderFactory(req.Body)
|
||||
if berr != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
|
||||
}
|
||||
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Item); err != nil && err != io.EOF {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {
|
||||
_, md := descriptor.ForMessage(protoReq.Item)
|
||||
if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), md); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
} else {
|
||||
protoReq.UpdateMask = fieldMask
|
||||
}
|
||||
}
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["host_catalog_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "host_catalog_id")
|
||||
}
|
||||
|
||||
protoReq.HostCatalogId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "host_catalog_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
}
|
||||
|
||||
protoReq.Id, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||
}
|
||||
|
||||
if err := runtime.PopulateQueryParameters(&protoReq, req.URL.Query(), filter_HostService_UpdateHost_0); err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
|
||||
}
|
||||
|
||||
msg, err := server.UpdateHost(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func request_HostService_DeleteHost_0(ctx context.Context, marshaler runtime.Marshaler, client HostServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq DeleteHostRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["host_catalog_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "host_catalog_id")
|
||||
}
|
||||
|
||||
protoReq.HostCatalogId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "host_catalog_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
}
|
||||
|
||||
protoReq.Id, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||
}
|
||||
|
||||
msg, err := client.DeleteHost(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
func local_request_HostService_DeleteHost_0(ctx context.Context, marshaler runtime.Marshaler, server HostServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var protoReq DeleteHostRequest
|
||||
var metadata runtime.ServerMetadata
|
||||
|
||||
var (
|
||||
val string
|
||||
ok bool
|
||||
err error
|
||||
_ = err
|
||||
)
|
||||
|
||||
val, ok = pathParams["org_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "org_id")
|
||||
}
|
||||
|
||||
protoReq.OrgId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "org_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["project_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "project_id")
|
||||
}
|
||||
|
||||
protoReq.ProjectId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "project_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["host_catalog_id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "host_catalog_id")
|
||||
}
|
||||
|
||||
protoReq.HostCatalogId, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "host_catalog_id", err)
|
||||
}
|
||||
|
||||
val, ok = pathParams["id"]
|
||||
if !ok {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
|
||||
}
|
||||
|
||||
protoReq.Id, err = runtime.String(val)
|
||||
|
||||
if err != nil {
|
||||
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
|
||||
}
|
||||
|
||||
msg, err := server.DeleteHost(ctx, &protoReq)
|
||||
return msg, metadata, err
|
||||
|
||||
}
|
||||
|
||||
// RegisterHostServiceHandlerServer registers the http handlers for service HostService to "mux".
|
||||
// UnaryRPC :call HostServiceServer directly.
|
||||
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
|
||||
func RegisterHostServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server HostServiceServer) error {
|
||||
|
||||
mux.Handle("GET", pattern_HostService_GetHost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_HostService_GetHost_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostService_GetHost_0(ctx, mux, outboundMarshaler, w, req, response_HostService_GetHost_0{resp}, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_HostService_ListHosts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_HostService_ListHosts_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostService_ListHosts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_HostService_CreateHost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_HostService_CreateHost_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostService_CreateHost_0(ctx, mux, outboundMarshaler, w, req, response_HostService_CreateHost_0{resp}, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PATCH", pattern_HostService_UpdateHost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_HostService_UpdateHost_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostService_UpdateHost_0(ctx, mux, outboundMarshaler, w, req, response_HostService_UpdateHost_0{resp}, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_HostService_DeleteHost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := local_request_HostService_DeleteHost_0(rctx, inboundMarshaler, server, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostService_DeleteHost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// RegisterHostServiceHandlerFromEndpoint is same as RegisterHostServiceHandler but
|
||||
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
|
||||
func RegisterHostServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
|
||||
conn, err := grpc.Dial(endpoint, opts...)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer func() {
|
||||
if err != nil {
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
return
|
||||
}
|
||||
go func() {
|
||||
<-ctx.Done()
|
||||
if cerr := conn.Close(); cerr != nil {
|
||||
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
|
||||
}
|
||||
}()
|
||||
}()
|
||||
|
||||
return RegisterHostServiceHandler(ctx, mux, conn)
|
||||
}
|
||||
|
||||
// RegisterHostServiceHandler registers the http handlers for service HostService to "mux".
|
||||
// The handlers forward requests to the grpc endpoint over "conn".
|
||||
func RegisterHostServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
|
||||
return RegisterHostServiceHandlerClient(ctx, mux, NewHostServiceClient(conn))
|
||||
}
|
||||
|
||||
// RegisterHostServiceHandlerClient registers the http handlers for service HostService
|
||||
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HostServiceClient".
|
||||
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HostServiceClient"
|
||||
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
|
||||
// "HostServiceClient" to call the correct interceptors.
|
||||
func RegisterHostServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HostServiceClient) error {
|
||||
|
||||
mux.Handle("GET", pattern_HostService_GetHost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_HostService_GetHost_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostService_GetHost_0(ctx, mux, outboundMarshaler, w, req, response_HostService_GetHost_0{resp}, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("GET", pattern_HostService_ListHosts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_HostService_ListHosts_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostService_ListHosts_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("POST", pattern_HostService_CreateHost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_HostService_CreateHost_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostService_CreateHost_0(ctx, mux, outboundMarshaler, w, req, response_HostService_CreateHost_0{resp}, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("PATCH", pattern_HostService_UpdateHost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_HostService_UpdateHost_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostService_UpdateHost_0(ctx, mux, outboundMarshaler, w, req, response_HostService_UpdateHost_0{resp}, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
mux.Handle("DELETE", pattern_HostService_DeleteHost_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
|
||||
ctx, cancel := context.WithCancel(req.Context())
|
||||
defer cancel()
|
||||
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
|
||||
rctx, err := runtime.AnnotateContext(ctx, mux, req)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
resp, md, err := request_HostService_DeleteHost_0(rctx, inboundMarshaler, client, req, pathParams)
|
||||
ctx = runtime.NewServerMetadataContext(ctx, md)
|
||||
if err != nil {
|
||||
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
|
||||
return
|
||||
}
|
||||
|
||||
forward_HostService_DeleteHost_0(ctx, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
|
||||
|
||||
})
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
type response_HostService_GetHost_0 struct {
|
||||
proto.Message
|
||||
}
|
||||
|
||||
func (m response_HostService_GetHost_0) XXX_ResponseBody() interface{} {
|
||||
response := m.Message.(*GetHostResponse)
|
||||
return response.Item
|
||||
}
|
||||
|
||||
type response_HostService_CreateHost_0 struct {
|
||||
proto.Message
|
||||
}
|
||||
|
||||
func (m response_HostService_CreateHost_0) XXX_ResponseBody() interface{} {
|
||||
response := m.Message.(*CreateHostResponse)
|
||||
return response.Item
|
||||
}
|
||||
|
||||
type response_HostService_UpdateHost_0 struct {
|
||||
proto.Message
|
||||
}
|
||||
|
||||
func (m response_HostService_UpdateHost_0) XXX_ResponseBody() interface{} {
|
||||
response := m.Message.(*UpdateHostResponse)
|
||||
return response.Item
|
||||
}
|
||||
|
||||
var (
|
||||
pattern_HostService_GetHost_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"v1", "orgs", "org_id", "projects", "project_id", "host-catalogs", "host_catalog_id", "hosts", "id"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_HostService_ListHosts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"v1", "orgs", "org_id", "projects", "project_id", "host-catalogs", "host_catalog_id", "hosts"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_HostService_CreateHost_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7}, []string{"v1", "orgs", "org_id", "projects", "project_id", "host-catalogs", "host_catalog_id", "hosts"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_HostService_UpdateHost_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"v1", "orgs", "org_id", "projects", "project_id", "host-catalogs", "host_catalog_id", "hosts", "id"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
|
||||
pattern_HostService_DeleteHost_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5, 1, 0, 4, 1, 5, 6, 2, 7, 1, 0, 4, 1, 5, 8}, []string{"v1", "orgs", "org_id", "projects", "project_id", "host-catalogs", "host_catalog_id", "hosts", "id"}, "", runtime.AssumeColonVerbOpt(true)))
|
||||
)
|
||||
|
||||
var (
|
||||
forward_HostService_GetHost_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_HostService_ListHosts_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_HostService_CreateHost_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_HostService_UpdateHost_0 = runtime.ForwardResponseMessage
|
||||
|
||||
forward_HostService_DeleteHost_0 = runtime.ForwardResponseMessage
|
||||
)
|
||||
File diff suppressed because it is too large.
Load diff
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,234 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.21.0
|
||||
// protoc v3.11.4
|
||||
// source: controller/api/resource/v1/host.proto
|
||||
|
||||
package resource
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
timestamp "github.com/golang/protobuf/ptypes/timestamp"
|
||||
wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
// Host contains all fields related to a Host resource.
|
||||
type Host struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Output only.
|
||||
Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
|
||||
FriendlyName *wrappers.StringValue `protobuf:"bytes,2,opt,name=friendly_name,json=friendlyName,proto3" json:"friendly_name,omitempty"`
|
||||
// The time this host was created.
|
||||
// Output only.
|
||||
CreatedTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"`
|
||||
// The time this host was last updated.
|
||||
// Output only.
|
||||
UpdatedTime *timestamp.Timestamp `protobuf:"bytes,4,opt,name=updated_time,json=updatedTime,proto3" json:"updated_time,omitempty"`
|
||||
// Marks the host as disabled. Default is false.
|
||||
Disabled *wrappers.BoolValue `protobuf:"bytes,5,opt,name=disabled,proto3" json:"disabled,omitempty"`
|
||||
// This field is required.
|
||||
Address *wrappers.StringValue `protobuf:"bytes,6,opt,name=address,proto3" json:"address,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Host) Reset() {
|
||||
*x = Host{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_controller_api_resource_v1_host_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Host) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Host) ProtoMessage() {}
|
||||
|
||||
func (x *Host) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_controller_api_resource_v1_host_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Host.ProtoReflect.Descriptor instead.
|
||||
func (*Host) Descriptor() ([]byte, []int) {
|
||||
return file_controller_api_resource_v1_host_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *Host) GetUri() string {
|
||||
if x != nil {
|
||||
return x.Uri
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *Host) GetFriendlyName() *wrappers.StringValue {
|
||||
if x != nil {
|
||||
return x.FriendlyName
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Host) GetCreatedTime() *timestamp.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreatedTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Host) GetUpdatedTime() *timestamp.Timestamp {
|
||||
if x != nil {
|
||||
return x.UpdatedTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Host) GetDisabled() *wrappers.BoolValue {
|
||||
if x != nil {
|
||||
return x.Disabled
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Host) GetAddress() *wrappers.StringValue {
|
||||
if x != nil {
|
||||
return x.Address
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_controller_api_resource_v1_host_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_controller_api_resource_v1_host_proto_rawDesc = []byte{
|
||||
0x0a, 0x25, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69,
|
||||
0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x6f, 0x73,
|
||||
0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,
|
||||
0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
|
||||
0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc9, 0x02, 0x0a, 0x04, 0x48, 0x6f, 0x73, 0x74, 0x12, 0x10, 0x0a,
|
||||
0x03, 0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12,
|
||||
0x41, 0x0a, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x6c, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65,
|
||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56,
|
||||
0x61, 0x6c, 0x75, 0x65, 0x52, 0x0c, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x6c, 0x79, 0x4e, 0x61,
|
||||
0x6d, 0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69,
|
||||
0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73,
|
||||
0x74, 0x61, 0x6d, 0x70, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d,
|
||||
0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d,
|
||||
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74,
|
||||
0x61, 0x6d, 0x70, 0x52, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65,
|
||||
0x12, 0x36, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01,
|
||||
0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08,
|
||||
0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x36, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72,
|
||||
0x65, 0x73, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67,
|
||||
0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69,
|
||||
0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73,
|
||||
0x42, 0x4f, 0x5a, 0x4d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68,
|
||||
0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f,
|
||||
0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e,
|
||||
0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f,
|
||||
0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
|
||||
0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_controller_api_resource_v1_host_proto_rawDescOnce sync.Once
|
||||
file_controller_api_resource_v1_host_proto_rawDescData = file_controller_api_resource_v1_host_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_controller_api_resource_v1_host_proto_rawDescGZIP() []byte {
|
||||
file_controller_api_resource_v1_host_proto_rawDescOnce.Do(func() {
|
||||
file_controller_api_resource_v1_host_proto_rawDescData = protoimpl.X.CompressGZIP(file_controller_api_resource_v1_host_proto_rawDescData)
|
||||
})
|
||||
return file_controller_api_resource_v1_host_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_controller_api_resource_v1_host_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_controller_api_resource_v1_host_proto_goTypes = []interface{}{
|
||||
(*Host)(nil), // 0: controller.api.resource.v1.Host
|
||||
(*wrappers.StringValue)(nil), // 1: google.protobuf.StringValue
|
||||
(*timestamp.Timestamp)(nil), // 2: google.protobuf.Timestamp
|
||||
(*wrappers.BoolValue)(nil), // 3: google.protobuf.BoolValue
|
||||
}
|
||||
var file_controller_api_resource_v1_host_proto_depIdxs = []int32{
|
||||
1, // 0: controller.api.resource.v1.Host.friendly_name:type_name -> google.protobuf.StringValue
|
||||
2, // 1: controller.api.resource.v1.Host.created_time:type_name -> google.protobuf.Timestamp
|
||||
2, // 2: controller.api.resource.v1.Host.updated_time:type_name -> google.protobuf.Timestamp
|
||||
3, // 3: controller.api.resource.v1.Host.disabled:type_name -> google.protobuf.BoolValue
|
||||
1, // 4: controller.api.resource.v1.Host.address:type_name -> google.protobuf.StringValue
|
||||
5, // [5:5] is the sub-list for method output_type
|
||||
5, // [5:5] is the sub-list for method input_type
|
||||
5, // [5:5] is the sub-list for extension type_name
|
||||
5, // [5:5] is the sub-list for extension extendee
|
||||
0, // [0:5] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_controller_api_resource_v1_host_proto_init() }
|
||||
func file_controller_api_resource_v1_host_proto_init() {
|
||||
if File_controller_api_resource_v1_host_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_controller_api_resource_v1_host_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Host); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_controller_api_resource_v1_host_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_controller_api_resource_v1_host_proto_goTypes,
|
||||
DependencyIndexes: file_controller_api_resource_v1_host_proto_depIdxs,
|
||||
MessageInfos: file_controller_api_resource_v1_host_proto_msgTypes,
|
||||
}.Build()
|
||||
File_controller_api_resource_v1_host_proto = out.File
|
||||
file_controller_api_resource_v1_host_proto_rawDesc = nil
|
||||
file_controller_api_resource_v1_host_proto_goTypes = nil
|
||||
file_controller_api_resource_v1_host_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,513 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.21.0
|
||||
// protoc v3.11.4
|
||||
// source: controller/api/resource/v1/host_catalog.proto
|
||||
|
||||
package resource
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
timestamp "github.com/golang/protobuf/ptypes/timestamp"
|
||||
wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type HostCatalogType int32
|
||||
|
||||
const (
|
||||
HostCatalogType_HOST_CATALOG_TYPE_UNSPECIFIED HostCatalogType = 0
|
||||
HostCatalogType_HOST_CATALOG_TYPE_EC2 HostCatalogType = 1
|
||||
HostCatalogType_HOST_CATALOG_TYPE_STATIC HostCatalogType = 2
|
||||
)
|
||||
|
||||
// Enum value maps for HostCatalogType.
|
||||
var (
|
||||
HostCatalogType_name = map[int32]string{
|
||||
0: "HOST_CATALOG_TYPE_UNSPECIFIED",
|
||||
1: "HOST_CATALOG_TYPE_EC2",
|
||||
2: "HOST_CATALOG_TYPE_STATIC",
|
||||
}
|
||||
HostCatalogType_value = map[string]int32{
|
||||
"HOST_CATALOG_TYPE_UNSPECIFIED": 0,
|
||||
"HOST_CATALOG_TYPE_EC2": 1,
|
||||
"HOST_CATALOG_TYPE_STATIC": 2,
|
||||
}
|
||||
)
|
||||
|
||||
func (x HostCatalogType) Enum() *HostCatalogType {
|
||||
p := new(HostCatalogType)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x HostCatalogType) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (HostCatalogType) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_controller_api_resource_v1_host_catalog_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (HostCatalogType) Type() protoreflect.EnumType {
|
||||
return &file_controller_api_resource_v1_host_catalog_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x HostCatalogType) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use HostCatalogType.Descriptor instead.
|
||||
func (HostCatalogType) EnumDescriptor() ([]byte, []int) {
|
||||
return file_controller_api_resource_v1_host_catalog_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
// HostCatalog organizes Hosts into HostSets.
|
||||
type HostCatalog struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Output only.
|
||||
Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
|
||||
FriendlyName *wrappers.StringValue `protobuf:"bytes,2,opt,name=friendly_name,json=friendlyName,proto3" json:"friendly_name,omitempty"`
|
||||
// The time this host_catalog was created.
|
||||
// Output only.
|
||||
CreatedTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"`
|
||||
// The time this host_catalog was last updated.
|
||||
// Output only.
|
||||
UpdatedTime *timestamp.Timestamp `protobuf:"bytes,4,opt,name=updated_time,json=updatedTime,proto3" json:"updated_time,omitempty"`
|
||||
// Marks the host_catalog as disabled. Default is false.
|
||||
Disabled *wrappers.BoolValue `protobuf:"bytes,5,opt,name=disabled,proto3" json:"disabled,omitempty"`
|
||||
// Types that are assignable to TypeDetails:
|
||||
// *HostCatalog_StaticHostCatalogDetails
|
||||
// *HostCatalog_Ec2HostCatalogDetails
|
||||
TypeDetails isHostCatalog_TypeDetails `protobuf_oneof:"type_details"`
|
||||
Type HostCatalogType `protobuf:"varint,8,opt,name=type,proto3,enum=controller.api.resource.v1.HostCatalogType" json:"type,omitempty"` // TODO: Figure out how to provide relevant information regarding Host and Set lists on a catalog.
|
||||
}
|
||||
|
||||
func (x *HostCatalog) Reset() {
|
||||
*x = HostCatalog{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_controller_api_resource_v1_host_catalog_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *HostCatalog) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*HostCatalog) ProtoMessage() {}
|
||||
|
||||
func (x *HostCatalog) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_controller_api_resource_v1_host_catalog_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use HostCatalog.ProtoReflect.Descriptor instead.
|
||||
func (*HostCatalog) Descriptor() ([]byte, []int) {
|
||||
return file_controller_api_resource_v1_host_catalog_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *HostCatalog) GetUri() string {
|
||||
if x != nil {
|
||||
return x.Uri
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HostCatalog) GetFriendlyName() *wrappers.StringValue {
|
||||
if x != nil {
|
||||
return x.FriendlyName
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HostCatalog) GetCreatedTime() *timestamp.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreatedTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HostCatalog) GetUpdatedTime() *timestamp.Timestamp {
|
||||
if x != nil {
|
||||
return x.UpdatedTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HostCatalog) GetDisabled() *wrappers.BoolValue {
|
||||
if x != nil {
|
||||
return x.Disabled
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (m *HostCatalog) GetTypeDetails() isHostCatalog_TypeDetails {
|
||||
if m != nil {
|
||||
return m.TypeDetails
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HostCatalog) GetStaticHostCatalogDetails() *StaticCatalogDetails {
|
||||
if x, ok := x.GetTypeDetails().(*HostCatalog_StaticHostCatalogDetails); ok {
|
||||
return x.StaticHostCatalogDetails
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HostCatalog) GetEc2HostCatalogDetails() *Ec2CatalogDetails {
|
||||
if x, ok := x.GetTypeDetails().(*HostCatalog_Ec2HostCatalogDetails); ok {
|
||||
return x.Ec2HostCatalogDetails
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HostCatalog) GetType() HostCatalogType {
|
||||
if x != nil {
|
||||
return x.Type
|
||||
}
|
||||
return HostCatalogType_HOST_CATALOG_TYPE_UNSPECIFIED
|
||||
}
|
||||
|
||||
type isHostCatalog_TypeDetails interface {
|
||||
isHostCatalog_TypeDetails()
|
||||
}
|
||||
|
||||
type HostCatalog_StaticHostCatalogDetails struct {
|
||||
StaticHostCatalogDetails *StaticCatalogDetails `protobuf:"bytes,6,opt,name=static_host_catalog_details,json=staticHostCatalogDetails,proto3,oneof"`
|
||||
}
|
||||
|
||||
type HostCatalog_Ec2HostCatalogDetails struct {
|
||||
Ec2HostCatalogDetails *Ec2CatalogDetails `protobuf:"bytes,7,opt,name=ec2_host_catalog_details,json=ec2HostCatalogDetails,proto3,oneof"`
|
||||
}
|
||||
|
||||
func (*HostCatalog_StaticHostCatalogDetails) isHostCatalog_TypeDetails() {}
|
||||
|
||||
func (*HostCatalog_Ec2HostCatalogDetails) isHostCatalog_TypeDetails() {}
|
||||
|
||||
type StaticCatalogDetails struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
}
|
||||
|
||||
func (x *StaticCatalogDetails) Reset() {
|
||||
*x = StaticCatalogDetails{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_controller_api_resource_v1_host_catalog_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *StaticCatalogDetails) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*StaticCatalogDetails) ProtoMessage() {}
|
||||
|
||||
func (x *StaticCatalogDetails) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_controller_api_resource_v1_host_catalog_proto_msgTypes[1]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use StaticCatalogDetails.ProtoReflect.Descriptor instead.
|
||||
func (*StaticCatalogDetails) Descriptor() ([]byte, []int) {
|
||||
return file_controller_api_resource_v1_host_catalog_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
type Ec2CatalogDetails struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// The AWS regions from which this catalog will retrieve the EC2 instances.
|
||||
Regions []string `protobuf:"bytes,1,rep,name=regions,proto3" json:"regions,omitempty"`
|
||||
// The access key used for authenticating with AWS when retrieving EC2 instance details.
|
||||
AccessKey *wrappers.StringValue `protobuf:"bytes,2,opt,name=access_key,json=accessKey,proto3" json:"access_key,omitempty"`
|
||||
// Input only.
|
||||
SecretKey *wrappers.StringValue `protobuf:"bytes,3,opt,name=secret_key,json=secretKey,proto3" json:"secret_key,omitempty"`
|
||||
// This value will never be returned in a response.
|
||||
Rotate *wrappers.BoolValue `protobuf:"bytes,4,opt,name=rotate,proto3" json:"rotate,omitempty"`
|
||||
}
|
||||
|
||||
func (x *Ec2CatalogDetails) Reset() {
|
||||
*x = Ec2CatalogDetails{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_controller_api_resource_v1_host_catalog_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *Ec2CatalogDetails) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*Ec2CatalogDetails) ProtoMessage() {}
|
||||
|
||||
func (x *Ec2CatalogDetails) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_controller_api_resource_v1_host_catalog_proto_msgTypes[2]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use Ec2CatalogDetails.ProtoReflect.Descriptor instead.
|
||||
func (*Ec2CatalogDetails) Descriptor() ([]byte, []int) {
|
||||
return file_controller_api_resource_v1_host_catalog_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *Ec2CatalogDetails) GetRegions() []string {
|
||||
if x != nil {
|
||||
return x.Regions
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Ec2CatalogDetails) GetAccessKey() *wrappers.StringValue {
|
||||
if x != nil {
|
||||
return x.AccessKey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Ec2CatalogDetails) GetSecretKey() *wrappers.StringValue {
|
||||
if x != nil {
|
||||
return x.SecretKey
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *Ec2CatalogDetails) GetRotate() *wrappers.BoolValue {
|
||||
if x != nil {
|
||||
return x.Rotate
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_controller_api_resource_v1_host_catalog_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_controller_api_resource_v1_host_catalog_proto_rawDesc = []byte{
|
||||
0x0a, 0x2d, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69,
|
||||
0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x6f, 0x73,
|
||||
0x74, 0x5f, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
|
||||
0x1a, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e,
|
||||
0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f,
|
||||
0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d,
|
||||
0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f,
|
||||
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72,
|
||||
0x61, 0x70, 0x70, 0x65, 0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xc6, 0x04, 0x0a,
|
||||
0x0b, 0x48, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x12, 0x10, 0x0a, 0x03,
|
||||
0x75, 0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x41,
|
||||
0x0a, 0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x6c, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,
|
||||
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61,
|
||||
0x6c, 0x75, 0x65, 0x52, 0x0c, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x6c, 0x79, 0x4e, 0x61, 0x6d,
|
||||
0x65, 0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d,
|
||||
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74,
|
||||
0x61, 0x6d, 0x70, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65,
|
||||
0x12, 0x3d, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65,
|
||||
0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
|
||||
0x6d, 0x70, 0x52, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12,
|
||||
0x36, 0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x64,
|
||||
0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x71, 0x0a, 0x1b, 0x73, 0x74, 0x61, 0x74, 0x69,
|
||||
0x63, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x5f, 0x64,
|
||||
0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x63,
|
||||
0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65,
|
||||
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63,
|
||||
0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x48, 0x00,
|
||||
0x52, 0x18, 0x73, 0x74, 0x61, 0x74, 0x69, 0x63, 0x48, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, 0x61,
|
||||
0x6c, 0x6f, 0x67, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x12, 0x68, 0x0a, 0x18, 0x65, 0x63,
|
||||
0x32, 0x5f, 0x68, 0x6f, 0x73, 0x74, 0x5f, 0x63, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x5f, 0x64,
|
||||
0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x63,
|
||||
0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65,
|
||||
0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x45, 0x63, 0x32, 0x43, 0x61, 0x74,
|
||||
0x61, 0x6c, 0x6f, 0x67, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x48, 0x00, 0x52, 0x15, 0x65,
|
||||
0x63, 0x32, 0x48, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x44, 0x65, 0x74,
|
||||
0x61, 0x69, 0x6c, 0x73, 0x12, 0x3f, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x08, 0x20, 0x01,
|
||||
0x28, 0x0e, 0x32, 0x2b, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e,
|
||||
0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x2e,
|
||||
0x48, 0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x52,
|
||||
0x04, 0x74, 0x79, 0x70, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x74, 0x79, 0x70, 0x65, 0x5f, 0x64, 0x65,
|
||||
0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0x16, 0x0a, 0x14, 0x53, 0x74, 0x61, 0x74, 0x69, 0x63, 0x43,
|
||||
0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x44, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x73, 0x22, 0xdb, 0x01,
|
||||
0x0a, 0x11, 0x45, 0x63, 0x32, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x44, 0x65, 0x74, 0x61,
|
||||
0x69, 0x6c, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01,
|
||||
0x20, 0x03, 0x28, 0x09, 0x52, 0x07, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x73, 0x12, 0x3b, 0x0a,
|
||||
0x0a, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||
0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52,
|
||||
0x09, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x4b, 0x65, 0x79, 0x12, 0x3b, 0x0a, 0x0a, 0x73, 0x65,
|
||||
0x63, 0x72, 0x65, 0x74, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c,
|
||||
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
|
||||
0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x09, 0x73, 0x65,
|
||||
0x63, 0x72, 0x65, 0x74, 0x4b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x06, 0x72, 0x6f, 0x74, 0x61, 0x74,
|
||||
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61,
|
||||
0x6c, 0x75, 0x65, 0x52, 0x06, 0x72, 0x6f, 0x74, 0x61, 0x74, 0x65, 0x2a, 0x6d, 0x0a, 0x0f, 0x48,
|
||||
0x6f, 0x73, 0x74, 0x43, 0x61, 0x74, 0x61, 0x6c, 0x6f, 0x67, 0x54, 0x79, 0x70, 0x65, 0x12, 0x21,
|
||||
0x0a, 0x1d, 0x48, 0x4f, 0x53, 0x54, 0x5f, 0x43, 0x41, 0x54, 0x41, 0x4c, 0x4f, 0x47, 0x5f, 0x54,
|
||||
0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,
|
||||
0x00, 0x12, 0x19, 0x0a, 0x15, 0x48, 0x4f, 0x53, 0x54, 0x5f, 0x43, 0x41, 0x54, 0x41, 0x4c, 0x4f,
|
||||
0x47, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x45, 0x43, 0x32, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18,
|
||||
0x48, 0x4f, 0x53, 0x54, 0x5f, 0x43, 0x41, 0x54, 0x41, 0x4c, 0x4f, 0x47, 0x5f, 0x54, 0x59, 0x50,
|
||||
0x45, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x49, 0x43, 0x10, 0x02, 0x42, 0x4f, 0x5a, 0x4d, 0x67, 0x69,
|
||||
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f,
|
||||
0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e,
|
||||
0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72,
|
||||
0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72,
|
||||
0x63, 0x65, 0x3b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_controller_api_resource_v1_host_catalog_proto_rawDescOnce sync.Once
|
||||
file_controller_api_resource_v1_host_catalog_proto_rawDescData = file_controller_api_resource_v1_host_catalog_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_controller_api_resource_v1_host_catalog_proto_rawDescGZIP() []byte {
|
||||
file_controller_api_resource_v1_host_catalog_proto_rawDescOnce.Do(func() {
|
||||
file_controller_api_resource_v1_host_catalog_proto_rawDescData = protoimpl.X.CompressGZIP(file_controller_api_resource_v1_host_catalog_proto_rawDescData)
|
||||
})
|
||||
return file_controller_api_resource_v1_host_catalog_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_controller_api_resource_v1_host_catalog_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_controller_api_resource_v1_host_catalog_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
|
||||
var file_controller_api_resource_v1_host_catalog_proto_goTypes = []interface{}{
|
||||
(HostCatalogType)(0), // 0: controller.api.resource.v1.HostCatalogType
|
||||
(*HostCatalog)(nil), // 1: controller.api.resource.v1.HostCatalog
|
||||
(*StaticCatalogDetails)(nil), // 2: controller.api.resource.v1.StaticCatalogDetails
|
||||
(*Ec2CatalogDetails)(nil), // 3: controller.api.resource.v1.Ec2CatalogDetails
|
||||
(*wrappers.StringValue)(nil), // 4: google.protobuf.StringValue
|
||||
(*timestamp.Timestamp)(nil), // 5: google.protobuf.Timestamp
|
||||
(*wrappers.BoolValue)(nil), // 6: google.protobuf.BoolValue
|
||||
}
|
||||
var file_controller_api_resource_v1_host_catalog_proto_depIdxs = []int32{
|
||||
4, // 0: controller.api.resource.v1.HostCatalog.friendly_name:type_name -> google.protobuf.StringValue
|
||||
5, // 1: controller.api.resource.v1.HostCatalog.created_time:type_name -> google.protobuf.Timestamp
|
||||
5, // 2: controller.api.resource.v1.HostCatalog.updated_time:type_name -> google.protobuf.Timestamp
|
||||
6, // 3: controller.api.resource.v1.HostCatalog.disabled:type_name -> google.protobuf.BoolValue
|
||||
2, // 4: controller.api.resource.v1.HostCatalog.static_host_catalog_details:type_name -> controller.api.resource.v1.StaticCatalogDetails
|
||||
3, // 5: controller.api.resource.v1.HostCatalog.ec2_host_catalog_details:type_name -> controller.api.resource.v1.Ec2CatalogDetails
|
||||
0, // 6: controller.api.resource.v1.HostCatalog.type:type_name -> controller.api.resource.v1.HostCatalogType
|
||||
4, // 7: controller.api.resource.v1.Ec2CatalogDetails.access_key:type_name -> google.protobuf.StringValue
|
||||
4, // 8: controller.api.resource.v1.Ec2CatalogDetails.secret_key:type_name -> google.protobuf.StringValue
|
||||
6, // 9: controller.api.resource.v1.Ec2CatalogDetails.rotate:type_name -> google.protobuf.BoolValue
|
||||
10, // [10:10] is the sub-list for method output_type
|
||||
10, // [10:10] is the sub-list for method input_type
|
||||
10, // [10:10] is the sub-list for extension type_name
|
||||
10, // [10:10] is the sub-list for extension extendee
|
||||
0, // [0:10] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_controller_api_resource_v1_host_catalog_proto_init() }
|
||||
func file_controller_api_resource_v1_host_catalog_proto_init() {
|
||||
if File_controller_api_resource_v1_host_catalog_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_controller_api_resource_v1_host_catalog_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*HostCatalog); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_controller_api_resource_v1_host_catalog_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*StaticCatalogDetails); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_controller_api_resource_v1_host_catalog_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*Ec2CatalogDetails); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_controller_api_resource_v1_host_catalog_proto_msgTypes[0].OneofWrappers = []interface{}{
|
||||
(*HostCatalog_StaticHostCatalogDetails)(nil),
|
||||
(*HostCatalog_Ec2HostCatalogDetails)(nil),
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_controller_api_resource_v1_host_catalog_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 3,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_controller_api_resource_v1_host_catalog_proto_goTypes,
|
||||
DependencyIndexes: file_controller_api_resource_v1_host_catalog_proto_depIdxs,
|
||||
EnumInfos: file_controller_api_resource_v1_host_catalog_proto_enumTypes,
|
||||
MessageInfos: file_controller_api_resource_v1_host_catalog_proto_msgTypes,
|
||||
}.Build()
|
||||
File_controller_api_resource_v1_host_catalog_proto = out.File
|
||||
file_controller_api_resource_v1_host_catalog_proto_rawDesc = nil
|
||||
file_controller_api_resource_v1_host_catalog_proto_goTypes = nil
|
||||
file_controller_api_resource_v1_host_catalog_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,256 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.21.0
|
||||
// protoc v3.11.4
|
||||
// source: controller/api/resource/v1/host_set.proto
|
||||
|
||||
package resource
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
timestamp "github.com/golang/protobuf/ptypes/timestamp"
|
||||
wrappers "github.com/golang/protobuf/ptypes/wrappers"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
// HostSets are a collection of sets created and managed by a catalog.
|
||||
type HostSet struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// Output only.
|
||||
Uri string `protobuf:"bytes,1,opt,name=uri,proto3" json:"uri,omitempty"`
|
||||
FriendlyName *wrappers.StringValue `protobuf:"bytes,2,opt,name=friendly_name,json=friendlyName,proto3" json:"friendly_name,omitempty"`
|
||||
// The time this host_set was created.
|
||||
// Output only.
|
||||
CreatedTime *timestamp.Timestamp `protobuf:"bytes,3,opt,name=created_time,json=createdTime,proto3" json:"created_time,omitempty"`
|
||||
// The time this host_set was last updated.
|
||||
// Output only.
|
||||
UpdatedTime *timestamp.Timestamp `protobuf:"bytes,4,opt,name=updated_time,json=updatedTime,proto3" json:"updated_time,omitempty"`
|
||||
// Marks the host_set as disabled. Default is false.
|
||||
Disabled *wrappers.BoolValue `protobuf:"bytes,5,opt,name=disabled,proto3" json:"disabled,omitempty"`
|
||||
// The total count of hosts in this host set
|
||||
// Output only.
|
||||
Size *wrappers.Int32Value `protobuf:"bytes,6,opt,name=size,proto3" json:"size,omitempty"`
|
||||
// A list of hosts in this host set.
|
||||
// TODO: Figure out if this should be in the basic HostSet view and what view to use on the Hosts.
|
||||
// Output only.
|
||||
Hosts []*Host `protobuf:"bytes,7,rep,name=hosts,proto3" json:"hosts,omitempty"`
|
||||
}
|
||||
|
||||
func (x *HostSet) Reset() {
|
||||
*x = HostSet{}
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_controller_api_resource_v1_host_set_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *HostSet) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*HostSet) ProtoMessage() {}
|
||||
|
||||
func (x *HostSet) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_controller_api_resource_v1_host_set_proto_msgTypes[0]
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use HostSet.ProtoReflect.Descriptor instead.
|
||||
func (*HostSet) Descriptor() ([]byte, []int) {
|
||||
return file_controller_api_resource_v1_host_set_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *HostSet) GetUri() string {
|
||||
if x != nil {
|
||||
return x.Uri
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *HostSet) GetFriendlyName() *wrappers.StringValue {
|
||||
if x != nil {
|
||||
return x.FriendlyName
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HostSet) GetCreatedTime() *timestamp.Timestamp {
|
||||
if x != nil {
|
||||
return x.CreatedTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HostSet) GetUpdatedTime() *timestamp.Timestamp {
|
||||
if x != nil {
|
||||
return x.UpdatedTime
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HostSet) GetDisabled() *wrappers.BoolValue {
|
||||
if x != nil {
|
||||
return x.Disabled
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HostSet) GetSize() *wrappers.Int32Value {
|
||||
if x != nil {
|
||||
return x.Size
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *HostSet) GetHosts() []*Host {
|
||||
if x != nil {
|
||||
return x.Hosts
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
var File_controller_api_resource_v1_host_set_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_controller_api_resource_v1_host_set_proto_rawDesc = []byte{
|
||||
0x0a, 0x29, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69,
|
||||
0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x6f, 0x73,
|
||||
0x74, 0x5f, 0x73, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x1a, 0x63, 0x6f, 0x6e,
|
||||
0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f,
|
||||
0x75, 0x72, 0x63, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
|
||||
0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
|
||||
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x77, 0x72, 0x61, 0x70, 0x70, 0x65,
|
||||
0x72, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x25, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f,
|
||||
0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63,
|
||||
0x65, 0x2f, 0x76, 0x31, 0x2f, 0x68, 0x6f, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
|
||||
0xfd, 0x02, 0x0a, 0x07, 0x48, 0x6f, 0x73, 0x74, 0x53, 0x65, 0x74, 0x12, 0x10, 0x0a, 0x03, 0x75,
|
||||
0x72, 0x69, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x69, 0x12, 0x41, 0x0a,
|
||||
0x0d, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x6c, 0x79, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x53, 0x74, 0x72, 0x69, 0x6e, 0x67, 0x56, 0x61, 0x6c,
|
||||
0x75, 0x65, 0x52, 0x0c, 0x66, 0x72, 0x69, 0x65, 0x6e, 0x64, 0x6c, 0x79, 0x4e, 0x61, 0x6d, 0x65,
|
||||
0x12, 0x3d, 0x0a, 0x0c, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65,
|
||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
|
||||
0x6d, 0x70, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12,
|
||||
0x3d, 0x0a, 0x0c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,
|
||||
0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
|
||||
0x70, 0x52, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x36,
|
||||
0x0a, 0x08, 0x64, 0x69, 0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b,
|
||||
0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x75, 0x66, 0x2e, 0x42, 0x6f, 0x6f, 0x6c, 0x56, 0x61, 0x6c, 0x75, 0x65, 0x52, 0x08, 0x64, 0x69,
|
||||
0x73, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x12, 0x2f, 0x0a, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x18, 0x06,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x49, 0x6e, 0x74, 0x33, 0x32, 0x56, 0x61, 0x6c, 0x75,
|
||||
0x65, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x36, 0x0a, 0x05, 0x68, 0x6f, 0x73, 0x74, 0x73,
|
||||
0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,
|
||||
0x6c, 0x65, 0x72, 0x2e, 0x61, 0x70, 0x69, 0x2e, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
|
||||
0x2e, 0x76, 0x31, 0x2e, 0x48, 0x6f, 0x73, 0x74, 0x52, 0x05, 0x68, 0x6f, 0x73, 0x74, 0x73, 0x42,
|
||||
0x4f, 0x5a, 0x4d, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61,
|
||||
0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70, 0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77,
|
||||
0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f,
|
||||
0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x72,
|
||||
0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x3b, 0x72, 0x65, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
|
||||
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_controller_api_resource_v1_host_set_proto_rawDescOnce sync.Once
|
||||
file_controller_api_resource_v1_host_set_proto_rawDescData = file_controller_api_resource_v1_host_set_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_controller_api_resource_v1_host_set_proto_rawDescGZIP() []byte {
|
||||
file_controller_api_resource_v1_host_set_proto_rawDescOnce.Do(func() {
|
||||
file_controller_api_resource_v1_host_set_proto_rawDescData = protoimpl.X.CompressGZIP(file_controller_api_resource_v1_host_set_proto_rawDescData)
|
||||
})
|
||||
return file_controller_api_resource_v1_host_set_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_controller_api_resource_v1_host_set_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_controller_api_resource_v1_host_set_proto_goTypes = []interface{}{
|
||||
(*HostSet)(nil), // 0: controller.api.resource.v1.HostSet
|
||||
(*wrappers.StringValue)(nil), // 1: google.protobuf.StringValue
|
||||
(*timestamp.Timestamp)(nil), // 2: google.protobuf.Timestamp
|
||||
(*wrappers.BoolValue)(nil), // 3: google.protobuf.BoolValue
|
||||
(*wrappers.Int32Value)(nil), // 4: google.protobuf.Int32Value
|
||||
(*Host)(nil), // 5: controller.api.resource.v1.Host
|
||||
}
|
||||
var file_controller_api_resource_v1_host_set_proto_depIdxs = []int32{
|
||||
1, // 0: controller.api.resource.v1.HostSet.friendly_name:type_name -> google.protobuf.StringValue
|
||||
2, // 1: controller.api.resource.v1.HostSet.created_time:type_name -> google.protobuf.Timestamp
|
||||
2, // 2: controller.api.resource.v1.HostSet.updated_time:type_name -> google.protobuf.Timestamp
|
||||
3, // 3: controller.api.resource.v1.HostSet.disabled:type_name -> google.protobuf.BoolValue
|
||||
4, // 4: controller.api.resource.v1.HostSet.size:type_name -> google.protobuf.Int32Value
|
||||
5, // 5: controller.api.resource.v1.HostSet.hosts:type_name -> controller.api.resource.v1.Host
|
||||
6, // [6:6] is the sub-list for method output_type
|
||||
6, // [6:6] is the sub-list for method input_type
|
||||
6, // [6:6] is the sub-list for extension type_name
|
||||
6, // [6:6] is the sub-list for extension extendee
|
||||
0, // [0:6] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_controller_api_resource_v1_host_set_proto_init() }
|
||||
func file_controller_api_resource_v1_host_set_proto_init() {
|
||||
if File_controller_api_resource_v1_host_set_proto != nil {
|
||||
return
|
||||
}
|
||||
file_controller_api_resource_v1_host_proto_init()
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_controller_api_resource_v1_host_set_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*HostSet); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_controller_api_resource_v1_host_set_proto_rawDesc,
|
||||
NumEnums: 0,
|
||||
NumMessages: 1,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_controller_api_resource_v1_host_set_proto_goTypes,
|
||||
DependencyIndexes: file_controller_api_resource_v1_host_set_proto_depIdxs,
|
||||
MessageInfos: file_controller_api_resource_v1_host_set_proto_msgTypes,
|
||||
}.Build()
|
||||
File_controller_api_resource_v1_host_set_proto = out.File
|
||||
file_controller_api_resource_v1_host_set_proto_rawDesc = nil
|
||||
file_controller_api_resource_v1_host_set_proto_goTypes = nil
|
||||
file_controller_api_resource_v1_host_set_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.21.0
|
||||
// protoc v3.11.4
|
||||
// source: controller/api/view/v1/view.proto
|
||||
|
||||
package view
|
||||
|
||||
import (
|
||||
proto "github.com/golang/protobuf/proto"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
sync "sync"
|
||||
)
|
||||
|
||||
const (
|
||||
// Verify that this generated code is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||
// of the legacy proto package is being used.
|
||||
const _ = proto.ProtoPackageIsVersion4
|
||||
|
||||
type View int32
|
||||
|
||||
const (
|
||||
View_BASIC View = 0
|
||||
View_FULL View = 1
|
||||
)
|
||||
|
||||
// Enum value maps for View.
|
||||
var (
|
||||
View_name = map[int32]string{
|
||||
0: "BASIC",
|
||||
1: "FULL",
|
||||
}
|
||||
View_value = map[string]int32{
|
||||
"BASIC": 0,
|
||||
"FULL": 1,
|
||||
}
|
||||
)
|
||||
|
||||
func (x View) Enum() *View {
|
||||
p := new(View)
|
||||
*p = x
|
||||
return p
|
||||
}
|
||||
|
||||
func (x View) String() string {
|
||||
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
|
||||
}
|
||||
|
||||
func (View) Descriptor() protoreflect.EnumDescriptor {
|
||||
return file_controller_api_view_v1_view_proto_enumTypes[0].Descriptor()
|
||||
}
|
||||
|
||||
func (View) Type() protoreflect.EnumType {
|
||||
return &file_controller_api_view_v1_view_proto_enumTypes[0]
|
||||
}
|
||||
|
||||
func (x View) Number() protoreflect.EnumNumber {
|
||||
return protoreflect.EnumNumber(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use View.Descriptor instead.
|
||||
func (View) EnumDescriptor() ([]byte, []int) {
|
||||
return file_controller_api_view_v1_view_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
var File_controller_api_view_v1_view_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_controller_api_view_v1_view_proto_rawDesc = []byte{
|
||||
0x0a, 0x21, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69,
|
||||
0x2f, 0x76, 0x69, 0x65, 0x77, 0x2f, 0x76, 0x31, 0x2f, 0x76, 0x69, 0x65, 0x77, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x12, 0x16, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c, 0x6c, 0x65, 0x72, 0x2e,
|
||||
0x61, 0x70, 0x69, 0x2e, 0x76, 0x69, 0x65, 0x77, 0x2e, 0x76, 0x31, 0x2a, 0x1b, 0x0a, 0x04, 0x56,
|
||||
0x69, 0x65, 0x77, 0x12, 0x09, 0x0a, 0x05, 0x42, 0x41, 0x53, 0x49, 0x43, 0x10, 0x00, 0x12, 0x08,
|
||||
0x0a, 0x04, 0x46, 0x55, 0x4c, 0x4c, 0x10, 0x01, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68,
|
||||
0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x61, 0x73, 0x68, 0x69, 0x63, 0x6f, 0x72, 0x70,
|
||||
0x2f, 0x77, 0x61, 0x74, 0x63, 0x68, 0x74, 0x6f, 0x77, 0x65, 0x72, 0x2f, 0x69, 0x6e, 0x74, 0x65,
|
||||
0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6e, 0x74, 0x72, 0x6f, 0x6c,
|
||||
0x6c, 0x65, 0x72, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x65, 0x77, 0x3b, 0x76, 0x69, 0x65,
|
||||
0x77, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
file_controller_api_view_v1_view_proto_rawDescOnce sync.Once
|
||||
file_controller_api_view_v1_view_proto_rawDescData = file_controller_api_view_v1_view_proto_rawDesc
|
||||
)
|
||||
|
||||
func file_controller_api_view_v1_view_proto_rawDescGZIP() []byte {
|
||||
file_controller_api_view_v1_view_proto_rawDescOnce.Do(func() {
|
||||
file_controller_api_view_v1_view_proto_rawDescData = protoimpl.X.CompressGZIP(file_controller_api_view_v1_view_proto_rawDescData)
|
||||
})
|
||||
return file_controller_api_view_v1_view_proto_rawDescData
|
||||
}
|
||||
|
||||
var file_controller_api_view_v1_view_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
|
||||
var file_controller_api_view_v1_view_proto_goTypes = []interface{}{
|
||||
(View)(0), // 0: controller.api.view.v1.View
|
||||
}
|
||||
var file_controller_api_view_v1_view_proto_depIdxs = []int32{
|
||||
0, // [0:0] is the sub-list for method output_type
|
||||
0, // [0:0] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
0, // [0:0] is the sub-list for extension extendee
|
||||
0, // [0:0] is the sub-list for field type_name
|
||||
}
|
||||
|
||||
func init() { file_controller_api_view_v1_view_proto_init() }
|
||||
func file_controller_api_view_v1_view_proto_init() {
|
||||
if File_controller_api_view_v1_view_proto != nil {
|
||||
return
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||
RawDescriptor: file_controller_api_view_v1_view_proto_rawDesc,
|
||||
NumEnums: 1,
|
||||
NumMessages: 0,
|
||||
NumExtensions: 0,
|
||||
NumServices: 0,
|
||||
},
|
||||
GoTypes: file_controller_api_view_v1_view_proto_goTypes,
|
||||
DependencyIndexes: file_controller_api_view_v1_view_proto_depIdxs,
|
||||
EnumInfos: file_controller_api_view_v1_view_proto_enumTypes,
|
||||
}.Build()
|
||||
File_controller_api_view_v1_view_proto = out.File
|
||||
file_controller_api_view_v1_view_proto_rawDesc = nil
|
||||
file_controller_api_view_v1_view_proto_goTypes = nil
|
||||
file_controller_api_view_v1_view_proto_depIdxs = nil
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package controller.api.resource.v1;
|
||||
|
||||
option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api/resource;resource";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
|
||||
// Host contains all fields related to a Host resource.
|
||||
message Host {
|
||||
// Output only.
|
||||
string uri = 1;
|
||||
google.protobuf.StringValue friendly_name = 2;
|
||||
|
||||
// The time this host was created.
|
||||
// Output only.
|
||||
google.protobuf.Timestamp created_time = 3;
|
||||
// The time this host was last updated.
|
||||
// Output only.
|
||||
google.protobuf.Timestamp updated_time = 4;
|
||||
|
||||
// Marks the host as disabled. Default is false.
|
||||
google.protobuf.BoolValue disabled = 5;
|
||||
|
||||
// This field is required.
|
||||
google.protobuf.StringValue address = 6;
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package controller.api.resource.v1;
|
||||
|
||||
option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api/resource;resource";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
|
||||
|
||||
enum HostCatalogType {
|
||||
HOST_CATALOG_TYPE_UNSPECIFIED = 0;
|
||||
HOST_CATALOG_TYPE_EC2 = 1;
|
||||
HOST_CATALOG_TYPE_STATIC = 2;
|
||||
}
|
||||
|
||||
// HostCatalog organizes Hosts into HostSets.
|
||||
message HostCatalog {
|
||||
// Output only.
|
||||
string uri = 1;
|
||||
google.protobuf.StringValue friendly_name = 2;
|
||||
|
||||
// The time this host_catalog was created.
|
||||
// Output only.
|
||||
google.protobuf.Timestamp created_time = 3;
|
||||
// The time this host_catalog was last updated.
|
||||
// Output only.
|
||||
google.protobuf.Timestamp updated_time = 4;
|
||||
|
||||
// Marks the host_catalog as disabled. Default is false.
|
||||
google.protobuf.BoolValue disabled = 5;
|
||||
|
||||
oneof type_details {
|
||||
StaticCatalogDetails static_host_catalog_details = 6;
|
||||
Ec2CatalogDetails ec2_host_catalog_details = 7;
|
||||
}
|
||||
|
||||
HostCatalogType type = 8;
|
||||
// TODO: Figure out how to provide relevant information regarding Host and Set lists on a catalog.
|
||||
}
|
||||
|
||||
message StaticCatalogDetails {
|
||||
// nothing here yet.
|
||||
}
|
||||
|
||||
message Ec2CatalogDetails {
|
||||
// The AWS regions from which this catalog will retrieve the EC2 instances.
|
||||
repeated string regions = 1;
|
||||
|
||||
// The access key used for authenticating with AWS when retrieving EC2 instance details.
|
||||
google.protobuf.StringValue access_key = 2;
|
||||
// Input only.
|
||||
google.protobuf.StringValue secret_key = 3;
|
||||
|
||||
// This value will never be returned in a response.
|
||||
google.protobuf.BoolValue rotate = 4;
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package controller.api.resource.v1;
|
||||
|
||||
option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api/resource;resource";
|
||||
|
||||
import "google/protobuf/timestamp.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "controller/api/resource/v1/host.proto";
|
||||
|
||||
// HostSets are a collection of sets created and managed by a catalog.
|
||||
message HostSet {
|
||||
// Output only.
|
||||
string uri = 1;
|
||||
google.protobuf.StringValue friendly_name = 2;
|
||||
|
||||
// The time this host_set was created.
|
||||
// Output only.
|
||||
google.protobuf.Timestamp created_time = 3;
|
||||
// The time this host_set was last updated.
|
||||
// Output only.
|
||||
google.protobuf.Timestamp updated_time = 4;
|
||||
|
||||
// Marks the host_set as disabled. Default is false.
|
||||
google.protobuf.BoolValue disabled = 5;
|
||||
|
||||
// The total count of hosts in this host set
|
||||
// Output only.
|
||||
google.protobuf.Int32Value size = 6;
|
||||
|
||||
// A list of hosts in this host set.
|
||||
// TODO: Figure out if this should be in the basic HostSet view and what view to use on the Hosts.
|
||||
// Output only.
|
||||
repeated Host hosts = 7;
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package controller.api.v1;
|
||||
|
||||
option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api;api";
|
||||
|
||||
message ErrorDetails {
|
||||
string trace_id = 1;
|
||||
string request_id = 2;
|
||||
repeated string request_fields = 3;
|
||||
}
|
||||
|
||||
// Error is returned by the JSON API when an error occurs.
|
||||
message Error {
|
||||
// The HTTP Status code applicable to this error.
|
||||
int32 status = 1;
|
||||
// An application-specific error string.
|
||||
string code = 2;
|
||||
// A human readable explanation specific to this occurrence of the error.
|
||||
string message = 3;
|
||||
// Additional metadata regarding the error. Depending on the error different fields will be populated.
|
||||
ErrorDetails details = 4;
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package controller.api.v1;
|
||||
|
||||
option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api;api";
|
||||
|
||||
import "protoc-gen-swagger/options/annotations.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "controller/api/resource/v1/host_catalog.proto";
|
||||
import "controller/api/view/v1/view.proto";
|
||||
|
||||
service HostCatalogService {
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_tag) = {
|
||||
description: "The host catalog service allows you to get/mutate Host catalogs of every type."
|
||||
};
|
||||
|
||||
// This retrieves the host catalog specified in the request using the basic view.
|
||||
rpc GetHostCatalog(GetHostCatalogRequest) returns (GetHostCatalogResponse) {
|
||||
// Gets the host as specified int he url.
|
||||
option (google.api.http) = {
|
||||
get: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{id}"
|
||||
response_body: "item"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Gets a single HostCatalog"
|
||||
description: "Get's a single Host Catalog with the provided identifier."
|
||||
};
|
||||
}
|
||||
rpc ListHostCatalogs(ListHostCatalogsRequest) returns (ListHostCatalogsResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Gets a list of HostCatalogs"
|
||||
};
|
||||
}
|
||||
rpc CreateHostCatalog(CreateHostCatalogRequest) returns (CreateHostCatalogResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs"
|
||||
body: "item"
|
||||
response_body: "item"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Creates a HostCatalog"
|
||||
description: "Creates a single host catalog under the specified org and project"
|
||||
};
|
||||
}
|
||||
rpc UpdateHostCatalog(UpdateHostCatalogRequest) returns (UpdateHostCatalogResponse) {
|
||||
option (google.api.http) = {
|
||||
patch: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{id}"
|
||||
body: "item"
|
||||
response_body: "item"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Updates a HostCatalog"
|
||||
};
|
||||
}
|
||||
// Deleting a HostCatalog removes all hosts and host sets associated with this Catalog.
|
||||
rpc DeleteHostCatalog(DeleteHostCatalogRequest) returns (DeleteHostCatalogResponse) {
|
||||
option (google.api.http) = {
|
||||
delete: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{id}"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Deletes a HostCatalog"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message GetHostCatalogRequest {
|
||||
string org_id = 1;
|
||||
string project_id = 2;
|
||||
string id = 3;
|
||||
api.view.v1.View view = 4;
|
||||
}
|
||||
|
||||
message GetHostCatalogResponse {
|
||||
api.resource.v1.HostCatalog item = 1;
|
||||
}
|
||||
|
||||
message ListHostCatalogsRequest {
|
||||
string org_id = 1;
|
||||
string project_id = 2;
|
||||
|
||||
api.view.v1.View view = 3;
|
||||
}
|
||||
|
||||
message ListHostCatalogsResponse {
|
||||
repeated api.resource.v1.HostCatalog items = 1;
|
||||
}
|
||||
|
||||
message CreateHostCatalogRequest {
|
||||
string org_id = 1;
|
||||
string project_id = 2;
|
||||
api.resource.v1.HostCatalog item = 3;
|
||||
}
|
||||
|
||||
message CreateHostCatalogResponse {
|
||||
string uri = 1;
|
||||
api.resource.v1.HostCatalog item = 2;
|
||||
}
|
||||
|
||||
message UpdateHostCatalogRequest {
|
||||
string org_id = 1;
|
||||
string project_id = 2;
|
||||
string id = 3;
|
||||
api.resource.v1.HostCatalog item = 4;
|
||||
google.protobuf.FieldMask update_mask = 5;
|
||||
}
|
||||
|
||||
message UpdateHostCatalogResponse {
|
||||
api.resource.v1.HostCatalog item = 1;
|
||||
}
|
||||
|
||||
message DeleteHostCatalogRequest {
|
||||
string org_id = 1;
|
||||
string project_id = 2;
|
||||
string id = 3;
|
||||
}
|
||||
|
||||
message DeleteHostCatalogResponse {
|
||||
bool existed = 1;
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package controller.api.v1;
|
||||
|
||||
option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api;api";
|
||||
|
||||
import "protoc-gen-swagger/options/annotations.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "controller/api/resource/v1/host.proto";
|
||||
import "controller/api/view/v1/view.proto";
|
||||
|
||||
service HostService {
|
||||
// This retrieves the host specified in the request using the basic view.
|
||||
rpc GetHost(GetHostRequest) returns (GetHostResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{host_catalog_id}/hosts/{id}"
|
||||
response_body: "item"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Gets a single Host"
|
||||
};
|
||||
}
|
||||
rpc ListHosts(ListHostsRequest) returns (ListHostsResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{host_catalog_id}/hosts"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "List all Hosts for the specified catalog"
|
||||
};
|
||||
}
|
||||
rpc CreateHost(CreateHostRequest) returns (CreateHostResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{host_catalog_id}/hosts"
|
||||
body: "item"
|
||||
response_body: "item"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Create a single Host"
|
||||
};
|
||||
}
|
||||
rpc UpdateHost(UpdateHostRequest) returns (UpdateHostResponse) {
|
||||
option (google.api.http) = {
|
||||
patch: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{host_catalog_id}/hosts/{id}"
|
||||
body: "item"
|
||||
response_body: "item"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Update a Host"
|
||||
};
|
||||
}
|
||||
rpc DeleteHost(DeleteHostRequest) returns (DeleteHostResponse) {
|
||||
option (google.api.http) = {
|
||||
delete: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{host_catalog_id}/hosts/{id}"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Delete a Host"
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message GetHostRequest {
|
||||
string org_id = 1;
|
||||
string project_id = 2;
|
||||
string host_catalog_id = 3;
|
||||
string id = 4;
|
||||
api.view.v1.View view = 5;
|
||||
}
|
||||
|
||||
message GetHostResponse {
|
||||
api.resource.v1.Host item = 1;
|
||||
}
|
||||
|
||||
message ListHostsRequest {
|
||||
string org_id = 1;
|
||||
string project_id = 2;
|
||||
string host_catalog_id = 3;
|
||||
|
||||
api.view.v1.View view = 4;
|
||||
}
|
||||
|
||||
message ListHostsResponse {
|
||||
repeated api.resource.v1.Host items = 1;
|
||||
}
|
||||
|
||||
message CreateHostRequest {
|
||||
string org_id = 1;
|
||||
string project_id = 2;
|
||||
string host_catalog_id = 3;
|
||||
api.resource.v1.Host item = 4;
|
||||
}
|
||||
|
||||
message CreateHostResponse {
|
||||
string ref = 1;
|
||||
api.resource.v1.Host item = 2;
|
||||
}
|
||||
|
||||
message UpdateHostRequest {
|
||||
string org_id = 1;
|
||||
string project_id = 2;
|
||||
string host_catalog_id = 3;
|
||||
string id = 4;
|
||||
api.resource.v1.Host item = 5;
|
||||
google.protobuf.FieldMask update_mask = 6;
|
||||
}
|
||||
|
||||
message UpdateHostResponse {
|
||||
api.resource.v1.Host item = 1;
|
||||
}
|
||||
|
||||
message DeleteHostRequest {
|
||||
string org_id = 1;
|
||||
string project_id = 2;
|
||||
string host_catalog_id = 3;
|
||||
string id = 4;
|
||||
}
|
||||
|
||||
message DeleteHostResponse {
|
||||
bool existed = 1;
|
||||
}
|
||||
@@ -0,0 +1,179 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package controller.api.v1;
|
||||
|
||||
option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api;api";
|
||||
|
||||
import "protoc-gen-swagger/options/annotations.proto";
|
||||
import "google/api/annotations.proto";
|
||||
import "google/protobuf/field_mask.proto";
|
||||
import "google/protobuf/wrappers.proto";
|
||||
import "controller/api/resource/v1/host_set.proto";
|
||||
import "controller/api/resource/v1/host.proto";
|
||||
import "controller/api/view/v1/view.proto";
|
||||
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_swagger) = {
|
||||
info: {
|
||||
title: "Controller API"
|
||||
version: "0.0.1"
|
||||
description: "API for managing resources associated with Controllers."
|
||||
}
|
||||
schemes: HTTPS
|
||||
schemes: HTTP
|
||||
};
|
||||
|
||||
service HostSetService {
|
||||
// This retrieves the host set specified in the request using the basic view.
|
||||
rpc GetHostSet(GetHostSetRequest) returns (GetHostSetResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{host_catalog_id}/host-sets/{id}"
|
||||
response_body: "item"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Get a single HostSet"
|
||||
};
|
||||
}
|
||||
rpc ListHostSets(ListHostSetsRequest) returns (ListHostSetsResponse) {
|
||||
option (google.api.http) = {
|
||||
get: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{host_catalog_id}/host-sets"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "List all HostSets under the specific catalog"
|
||||
};
|
||||
}
|
||||
rpc CreateHostSet(CreateHostSetRequest) returns (CreateHostSetResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{host_catalog_id}/host-sets"
|
||||
body: "item"
|
||||
response_body: "item"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Create a HostSet"
|
||||
};
|
||||
}
|
||||
rpc UpdateHostSet(UpdateHostSetRequest) returns (UpdateHostSetResponse) {
|
||||
option (google.api.http) = {
|
||||
patch: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{host_catalog_id}/host-sets/{id}"
|
||||
body: "item"
|
||||
response_body: "item"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Update a HostSet"
|
||||
};
|
||||
}
|
||||
rpc DeleteHostSet(DeleteHostSetRequest) returns (DeleteHostSetResponse) {
|
||||
option (google.api.http) = {
|
||||
delete: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{host_catalog_id}/host-sets/{id}"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Delete a HostSet"
|
||||
};
|
||||
}
|
||||
|
||||
rpc AddToHostSet(AddToHostSetRequest) returns (AddToHostSetResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{host_catalog_id}/host-sets/{id}:add-hosts"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Adds existing Hosts to the Host Set"
|
||||
description: "Adds the hosts to this Host Set if possible. All hosts added must be a child of the same host catalog this host set is a child of."
|
||||
};
|
||||
}
|
||||
|
||||
rpc RemoveFromHostSet(RemoveFromHostSetRequest) returns (RemoveFromHostSetResponse) {
|
||||
option (google.api.http) = {
|
||||
post: "/v1/orgs/{org_id}/projects/{project_id}/host-catalogs/{host_catalog_id}/host-sets/{id}:remove-hosts"
|
||||
};
|
||||
option (grpc.gateway.protoc_gen_swagger.options.openapiv2_operation) = {
|
||||
summary: "Removes Hosts to the Host Set"
|
||||
description: "Removes the hosts from this Host Set if present. If it is not present then no action is taken and no error is returned."
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
message GetHostSetRequest {
|
||||
string org_id = 1;
|
||||
string project_id = 2;
|
||||
string host_catalog_id = 3;
|
||||
string id = 4;
|
||||
api.view.v1.View view = 5;
|
||||
}
|
||||
|
||||
message GetHostSetResponse {
|
||||
api.resource.v1.HostSet item = 1;
|
||||
}
|
||||
|
||||
message ListHostSetsRequest {
|
||||
string org_id = 1;
|
||||
string project_id = 2;
|
||||
string host_catalog_id = 3;
|
||||
api.view.v1.View view = 4;
|
||||
}
|
||||
|
||||
message ListHostSetsResponse {
|
||||
repeated api.resource.v1.HostSet items = 1;
|
||||
}
|
||||
|
||||
message CreateHostSetRequest {
|
||||
string org_id = 1;
|
||||
string project_id = 2;
|
||||
string host_catalog_id = 3;
|
||||
api.resource.v1.HostSet item = 4;
|
||||
}
|
||||
|
||||
message CreateHostSetResponse {
|
||||
string uri = 1;
|
||||
api.resource.v1.HostSet item = 2;
|
||||
}
|
||||
|
||||
message UpdateHostSetRequest {
|
||||
string org_id = 1;
|
||||
string project_id = 2;
|
||||
string host_catalog_id = 3;
|
||||
string id = 4;
|
||||
api.resource.v1.HostSet item = 5;
|
||||
google.protobuf.FieldMask update_mask = 6;
|
||||
}
|
||||
|
||||
message UpdateHostSetResponse {
|
||||
api.resource.v1.HostSet item = 1;
|
||||
}
|
||||
|
||||
message DeleteHostSetRequest {
|
||||
string org_id = 1;
|
||||
string project_id =2;
|
||||
string host_catalog_id = 3;
|
||||
string id = 4;
|
||||
}
|
||||
|
||||
message DeleteHostSetResponse {
|
||||
bool existed = 1;
|
||||
}
|
||||
|
||||
message AddToHostSetRequest {
|
||||
string org_id = 1;
|
||||
string project_id =2;
|
||||
string host_catalog_id = 3;
|
||||
string id = 4;
|
||||
|
||||
// A list of host uris which will be added to this host set. Each host referenced here must be a child of the
|
||||
// same host catalog that this host set is a child of.
|
||||
repeated string host_uris = 5;
|
||||
}
|
||||
|
||||
message AddToHostSetResponse {
|
||||
}
|
||||
|
||||
message RemoveFromHostSetRequest {
|
||||
string org_id = 1;
|
||||
string project_id =2;
|
||||
string host_catalog_id = 3;
|
||||
// This host set's id.
|
||||
string id = 4;
|
||||
|
||||
// A list of host uris which should not be in the host set when this request returns.
|
||||
repeated string host_uris = 5;
|
||||
}
|
||||
|
||||
message RemoveFromHostSetResponse {
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package controller.api.view.v1;
|
||||
option go_package = "github.com/hashicorp/watchtower/internal/gen/controller/api/view;view";
|
||||
|
||||
// Note: This does not follow any of the good proto practices of using enums (allowing 0 represent unspecified, etc.)
|
||||
// This is designed this way in order to generate cleaner and easier to understand swagger.
|
||||
|
||||
enum View {
|
||||
BASIC = 0;
|
||||
FULL = 1;
|
||||
}
|
||||
@@ -5,8 +5,13 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/grpc-ecosystem/grpc-gateway/runtime"
|
||||
"github.com/hashicorp/vault/internalshared/configutil"
|
||||
"github.com/hashicorp/watchtower/globals"
|
||||
"github.com/hashicorp/watchtower/internal/gen/controller/api"
|
||||
"github.com/hashicorp/watchtower/internal/servers/controller/handlers/host_catalogs"
|
||||
"github.com/hashicorp/watchtower/internal/servers/controller/handlers/host_sets"
|
||||
"github.com/hashicorp/watchtower/internal/servers/controller/handlers/hosts"
|
||||
)
|
||||
|
||||
type HandlerProperties struct {
|
||||
@@ -15,25 +20,28 @@ type HandlerProperties struct {
|
||||
|
||||
// Handler returns an http.Handler for the API. This can be used on
|
||||
// its own to mount the Vault API within another web server.
|
||||
func (c *Controller) Handler(props HandlerProperties) http.Handler {
|
||||
func Handler(props HandlerProperties) http.Handler {
|
||||
// Create the muxer to handle the actual endpoints
|
||||
mux := http.NewServeMux()
|
||||
|
||||
mux.Handle("/v1/", handleDummy())
|
||||
mux.Handle("/v1/", handleGrpcGateway())
|
||||
|
||||
genericWrappedHandler := c.wrapGenericHandler(mux, props)
|
||||
genericWrappedHandler := wrapGenericHandler(mux, props)
|
||||
|
||||
return genericWrappedHandler
|
||||
}
|
||||
|
||||
func handleDummy() http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
w.Write([]byte(`{"foo": "bar"}`))
|
||||
})
|
||||
func handleGrpcGateway() http.Handler {
|
||||
ignored := context.Background()
|
||||
mux := runtime.NewServeMux()
|
||||
api.RegisterHostCatalogServiceHandlerServer(ignored, mux, &host_catalogs.Service{})
|
||||
api.RegisterHostSetServiceHandlerServer(ignored, mux, &host_sets.Service{})
|
||||
api.RegisterHostServiceHandlerServer(ignored, mux, &hosts.Service{})
|
||||
|
||||
return mux
|
||||
}
|
||||
|
||||
func (c *Controller) wrapGenericHandler(h http.Handler, props HandlerProperties) http.Handler {
|
||||
func wrapGenericHandler(h http.Handler, props HandlerProperties) http.Handler {
|
||||
var maxRequestDuration time.Duration
|
||||
var maxRequestSize int64
|
||||
if props.ListenerConfig != nil {
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
package controller
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestHandleGrpcGateway(t *testing.T) {
|
||||
h := Handler(HandlerProperties{})
|
||||
l, err := net.Listen("tcp4", "127.0.0.1:0")
|
||||
if err != nil {
|
||||
t.Fatalf("Couldn't listen: %v", err)
|
||||
}
|
||||
defer l.Close()
|
||||
go func() {
|
||||
http.Serve(l, h)
|
||||
}()
|
||||
|
||||
cases := []struct {
|
||||
name string
|
||||
path string
|
||||
code int
|
||||
}{
|
||||
{
|
||||
"Non existent path",
|
||||
"v1/this-is-made-up",
|
||||
http.StatusNotFound,
|
||||
},
|
||||
{
|
||||
"Unimplemented path",
|
||||
"v1/org/1/projects/2/host-catalogs/3/host-sets/4",
|
||||
http.StatusNotImplemented,
|
||||
},
|
||||
{
|
||||
// TODO: This will need to be updated or removed when we are actually checking the existence of org and
|
||||
// project's since this path shouldn't actually map to anything yet. This simply checks to confirm some
|
||||
// routing is happening.
|
||||
"Implemented path",
|
||||
"v1/org/1/projects/2/host-catalogs",
|
||||
http.StatusOK,
|
||||
},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
url := fmt.Sprintf("http://%s/%s", l.Addr(), tc.path)
|
||||
resp, err := http.Get(url)
|
||||
if err != nil {
|
||||
t.Errorf("Got error: %v when non was expected.", err)
|
||||
}
|
||||
if got, want := resp.StatusCode, tc.code; got != want {
|
||||
t.Errorf("GET on %q got code %d, wanted %d", tc.path, got, want)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package host_catalogs
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/watchtower/internal/gen/controller/api"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
*api.UnimplementedHostCatalogServiceServer
|
||||
}
|
||||
|
||||
func (s Service) ListHostCatalogs(ctx context.Context, req *api.ListHostCatalogsRequest) (*api.ListHostCatalogsResponse, error) {
|
||||
return nil, status.Errorf(codes.NotFound, "Org %q not found", req.OrgId)
|
||||
}
|
||||
|
||||
func (s Service) DeleteHostCatalog(ctx context.Context, req *api.DeleteHostCatalogRequest) (*api.DeleteHostCatalogResponse, error) {
|
||||
return &api.DeleteHostCatalogResponse{Existed: false}, nil
|
||||
}
|
||||
|
||||
var _ api.HostCatalogServiceServer = &Service{}
|
||||
@@ -0,0 +1,48 @@
|
||||
package host_catalogs_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/hashicorp/watchtower/internal/gen/controller/api"
|
||||
"github.com/hashicorp/watchtower/internal/servers/controller/handlers/host_catalogs"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
func TestDelete(t *testing.T) {
|
||||
toMerge := &api.DeleteHostCatalogRequest{
|
||||
OrgId: "1",
|
||||
ProjectId: "2",
|
||||
Id: "3",
|
||||
}
|
||||
|
||||
s := host_catalogs.Service{}
|
||||
cases := []struct {
|
||||
name string
|
||||
req *api.DeleteHostCatalogRequest
|
||||
res *api.DeleteHostCatalogResponse
|
||||
errCode codes.Code
|
||||
}{
|
||||
{
|
||||
name: "Delete always succeeds even for non existant catalogs",
|
||||
req: &api.DeleteHostCatalogRequest{Id: "This doesn't exist."},
|
||||
res: &api.DeleteHostCatalogResponse{},
|
||||
errCode: codes.OK,
|
||||
},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
req := proto.Clone(toMerge).(*api.DeleteHostCatalogRequest)
|
||||
proto.Merge(req, tc.req)
|
||||
got, gErr := s.DeleteHostCatalog(context.Background(), req)
|
||||
if status.Code(gErr) != tc.errCode {
|
||||
t.Errorf("DeleteHostCatalog(%+v) got error %v, wanted %v", req, gErr, tc.errCode)
|
||||
}
|
||||
if !proto.Equal(got, tc.res) {
|
||||
t.Errorf("DeleteHostCatalog(%q) got response %q, wanted %q", req, got, tc.res)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package host_sets
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/watchtower/internal/gen/controller/api"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
*api.UnimplementedHostSetServiceServer
|
||||
}
|
||||
|
||||
func (s Service) ListHostSets(ctx context.Context, req *api.ListHostSetsRequest) (*api.ListHostSetsResponse, error) {
|
||||
return nil, status.Errorf(codes.NotFound, "Org %q not found", req.OrgId)
|
||||
}
|
||||
|
||||
func (s Service) DeleteHostSet(context.Context, *api.DeleteHostSetRequest) (*api.DeleteHostSetResponse, error) {
|
||||
return &api.DeleteHostSetResponse{Existed: false}, nil
|
||||
}
|
||||
|
||||
var _ api.HostSetServiceServer = &Service{}
|
||||
@@ -0,0 +1,49 @@
|
||||
package host_sets_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/hashicorp/watchtower/internal/gen/controller/api"
|
||||
"github.com/hashicorp/watchtower/internal/servers/controller/handlers/host_sets"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
func TestDelete(t *testing.T) {
|
||||
toMerge := &api.DeleteHostSetRequest{
|
||||
OrgId: "1",
|
||||
ProjectId: "2",
|
||||
HostCatalogId: "3",
|
||||
Id: "4",
|
||||
}
|
||||
|
||||
s := host_sets.Service{}
|
||||
cases := []struct {
|
||||
name string
|
||||
req *api.DeleteHostSetRequest
|
||||
res *api.DeleteHostSetResponse
|
||||
errCode codes.Code
|
||||
}{
|
||||
{
|
||||
name: "Delete succeeds even for non existing resources",
|
||||
req: &api.DeleteHostSetRequest{Id: "this doesn't exist"},
|
||||
res: &api.DeleteHostSetResponse{},
|
||||
errCode: codes.OK,
|
||||
},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
req := proto.Clone(toMerge).(*api.DeleteHostSetRequest)
|
||||
proto.Merge(req, tc.req)
|
||||
got, gErr := s.DeleteHostSet(context.Background(), req)
|
||||
if status.Code(gErr) != tc.errCode {
|
||||
t.Errorf("DeleteHostSet(%+v) got error %v, wanted %v", req, gErr, tc.errCode)
|
||||
}
|
||||
if !proto.Equal(got, tc.res) {
|
||||
t.Errorf("DeleteHostSet(%q) got response %q, wanted %q", req, got, tc.res)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
package hosts
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/watchtower/internal/gen/controller/api"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
type Service struct {
|
||||
*api.UnimplementedHostServiceServer
|
||||
}
|
||||
|
||||
func (s Service) ListHosts(ctx context.Context, req *api.ListHostsRequest) (*api.ListHostsResponse, error) {
|
||||
return nil, status.Errorf(codes.NotFound, "Org %q not found", req.OrgId)
|
||||
}
|
||||
|
||||
func (s Service) DeleteHost(context.Context, *api.DeleteHostRequest) (*api.DeleteHostResponse, error) {
|
||||
return &api.DeleteHostResponse{}, nil
|
||||
}
|
||||
|
||||
var _ api.HostServiceServer = &Service{}
|
||||
@@ -0,0 +1,182 @@
|
||||
package hosts_test
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/golang/protobuf/proto"
|
||||
"github.com/hashicorp/watchtower/internal/gen/controller/api"
|
||||
"github.com/hashicorp/watchtower/internal/servers/controller/handlers/hosts"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
func TestDelete(t *testing.T) {
|
||||
toMerge := &api.DeleteHostRequest{
|
||||
OrgId: "1",
|
||||
ProjectId: "2",
|
||||
HostCatalogId: "3",
|
||||
Id: "4",
|
||||
}
|
||||
|
||||
s := hosts.Service{}
|
||||
cases := []struct {
|
||||
name string
|
||||
req *api.DeleteHostRequest
|
||||
res *api.DeleteHostResponse
|
||||
errCode codes.Code
|
||||
}{
|
||||
{
|
||||
name: "Success even when doesn't exist",
|
||||
req: &api.DeleteHostRequest{},
|
||||
res: &api.DeleteHostResponse{},
|
||||
errCode: codes.OK,
|
||||
},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
req := proto.Clone(toMerge).(*api.DeleteHostRequest)
|
||||
proto.Merge(req, tc.req)
|
||||
got, gErr := s.DeleteHost(context.Background(), req)
|
||||
|
||||
if status.Code(gErr) != tc.errCode {
|
||||
t.Errorf("DeleteHost(%+v) got error %v, wanted %v", req, gErr, tc.errCode)
|
||||
}
|
||||
|
||||
if !proto.Equal(got, tc.res) {
|
||||
t.Errorf("DeleteHost(%q) got response %q, wanted %q", req, got, tc.res)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestList(t *testing.T) {
|
||||
toMerge := &api.ListHostsRequest{
|
||||
OrgId: "1",
|
||||
ProjectId: "2",
|
||||
HostCatalogId: "3",
|
||||
}
|
||||
|
||||
s := hosts.Service{}
|
||||
cases := []struct {
|
||||
name string
|
||||
req *api.ListHostsRequest
|
||||
res *api.ListHostsResponse
|
||||
errCode codes.Code
|
||||
}{
|
||||
{
|
||||
name: "List from a valid catalog id",
|
||||
req: &api.ListHostsRequest{},
|
||||
// TODO: Update this when the List method is implemented
|
||||
res: nil,
|
||||
errCode: codes.NotFound,
|
||||
},
|
||||
{
|
||||
name: "Non Existant Host Catalog",
|
||||
req: &api.ListHostsRequest{HostCatalogId: "this doesnt exist"},
|
||||
res: nil,
|
||||
errCode: codes.NotFound,
|
||||
},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
req := proto.Clone(toMerge).(*api.ListHostsRequest)
|
||||
proto.Merge(req, tc.req)
|
||||
got, gErr := s.ListHosts(context.Background(), req)
|
||||
if status.Code(gErr) != tc.errCode {
|
||||
t.Errorf("ListHosts(%+v) got error %v, wanted %v", req, gErr, tc.errCode)
|
||||
}
|
||||
if !proto.Equal(got, tc.res) {
|
||||
t.Errorf("ListHosts(%q) got response %q, wanted %q", req, got, tc.res)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestGet(t *testing.T) {
|
||||
toMerge := &api.GetHostRequest{
|
||||
OrgId: "1",
|
||||
ProjectId: "2",
|
||||
HostCatalogId: "3",
|
||||
}
|
||||
|
||||
s := hosts.Service{}
|
||||
cases := []struct {
|
||||
name string
|
||||
req *api.GetHostRequest
|
||||
res *api.GetHostResponse
|
||||
errCode codes.Code
|
||||
}{
|
||||
// TODO: These cases need to be updated as the handlers get implemented.
|
||||
{
|
||||
name: "Default request",
|
||||
req: &api.GetHostRequest{},
|
||||
res: nil,
|
||||
errCode: codes.Unimplemented,
|
||||
},
|
||||
{
|
||||
name: "Non Existant Host Catalog",
|
||||
req: &api.GetHostRequest{HostCatalogId: "this doesnt exist"},
|
||||
// The response and error will need to change when this is implemented to be a 404 error
|
||||
res: nil,
|
||||
errCode: codes.Unimplemented,
|
||||
},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
req := proto.Clone(toMerge).(*api.GetHostRequest)
|
||||
proto.Merge(req, tc.req)
|
||||
got, gErr := s.GetHost(context.Background(), req)
|
||||
if status.Code(gErr) != tc.errCode {
|
||||
t.Errorf("ListHosts(%+v) got error %v, wanted %v", req, gErr, tc.errCode)
|
||||
}
|
||||
if !proto.Equal(got, tc.res) {
|
||||
t.Errorf("ListHosts(%q) got response %q, wanted %q", req, got, tc.res)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestUpdate(t *testing.T) {
|
||||
toMerge := &api.UpdateHostRequest{
|
||||
OrgId: "1",
|
||||
ProjectId: "2",
|
||||
HostCatalogId: "3",
|
||||
}
|
||||
|
||||
s := hosts.Service{}
|
||||
cases := []struct {
|
||||
name string
|
||||
req *api.UpdateHostRequest
|
||||
res *api.UpdateHostResponse
|
||||
errCode codes.Code
|
||||
}{
|
||||
// TODO: These cases need to be updated as the handlers get implemented.
|
||||
{
|
||||
name: "Default request",
|
||||
req: &api.UpdateHostRequest{},
|
||||
res: nil,
|
||||
errCode: codes.Unimplemented,
|
||||
},
|
||||
{
|
||||
name: "Non Existant Host Catalog",
|
||||
req: &api.UpdateHostRequest{HostCatalogId: "this doesnt exist"},
|
||||
// The response and error will need to change when this is implemented to be a 404 error
|
||||
res: nil,
|
||||
errCode: codes.Unimplemented,
|
||||
},
|
||||
}
|
||||
for _, tc := range cases {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
req := proto.Clone(toMerge).(*api.UpdateHostRequest)
|
||||
proto.Merge(req, tc.req)
|
||||
got, gErr := s.UpdateHost(context.Background(), req)
|
||||
if status.Code(gErr) != tc.errCode {
|
||||
t.Errorf("UpdateHost(%+v) got error %v, wanted %v", req, gErr, tc.errCode)
|
||||
}
|
||||
if !proto.Equal(got, tc.res) {
|
||||
t.Errorf("UpdateHost(%q) got response %q, wanted %q", req, got, tc.res)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
@@ -21,7 +21,7 @@ func (c *Controller) startListeners() error {
|
||||
servers := make([]func(), 0, len(c.conf.Listeners))
|
||||
|
||||
configureForAPI := func(ln *base.ServerListener) error {
|
||||
handler := c.Handler(HandlerProperties{
|
||||
handler := Handler(HandlerProperties{
|
||||
ListenerConfig: ln.Config,
|
||||
})
|
||||
|
||||
|
||||
+25
-15
@@ -1,22 +1,32 @@
|
||||
// +build tools
|
||||
|
||||
// This file ensures tool dependencies are kept in sync. This is the recommended way of doing this according to
|
||||
// This file ensures tool dependencies are kept in sync. This is the
|
||||
// recommended way of doing this according to
|
||||
// https://github.com/golang/go/wiki/Modules#how-can-i-track-tool-dependencies-for-a-module
|
||||
// To update the versions used by this repo use:
|
||||
// $ go mod tidy
|
||||
// To install the following tools at the version used by this repo run:
|
||||
// $ go install (each of the dependencies listed below)
|
||||
// $ make bootstrap
|
||||
// or
|
||||
// $ go generate -tags tools tools/tools.go
|
||||
|
||||
package tools
|
||||
|
||||
import (
|
||||
_ "github.com/bufbuild/buf/cmd/buf"
|
||||
_ "github.com/favadi/protoc-go-inject-tag"
|
||||
_ "github.com/go-swagger/go-swagger/cmd/swagger"
|
||||
// use this instead of google.golang.org/protobuf/cmd/protoc-gen-go since this supports grpc plugin while the other does not.
|
||||
// see https://github.com/golang/protobuf/releases#v1.4-generated-code and
|
||||
// https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.20.0#v1.20-grpc-support
|
||||
_ "github.com/golang/protobuf/protoc-gen-go"
|
||||
_ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway"
|
||||
_ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger"
|
||||
)
|
||||
//go:generate go install github.com/bufbuild/buf/cmd/buf
|
||||
import _ "github.com/bufbuild/buf/cmd/buf"
|
||||
|
||||
//go:generate go install github.com/go-swagger/go-swagger/cmd/swagger
|
||||
import _ "github.com/go-swagger/go-swagger/cmd/swagger"
|
||||
|
||||
//go:generate go install github.com/favadi/protoc-go-inject-tag
|
||||
import _ "github.com/favadi/protoc-go-inject-tag"
|
||||
|
||||
// use this instead of google.golang.org/protobuf/cmd/protoc-gen-go since this supports grpc plugin while the other does not.
|
||||
// see https://github.com/golang/protobuf/releases#v1.4-generated-code and
|
||||
// https://github.com/protocolbuffers/protobuf-go/releases/tag/v1.20.0#v1.20-grpc-support
|
||||
//go:generate go install github.com/golang/protobuf/protoc-gen-go
|
||||
import _ "github.com/golang/protobuf/protoc-gen-go"
|
||||
|
||||
//go:generate go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway
|
||||
import _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway"
|
||||
|
||||
//go:generate go install github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger
|
||||
import _ "github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger"
|
||||
Reference in new issue
Block a user