Migrate target host sets -> host sources (#1424)

This follows the same model as https://github.com/hashicorp/boundary/pull/1413

See there and CHANGELOG for more details.
This commit is contained in:
Jeff Mitchell authored and GitHub committed 2021-07-30 08:48:03 -04:00
1 parent 6b78108ecf
commit f8a51b987c
39 files changed
+3385 -964

No files matched your search

File diff suppressed because it is too large. Load diff
@@ -577,6 +577,210 @@ func local_request_TargetService_RemoveTargetHostSets_0(ctx context.Context, mar
}
func request_TargetService_AddTargetHostSources_0(ctx context.Context, marshaler runtime.Marshaler, client TargetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq AddTargetHostSourcesRequest
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); 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["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.AddTargetHostSources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_TargetService_AddTargetHostSources_0(ctx context.Context, marshaler runtime.Marshaler, server TargetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq AddTargetHostSourcesRequest
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); 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["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.AddTargetHostSources(ctx, &protoReq)
return msg, metadata, err
}
func request_TargetService_SetTargetHostSources_0(ctx context.Context, marshaler runtime.Marshaler, client TargetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq SetTargetHostSourcesRequest
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); 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["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.SetTargetHostSources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_TargetService_SetTargetHostSources_0(ctx context.Context, marshaler runtime.Marshaler, server TargetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq SetTargetHostSourcesRequest
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); 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["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.SetTargetHostSources(ctx, &protoReq)
return msg, metadata, err
}
func request_TargetService_RemoveTargetHostSources_0(ctx context.Context, marshaler runtime.Marshaler, client TargetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq RemoveTargetHostSourcesRequest
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); 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["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.RemoveTargetHostSources(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_TargetService_RemoveTargetHostSources_0(ctx context.Context, marshaler runtime.Marshaler, server TargetServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq RemoveTargetHostSourcesRequest
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); 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["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.RemoveTargetHostSources(ctx, &protoReq)
return msg, metadata, err
}
func request_TargetService_AddTargetCredentialLibraries_0(ctx context.Context, marshaler runtime.Marshaler, client TargetServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq AddTargetCredentialLibrariesRequest
var metadata runtime.ServerMetadata
@@ -1198,6 +1402,75 @@ func RegisterTargetServiceHandlerServer(ctx context.Context, mux *runtime.ServeM
})
mux.Handle("POST", pattern_TargetService_AddTargetHostSources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/controller.api.services.v1.TargetService/AddTargetHostSources")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_TargetService_AddTargetHostSources_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_TargetService_AddTargetHostSources_0(ctx, mux, outboundMarshaler, w, req, response_TargetService_AddTargetHostSources_0{resp}, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_TargetService_SetTargetHostSources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/controller.api.services.v1.TargetService/SetTargetHostSources")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_TargetService_SetTargetHostSources_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_TargetService_SetTargetHostSources_0(ctx, mux, outboundMarshaler, w, req, response_TargetService_SetTargetHostSources_0{resp}, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_TargetService_RemoveTargetHostSources_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
rctx, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/controller.api.services.v1.TargetService/RemoveTargetHostSources")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_TargetService_RemoveTargetHostSources_0(rctx, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_TargetService_RemoveTargetHostSources_0(ctx, mux, outboundMarshaler, w, req, response_TargetService_RemoveTargetHostSources_0{resp}, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_TargetService_AddTargetCredentialLibraries_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1557,6 +1830,66 @@ func RegisterTargetServiceHandlerClient(ctx context.Context, mux *runtime.ServeM
})
mux.Handle("POST", pattern_TargetService_AddTargetHostSources_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, "/controller.api.services.v1.TargetService/AddTargetHostSources")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_TargetService_AddTargetHostSources_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_TargetService_AddTargetHostSources_0(ctx, mux, outboundMarshaler, w, req, response_TargetService_AddTargetHostSources_0{resp}, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_TargetService_SetTargetHostSources_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, "/controller.api.services.v1.TargetService/SetTargetHostSources")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_TargetService_SetTargetHostSources_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_TargetService_SetTargetHostSources_0(ctx, mux, outboundMarshaler, w, req, response_TargetService_SetTargetHostSources_0{resp}, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_TargetService_RemoveTargetHostSources_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, "/controller.api.services.v1.TargetService/RemoveTargetHostSources")
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_TargetService_RemoveTargetHostSources_0(rctx, inboundMarshaler, client, req, pathParams)
ctx = runtime.NewServerMetadataContext(ctx, md)
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
forward_TargetService_RemoveTargetHostSources_0(ctx, mux, outboundMarshaler, w, req, response_TargetService_RemoveTargetHostSources_0{resp}, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_TargetService_AddTargetCredentialLibraries_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -1743,6 +2076,33 @@ func (m response_TargetService_RemoveTargetHostSets_0) XXX_ResponseBody() interf
return response.Item
}
type response_TargetService_AddTargetHostSources_0 struct {
proto.Message
}
func (m response_TargetService_AddTargetHostSources_0) XXX_ResponseBody() interface{} {
response := m.Message.(*AddTargetHostSourcesResponse)
return response.Item
}
type response_TargetService_SetTargetHostSources_0 struct {
proto.Message
}
func (m response_TargetService_SetTargetHostSources_0) XXX_ResponseBody() interface{} {
response := m.Message.(*SetTargetHostSourcesResponse)
return response.Item
}
type response_TargetService_RemoveTargetHostSources_0 struct {
proto.Message
}
func (m response_TargetService_RemoveTargetHostSources_0) XXX_ResponseBody() interface{} {
response := m.Message.(*RemoveTargetHostSourcesResponse)
return response.Item
}
type response_TargetService_AddTargetCredentialLibraries_0 struct {
proto.Message
}
@@ -1816,6 +2176,12 @@ var (
pattern_TargetService_RemoveTargetHostSets_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "targets", "id"}, "remove-host-sets"))
pattern_TargetService_AddTargetHostSources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "targets", "id"}, "add-host-sources"))
pattern_TargetService_SetTargetHostSources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "targets", "id"}, "set-host-sources"))
pattern_TargetService_RemoveTargetHostSources_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "targets", "id"}, "remove-host-sources"))
pattern_TargetService_AddTargetCredentialLibraries_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "targets", "id"}, "add-credential-libraries"))
pattern_TargetService_SetTargetCredentialLibraries_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "targets", "id"}, "set-credential-libraries"))
@@ -1848,6 +2214,12 @@ var (
forward_TargetService_RemoveTargetHostSets_0 = runtime.ForwardResponseMessage
forward_TargetService_AddTargetHostSources_0 = runtime.ForwardResponseMessage
forward_TargetService_SetTargetHostSources_0 = runtime.ForwardResponseMessage
forward_TargetService_RemoveTargetHostSources_0 = runtime.ForwardResponseMessage
forward_TargetService_AddTargetCredentialLibraries_0 = runtime.ForwardResponseMessage
forward_TargetService_SetTargetCredentialLibraries_0 = runtime.ForwardResponseMessage
@@ -71,6 +71,29 @@ type TargetServiceClient interface {
// returned. An error is returned if a Host Set is attempted to be
// removed from the Target when the Target does not have the Host Set.
RemoveTargetHostSets(ctx context.Context, in *RemoveTargetHostSetsRequest, opts ...grpc.CallOption) (*RemoveTargetHostSetsResponse, error)
// AddTargetHostSources adds Host Sources to this Target. The provided request
// must include the Target ID to which the Host Sources will be added. All
// Host Sources added to the provided Target must be a child of a Catalog that
// is a child of the same scope as this Target. If the scope or Target IDs are
// missing, malformed, or reference non-existing resources, an error is
// returned. An error is returned if a Host Source is attempted to be added to a
// target that is already present on the Target.
AddTargetHostSources(ctx context.Context, in *AddTargetHostSourcesRequest, opts ...grpc.CallOption) (*AddTargetHostSourcesResponse, error)
// SetTargetHostSources sets the Target's Host Sources. Any existing Host
// Sources on the Target are deleted if they are not included in this request.
// The provided request must include the scope, and the Target ID on which the
// Host Sources will be set. All Host Sources in the request must be a child
// of a Catalog that is in the same scope as the provided Target. If any IDs
// are missing, malformed, or references a non-existing resource, an error is
// returned.
SetTargetHostSources(ctx context.Context, in *SetTargetHostSourcesRequest, opts ...grpc.CallOption) (*SetTargetHostSourcesResponse, error)
// RemoveTargetHostSources removes the Host Sources from the specified Target.
// The provided request must include the Target ID for the Target from which
// the Host Sources will be removed. If the ID is missing, malformed, or
// references a non-existing scope or Catalog, an error is returned. An error
// is returned if a Host Source is attempted to be removed from the Target
// when the Target does not have the Host Set.
RemoveTargetHostSources(ctx context.Context, in *RemoveTargetHostSourcesRequest, opts ...grpc.CallOption) (*RemoveTargetHostSourcesResponse, error)
// Deprecated: Do not use.
// AddTargetCredentialLibraries adds Credential Libraries to this Target.
// The provided request must include the Target ID to which the Credential
@@ -119,7 +142,7 @@ type TargetServiceClient interface {
// specified Target. The provided request must include the Target ID for the
// Target from which the Credential Sources will be removed. If the ID is
// missing, or malformed, an error is returned. An error is returned if a
// Credential Library is attempted to be removed from the Target when the
// Credential Source is attempted to be removed from the Target when the
// Target does not have the Credential Source.
RemoveTargetCredentialSources(ctx context.Context, in *RemoveTargetCredentialSourcesRequest, opts ...grpc.CallOption) (*RemoveTargetCredentialSourcesResponse, error)
}
@@ -213,6 +236,33 @@ func (c *targetServiceClient) RemoveTargetHostSets(ctx context.Context, in *Remo
return out, nil
}
func (c *targetServiceClient) AddTargetHostSources(ctx context.Context, in *AddTargetHostSourcesRequest, opts ...grpc.CallOption) (*AddTargetHostSourcesResponse, error) {
out := new(AddTargetHostSourcesResponse)
err := c.cc.Invoke(ctx, "/controller.api.services.v1.TargetService/AddTargetHostSources", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *targetServiceClient) SetTargetHostSources(ctx context.Context, in *SetTargetHostSourcesRequest, opts ...grpc.CallOption) (*SetTargetHostSourcesResponse, error) {
out := new(SetTargetHostSourcesResponse)
err := c.cc.Invoke(ctx, "/controller.api.services.v1.TargetService/SetTargetHostSources", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *targetServiceClient) RemoveTargetHostSources(ctx context.Context, in *RemoveTargetHostSourcesRequest, opts ...grpc.CallOption) (*RemoveTargetHostSourcesResponse, error) {
out := new(RemoveTargetHostSourcesResponse)
err := c.cc.Invoke(ctx, "/controller.api.services.v1.TargetService/RemoveTargetHostSources", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Deprecated: Do not use.
func (c *targetServiceClient) AddTargetCredentialLibraries(ctx context.Context, in *AddTargetCredentialLibrariesRequest, opts ...grpc.CallOption) (*AddTargetCredentialLibrariesResponse, error) {
out := new(AddTargetCredentialLibrariesResponse)
@@ -327,6 +377,29 @@ type TargetServiceServer interface {
// returned. An error is returned if a Host Set is attempted to be
// removed from the Target when the Target does not have the Host Set.
RemoveTargetHostSets(context.Context, *RemoveTargetHostSetsRequest) (*RemoveTargetHostSetsResponse, error)
// AddTargetHostSources adds Host Sources to this Target. The provided request
// must include the Target ID to which the Host Sources will be added. All
// Host Sources added to the provided Target must be a child of a Catalog that
// is a child of the same scope as this Target. If the scope or Target IDs are
// missing, malformed, or reference non-existing resources, an error is
// returned. An error is returned if a Host Source is attempted to be added to a
// target that is already present on the Target.
AddTargetHostSources(context.Context, *AddTargetHostSourcesRequest) (*AddTargetHostSourcesResponse, error)
// SetTargetHostSources sets the Target's Host Sources. Any existing Host
// Sources on the Target are deleted if they are not included in this request.
// The provided request must include the scope, and the Target ID on which the
// Host Sources will be set. All Host Sources in the request must be a child
// of a Catalog that is in the same scope as the provided Target. If any IDs
// are missing, malformed, or references a non-existing resource, an error is
// returned.
SetTargetHostSources(context.Context, *SetTargetHostSourcesRequest) (*SetTargetHostSourcesResponse, error)
// RemoveTargetHostSources removes the Host Sources from the specified Target.
// The provided request must include the Target ID for the Target from which
// the Host Sources will be removed. If the ID is missing, malformed, or
// references a non-existing scope or Catalog, an error is returned. An error
// is returned if a Host Source is attempted to be removed from the Target
// when the Target does not have the Host Set.
RemoveTargetHostSources(context.Context, *RemoveTargetHostSourcesRequest) (*RemoveTargetHostSourcesResponse, error)
// Deprecated: Do not use.
// AddTargetCredentialLibraries adds Credential Libraries to this Target.
// The provided request must include the Target ID to which the Credential
@@ -375,7 +448,7 @@ type TargetServiceServer interface {
// specified Target. The provided request must include the Target ID for the
// Target from which the Credential Sources will be removed. If the ID is
// missing, or malformed, an error is returned. An error is returned if a
// Credential Library is attempted to be removed from the Target when the
// Credential Source is attempted to be removed from the Target when the
// Target does not have the Credential Source.
RemoveTargetCredentialSources(context.Context, *RemoveTargetCredentialSourcesRequest) (*RemoveTargetCredentialSourcesResponse, error)
mustEmbedUnimplementedTargetServiceServer()
@@ -412,6 +485,15 @@ func (UnimplementedTargetServiceServer) SetTargetHostSets(context.Context, *SetT
func (UnimplementedTargetServiceServer) RemoveTargetHostSets(context.Context, *RemoveTargetHostSetsRequest) (*RemoveTargetHostSetsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveTargetHostSets not implemented")
}
func (UnimplementedTargetServiceServer) AddTargetHostSources(context.Context, *AddTargetHostSourcesRequest) (*AddTargetHostSourcesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddTargetHostSources not implemented")
}
func (UnimplementedTargetServiceServer) SetTargetHostSources(context.Context, *SetTargetHostSourcesRequest) (*SetTargetHostSourcesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetTargetHostSources not implemented")
}
func (UnimplementedTargetServiceServer) RemoveTargetHostSources(context.Context, *RemoveTargetHostSourcesRequest) (*RemoveTargetHostSourcesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RemoveTargetHostSources not implemented")
}
func (UnimplementedTargetServiceServer) AddTargetCredentialLibraries(context.Context, *AddTargetCredentialLibrariesRequest) (*AddTargetCredentialLibrariesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method AddTargetCredentialLibraries not implemented")
}
@@ -605,6 +687,60 @@ func _TargetService_RemoveTargetHostSets_Handler(srv interface{}, ctx context.Co
return interceptor(ctx, in, info, handler)
}
func _TargetService_AddTargetHostSources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AddTargetHostSourcesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TargetServiceServer).AddTargetHostSources(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/controller.api.services.v1.TargetService/AddTargetHostSources",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TargetServiceServer).AddTargetHostSources(ctx, req.(*AddTargetHostSourcesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TargetService_SetTargetHostSources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetTargetHostSourcesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TargetServiceServer).SetTargetHostSources(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/controller.api.services.v1.TargetService/SetTargetHostSources",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TargetServiceServer).SetTargetHostSources(ctx, req.(*SetTargetHostSourcesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TargetService_RemoveTargetHostSources_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RemoveTargetHostSourcesRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(TargetServiceServer).RemoveTargetHostSources(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/controller.api.services.v1.TargetService/RemoveTargetHostSources",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(TargetServiceServer).RemoveTargetHostSources(ctx, req.(*RemoveTargetHostSourcesRequest))
}
return interceptor(ctx, in, info, handler)
}
func _TargetService_AddTargetCredentialLibraries_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(AddTargetCredentialLibrariesRequest)
if err := dec(in); err != nil {
@@ -756,6 +892,18 @@ var TargetService_ServiceDesc = grpc.ServiceDesc{
MethodName: "RemoveTargetHostSets",
Handler: _TargetService_RemoveTargetHostSets_Handler,
},
{
MethodName: "AddTargetHostSources",
Handler: _TargetService_AddTargetHostSources_Handler,
},
{
MethodName: "SetTargetHostSources",
Handler: _TargetService_SetTargetHostSources_Handler,
},
{
MethodName: "RemoveTargetHostSources",
Handler: _TargetService_RemoveTargetHostSources_Handler,
},
{
MethodName: "AddTargetCredentialLibraries",
Handler: _TargetService_AddTargetCredentialLibraries_Handler,