From df3b1aa2b14d378d6fe500b27979158b6b38e8c3 Mon Sep 17 00:00:00 2001 From: Alex Tymchuk Date: Wed, 13 Sep 2023 14:44:05 +0300 Subject: [PATCH] PMM-12376 single inventory add endpoint (#2422) * PMM-12376 add a single NodeAdd endpoint * PMM-12376 add a couple tests for AddNode * PMM-12376 add more tests * PMM-12376 remove debug lines * PMM-12376 format the code * PMM-12376 address linter errors * PMM-12376 pass context to transactions * PMM-12376 add more tests * PMM-12376 clean up the tests * PMM-12376 improve the tests * PMM-12376 re-generate the specs * PMM-12376 add AddNode to grpc server * PMM-12376 update the APi documentation * PMM-12376 update the documentation * PMM-12376 prefer oneof vs optional * PMM-12376 update the docs * PMM-12376 add API tests * PMM-12376 fix formatting * PMM-12376 fix API nodes_test * PMM-12376 fix API tests * PMM-12376 reindex message props in nodes.proto Co-authored-by: Artem Gavrilov * PMM-12376 use NotEmpty for checking an array Co-authored-by: Artem Gavrilov * PMM-12376 move back the api-tests/server tests * PMM-12376 running make gen * PMM-12376 replace NotZerof with NotEmptyf * PMM-12376 fix the TestContainerNode/Basic API test --------- Co-authored-by: Artem Gavrilov --- api-tests/helpers.go | 15 + api-tests/inventory/nodes_test.go | 354 ++++- .../json/client/nodes/add_node_parameters.go | 144 ++ .../json/client/nodes/add_node_responses.go | 1363 +++++++++++++++++ .../nodes/add_remote_rds_node_responses.go | 4 - .../json/client/nodes/get_node_responses.go | 4 - .../json/client/nodes/list_nodes_responses.go | 4 - .../json/client/nodes/nodes_client.go | 65 +- api/inventorypb/json/inventorypb.json | 568 ++++++- api/inventorypb/nodes.pb.go | 1050 ++++++++----- api/inventorypb/nodes.pb.gw.go | 81 + api/inventorypb/nodes.pb.validate.go | 620 ++++++++ api/inventorypb/nodes.proto | 92 +- api/inventorypb/nodes_grpc.pb.go | 79 +- .../json/client/rds/add_rds_responses.go | 4 - api/managementpb/json/managementpb.json | 2 +- api/swagger/swagger-dev.json | 570 ++++++- api/swagger/swagger.json | 570 ++++++- docs/api/addnode.md | 69 + docs/api/adhoc-backup.md | 9 +- docs/api/authentication.md | 14 +- docs/api/listlocations.md | 14 +- docs/api/listnodes.md | 31 +- docs/api/listservices.md | 26 +- docs/process/tech_stack.md | 4 +- .../services/inventory/grpc/nodes_server.go | 4 + managed/services/inventory/nodes.go | 72 +- managed/services/inventory/nodes_test.go | 277 +++- 28 files changed, 5537 insertions(+), 572 deletions(-) create mode 100644 api/inventorypb/json/client/nodes/add_node_parameters.go create mode 100644 api/inventorypb/json/client/nodes/add_node_responses.go create mode 100644 docs/api/addnode.md diff --git a/api-tests/helpers.go b/api-tests/helpers.go index 1b280fd192..d5559ea0cd 100644 --- a/api-tests/helpers.go +++ b/api-tests/helpers.go @@ -211,6 +211,21 @@ func AddRemoteNode(t TestingT, nodeName string) *nodes.AddRemoteNodeOKBody { return res.Payload } +func AddNode(t TestingT, nodeBody *nodes.AddNodeBody) *nodes.AddNodeOKBody { + t.Helper() + + params := &nodes.AddNodeParams{ + Body: *nodeBody, + Context: Context, + } + + res, err := client.Default.Nodes.AddNode(params) + assert.NoError(t, err) + require.NotNil(t, res) + + return res.Payload +} + func AddPMMAgent(t TestingT, nodeID string) *agents.AddPMMAgentOKBody { t.Helper() diff --git a/api-tests/inventory/nodes_test.go b/api-tests/inventory/nodes_test.go index f2f9c52d86..0907f2a8ea 100644 --- a/api-tests/inventory/nodes_test.go +++ b/api-tests/inventory/nodes_test.go @@ -31,7 +31,7 @@ import ( "github.com/percona/pmm/api/inventorypb/json/client/services" ) -func TestNodes(t *testing.T) { +func TestNodesDeprecated(t *testing.T) { t.Parallel() t.Run("List", func(t *testing.T) { t.Parallel() @@ -45,7 +45,7 @@ func TestNodes(t *testing.T) { res, err := client.Default.Nodes.ListNodes(nil) require.NoError(t, err) - require.NotZerof(t, len(res.Payload.Generic), "There should be at least one node") + require.NotEmptyf(t, res.Payload.Generic, "There should be at least one node") require.Conditionf(t, func() (success bool) { for _, v := range res.Payload.Generic { if v.NodeID == genericNodeID { @@ -54,7 +54,7 @@ func TestNodes(t *testing.T) { } return false }, "There should be generic node with id `%s`", genericNodeID) - require.NotZerof(t, len(res.Payload.Remote), "There should be at least one node") + require.NotEmptyf(t, res.Payload.Remote, "There should be at least one node") require.Conditionf(t, func() (success bool) { for _, v := range res.Payload.Remote { if v.NodeID == remoteNodeID { @@ -71,7 +71,7 @@ func TestNodes(t *testing.T) { Context: pmmapitests.Context, }) require.NoError(t, err) - require.NotZerof(t, len(res.Payload.Generic), "There should be at least one generic node") + require.NotEmptyf(t, res.Payload.Generic, "There should be at least one generic node") require.Conditionf(t, func() (success bool) { for _, v := range res.Payload.Generic { if v.NodeID == genericNodeID { @@ -91,6 +91,78 @@ func TestNodes(t *testing.T) { }) } +func TestNodes(t *testing.T) { + t.Parallel() + t.Run("List", func(t *testing.T) { + t.Parallel() + + remoteNode := pmmapitests.AddNode(t, &nodes.AddNodeBody{ + Remote: &nodes.AddNodeParamsBodyRemote{ + NodeName: pmmapitests.TestString(t, "Test Remote Node for List"), + Address: "10.10.10.1", + }, + }) + remoteNodeID := remoteNode.Remote.NodeID + t.Cleanup(func() { pmmapitests.RemoveNodes(t, remoteNodeID) }) + + genericNode := pmmapitests.AddNode(t, &nodes.AddNodeBody{ + Generic: &nodes.AddNodeParamsBodyGeneric{ + NodeName: pmmapitests.TestString(t, "Test Remote Node for List"), + Address: "10.10.10.2", + }, + }) + genericNodeID := genericNode.Generic.NodeID + require.NotEmpty(t, genericNodeID) + t.Cleanup(func() { pmmapitests.RemoveNodes(t, genericNodeID) }) + + res, err := client.Default.Nodes.ListNodes(nil) + require.NoError(t, err) + require.NotEmptyf(t, res.Payload.Generic, "There should be at least one node") + require.Conditionf(t, func() (success bool) { + for _, v := range res.Payload.Generic { + if v.NodeID == genericNodeID { + return true + } + } + return false + }, "There should be a generic node with id `%s`", genericNodeID) + require.NotEmptyf(t, res.Payload.Remote, "There should be at least one node") + require.Conditionf(t, func() (success bool) { + for _, v := range res.Payload.Remote { + if v.NodeID == remoteNodeID { + return true + } + } + return false + }, "There should be a remote node with id `%s`", remoteNodeID) + + res, err = client.Default.Nodes.ListNodes(&nodes.ListNodesParams{ + Body: nodes.ListNodesBody{ + NodeType: pointer.ToString(nodes.ListNodesBodyNodeTypeGENERICNODE), + }, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + require.NotEmptyf(t, res.Payload.Generic, "There should be at least one generic node") + require.Conditionf(t, func() (success bool) { + for _, v := range res.Payload.Generic { + if v.NodeID == genericNodeID { + return true + } + } + return false + }, "There should be a generic node with id `%s`", genericNodeID) + require.Conditionf(t, func() (success bool) { + for _, v := range res.Payload.Remote { + if v.NodeID == remoteNodeID { + return false + } + } + return true + }, "There shouldn't be a remote node with id `%s`", remoteNodeID) + }) +} + func TestGetNode(t *testing.T) { t.Parallel() t.Run("Basic", func(t *testing.T) { @@ -145,7 +217,7 @@ func TestGetNode(t *testing.T) { }) } -func TestGenericNode(t *testing.T) { +func TestGenericNodeDeprecated(t *testing.T) { t.Parallel() t.Run("Basic", func(t *testing.T) { t.Parallel() @@ -205,12 +277,76 @@ func TestGenericNode(t *testing.T) { }) } -func TestContainerNode(t *testing.T) { +func TestGenericNode(t *testing.T) { t.Parallel() t.Run("Basic", func(t *testing.T) { t.Parallel() - nodeName := pmmapitests.TestString(t, "Test Container Node") + nodeName := pmmapitests.TestString(t, "Test Generic Node") + params := &nodes.AddNodeParams{ + Body: nodes.AddNodeBody{ + Generic: &nodes.AddNodeParamsBodyGeneric{ + NodeName: nodeName, + Address: "10.10.10.10", + }, + }, + Context: pmmapitests.Context, + } + res, err := client.Default.Nodes.AddNode(params) + assert.NoError(t, err) + require.NotNil(t, res) + require.NotNil(t, res.Payload.Generic) + nodeID := res.Payload.Generic.NodeID + t.Cleanup(func() { pmmapitests.RemoveNodes(t, nodeID) }) + + // Check that the node exists in DB. + getNodeRes, err := client.Default.Nodes.GetNode(&nodes.GetNodeParams{ + Body: nodes.GetNodeBody{NodeID: nodeID}, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + expectedResponse := &nodes.GetNodeOK{ + Payload: &nodes.GetNodeOKBody{ + Generic: &nodes.GetNodeOKBodyGeneric{ + NodeID: res.Payload.Generic.NodeID, + NodeName: nodeName, + Address: "10.10.10.10", + }, + }, + } + require.Equal(t, expectedResponse, getNodeRes) + + // Check for duplicates. + res, err = client.Default.Nodes.AddNode(params) + pmmapitests.AssertAPIErrorf(t, err, 409, codes.AlreadyExists, "Node with name %q already exists.", nodeName) + if !assert.Nil(t, res) { + pmmapitests.RemoveNodes(t, res.Payload.Generic.NodeID) + } + }) + + t.Run("AddNameEmpty", func(t *testing.T) { + t.Parallel() + + params := &nodes.AddNodeParams{ + Body: nodes.AddNodeBody{ + Generic: &nodes.AddNodeParamsBodyGeneric{NodeName: ""}, + }, + Context: pmmapitests.Context, + } + res, err := client.Default.Nodes.AddNode(params) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddGenericNodeRequest.NodeName: value length must be at least 1 runes") + if !assert.Nil(t, res) { + pmmapitests.RemoveNodes(t, res.Payload.Generic.NodeID) + } + }) +} + +func TestContainerNodeDeprecated(t *testing.T) { + t.Parallel() + t.Run("Basic", func(t *testing.T) { + t.Parallel() + + nodeName := pmmapitests.TestString(t, "Test Container Node Deprecated") params := &nodes.AddContainerNodeParams{ Body: nodes.AddContainerNodeBody{ NodeName: nodeName, @@ -270,7 +406,76 @@ func TestContainerNode(t *testing.T) { }) } -func TestRemoteNode(t *testing.T) { +func TestContainerNode(t *testing.T) { + t.Parallel() + t.Run("Basic", func(t *testing.T) { + t.Parallel() + + nodeName := pmmapitests.TestString(t, "Test Container Node") + params := &nodes.AddNodeParams{ + Body: nodes.AddNodeBody{ + Container: &nodes.AddNodeParamsBodyContainer{ + NodeName: nodeName, + ContainerID: "docker-id", + ContainerName: "docker-name", + MachineID: "machine-id", + Address: "10.10.1.10", + }, + }, + Context: pmmapitests.Context, + } + res, err := client.Default.Nodes.AddNode(params) + require.NoError(t, err) + require.NotNil(t, res.Payload.Container) + nodeID := res.Payload.Container.NodeID + defer pmmapitests.RemoveNodes(t, nodeID) + + // Check that the node exists in DB. + getNodeRes, err := client.Default.Nodes.GetNode(&nodes.GetNodeParams{ + Body: nodes.GetNodeBody{NodeID: nodeID}, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + expectedResponse := &nodes.GetNodeOK{ + Payload: &nodes.GetNodeOKBody{ + Container: &nodes.GetNodeOKBodyContainer{ + NodeID: res.Payload.Container.NodeID, + NodeName: nodeName, + ContainerID: "docker-id", + ContainerName: "docker-name", + MachineID: "machine-id", + Address: "10.10.1.10", + }, + }, + } + require.Equal(t, expectedResponse, getNodeRes) + + // Check for duplicates. + res, err = client.Default.Nodes.AddNode(params) + pmmapitests.AssertAPIErrorf(t, err, 409, codes.AlreadyExists, "Node with name %q already exists.", nodeName) + if !assert.Nil(t, res) { + pmmapitests.RemoveNodes(t, res.Payload.Container.NodeID) + } + }) + + t.Run("AddNameEmpty", func(t *testing.T) { + t.Parallel() + + params := &nodes.AddNodeParams{ + Body: nodes.AddNodeBody{ + Container: &nodes.AddNodeParamsBodyContainer{NodeName: ""}, + }, + Context: pmmapitests.Context, + } + res, err := client.Default.Nodes.AddNode(params) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddContainerNodeRequest.NodeName: value length must be at least 1 runes") + if !assert.Nil(t, res) { + pmmapitests.RemoveNodes(t, res.Payload.Container.NodeID) + } + }) +} + +func TestRemoteNodeDeprecated(t *testing.T) { t.Parallel() t.Run("Basic", func(t *testing.T) { t.Parallel() @@ -335,14 +540,89 @@ func TestRemoteNode(t *testing.T) { }) } +func TestRemoteNode(t *testing.T) { + t.Parallel() + t.Run("Basic", func(t *testing.T) { + t.Parallel() + + nodeName := pmmapitests.TestString(t, "Test Remote Node") + params := &nodes.AddNodeParams{ + Body: nodes.AddNodeBody{ + Remote: &nodes.AddNodeParamsBodyRemote{ + NodeName: nodeName, + Az: "eu", + Region: "us-west", + Address: "10.10.10.11", + CustomLabels: map[string]string{"foo": "bar"}, + }, + }, + Context: pmmapitests.Context, + } + res, err := client.Default.Nodes.AddNode(params) + require.NoError(t, err) + require.NotNil(t, res.Payload.Remote) + nodeID := res.Payload.Remote.NodeID + defer pmmapitests.RemoveNodes(t, nodeID) + + // Check node exists in DB. + getNodeRes, err := client.Default.Nodes.GetNode(&nodes.GetNodeParams{ + Body: nodes.GetNodeBody{NodeID: nodeID}, + Context: pmmapitests.Context, + }) + require.NoError(t, err) + expectedResponse := &nodes.GetNodeOK{ + Payload: &nodes.GetNodeOKBody{ + Remote: &nodes.GetNodeOKBodyRemote{ + NodeID: res.Payload.Remote.NodeID, + NodeName: nodeName, + Az: "eu", + Region: "us-west", + Address: "10.10.10.11", + CustomLabels: map[string]string{"foo": "bar"}, + }, + }, + } + require.Equal(t, expectedResponse, getNodeRes) + + // Check duplicates. + res, err = client.Default.Nodes.AddNode(params) + pmmapitests.AssertAPIErrorf(t, err, 409, codes.AlreadyExists, "Node with name %q already exists.", nodeName) + if !assert.Nil(t, res) { + pmmapitests.RemoveNodes(t, res.Payload.Remote.NodeID) + } + }) + + t.Run("AddNameEmpty", func(t *testing.T) { + t.Parallel() + + params := &nodes.AddNodeParams{ + Body: nodes.AddNodeBody{ + Remote: &nodes.AddNodeParamsBodyRemote{NodeName: ""}, + }, + Context: pmmapitests.Context, + } + res, err := client.Default.Nodes.AddNode(params) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.InvalidArgument, "invalid AddRemoteNodeRequest.NodeName: value length must be at least 1 runes") + if !assert.Nil(t, res) { + pmmapitests.RemoveNodes(t, res.Payload.Remote.NodeID) + } + }) +} + func TestRemoveNode(t *testing.T) { t.Parallel() t.Run("Basic", func(t *testing.T) { t.Parallel() nodeName := pmmapitests.TestString(t, "Generic Node for basic remove test") - node := pmmapitests.AddGenericNode(t, nodeName) - nodeID := node.NodeID + node := pmmapitests.AddNode(t, + &nodes.AddNodeBody{ + Generic: &nodes.AddNodeParamsBodyGeneric{ + NodeName: nodeName, + Address: "10.10.10.1", + }, + }) + nodeID := node.Generic.NodeID removeResp, err := client.Default.Nodes.RemoveNode(&nodes.RemoveNodeParams{ Body: nodes.RemoveNodeBody{ @@ -358,11 +638,18 @@ func TestRemoveNode(t *testing.T) { t.Parallel() nodeName := pmmapitests.TestString(t, "Generic Node for remove test") - node := pmmapitests.AddGenericNode(t, nodeName) + node := pmmapitests.AddNode(t, + &nodes.AddNodeBody{ + Generic: &nodes.AddNodeParamsBodyGeneric{ + NodeName: nodeName, + Address: "10.10.10.1", + }, + }, + ) serviceName := pmmapitests.TestString(t, "MySQL Service for agent") service := addMySQLService(t, services.AddMySQLServiceBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, Address: "localhost", Port: 3306, ServiceName: serviceName, @@ -371,16 +658,16 @@ func TestRemoveNode(t *testing.T) { removeResp, err := client.Default.Nodes.RemoveNode(&nodes.RemoveNodeParams{ Body: nodes.RemoveNodeBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, }, Context: context.Background(), }) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.FailedPrecondition, `Node with ID %q has services.`, node.NodeID) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.FailedPrecondition, `Node with ID %q has services.`, node.Generic.NodeID) assert.Nil(t, removeResp) // Check that node and service isn't removed. getServiceResp, err := client.Default.Nodes.GetNode(&nodes.GetNodeParams{ - Body: nodes.GetNodeBody{NodeID: node.NodeID}, + Body: nodes.GetNodeBody{NodeID: node.Generic.NodeID}, Context: pmmapitests.Context, }) assert.NotNil(t, getServiceResp) @@ -388,7 +675,7 @@ func TestRemoveNode(t *testing.T) { listAgentsOK, err := client.Default.Services.ListServices(&services.ListServicesParams{ Body: services.ListServicesBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, }, Context: pmmapitests.Context, }) @@ -396,7 +683,7 @@ func TestRemoveNode(t *testing.T) { assert.Equal(t, &services.ListServicesOKBody{ Mysql: []*services.ListServicesOKBodyMysqlItems0{ { - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, ServiceID: serviceID, Address: "localhost", Port: 3306, @@ -409,7 +696,7 @@ func TestRemoveNode(t *testing.T) { // Remove with force flag. params := &nodes.RemoveNodeParams{ Body: nodes.RemoveNodeBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, Force: true, }, Context: pmmapitests.Context, @@ -420,15 +707,15 @@ func TestRemoveNode(t *testing.T) { // Check that the node and agents are removed. getServiceResp, err = client.Default.Nodes.GetNode(&nodes.GetNodeParams{ - Body: nodes.GetNodeBody{NodeID: node.NodeID}, + Body: nodes.GetNodeBody{NodeID: node.Generic.NodeID}, Context: pmmapitests.Context, }) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Node with ID %q not found.", node.NodeID) + pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Node with ID %q not found.", node.Generic.NodeID) assert.Nil(t, getServiceResp) listAgentsOK, err = client.Default.Services.ListServices(&services.ListServicesParams{ Body: services.ListServicesBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, }, Context: pmmapitests.Context, }) @@ -440,23 +727,30 @@ func TestRemoveNode(t *testing.T) { t.Parallel() nodeName := pmmapitests.TestString(t, "Generic Node for remove test") - node := pmmapitests.AddGenericNode(t, nodeName) + node := pmmapitests.AddNode(t, + &nodes.AddNodeBody{ + Generic: &nodes.AddNodeParamsBodyGeneric{ + NodeName: nodeName, + Address: "10.10.10.1", + }, + }, + ) - _ = pmmapitests.AddPMMAgent(t, node.NodeID) + _ = pmmapitests.AddPMMAgent(t, node.Generic.NodeID) removeResp, err := client.Default.Nodes.RemoveNode(&nodes.RemoveNodeParams{ Body: nodes.RemoveNodeBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, }, Context: context.Background(), }) - pmmapitests.AssertAPIErrorf(t, err, 400, codes.FailedPrecondition, `Node with ID %q has pmm-agent.`, node.NodeID) + pmmapitests.AssertAPIErrorf(t, err, 400, codes.FailedPrecondition, `Node with ID %q has pmm-agent.`, node.Generic.NodeID) assert.Nil(t, removeResp) // Remove with force flag. params := &nodes.RemoveNodeParams{ Body: nodes.RemoveNodeBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, Force: true, }, Context: pmmapitests.Context, @@ -467,19 +761,19 @@ func TestRemoveNode(t *testing.T) { // Check that the node and agents are removed. getServiceResp, err := client.Default.Nodes.GetNode(&nodes.GetNodeParams{ - Body: nodes.GetNodeBody{NodeID: node.NodeID}, + Body: nodes.GetNodeBody{NodeID: node.Generic.NodeID}, Context: pmmapitests.Context, }) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Node with ID %q not found.", node.NodeID) + pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Node with ID %q not found.", node.Generic.NodeID) assert.Nil(t, getServiceResp) listAgentsOK, err := client.Default.Agents.ListAgents(&agents.ListAgentsParams{ Body: agents.ListAgentsBody{ - NodeID: node.NodeID, + NodeID: node.Generic.NodeID, }, Context: pmmapitests.Context, }) - pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Node with ID %q not found.", node.NodeID) + pmmapitests.AssertAPIErrorf(t, err, 404, codes.NotFound, "Node with ID %q not found.", node.Generic.NodeID) assert.Nil(t, listAgentsOK) }) diff --git a/api/inventorypb/json/client/nodes/add_node_parameters.go b/api/inventorypb/json/client/nodes/add_node_parameters.go new file mode 100644 index 0000000000..eb3fa2c34d --- /dev/null +++ b/api/inventorypb/json/client/nodes/add_node_parameters.go @@ -0,0 +1,144 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "net/http" + "time" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + cr "github.com/go-openapi/runtime/client" + "github.com/go-openapi/strfmt" +) + +// NewAddNodeParams creates a new AddNodeParams object, +// with the default timeout for this client. +// +// Default values are not hydrated, since defaults are normally applied by the API server side. +// +// To enforce default values in parameter, use SetDefaults or WithDefaults. +func NewAddNodeParams() *AddNodeParams { + return &AddNodeParams{ + timeout: cr.DefaultTimeout, + } +} + +// NewAddNodeParamsWithTimeout creates a new AddNodeParams object +// with the ability to set a timeout on a request. +func NewAddNodeParamsWithTimeout(timeout time.Duration) *AddNodeParams { + return &AddNodeParams{ + timeout: timeout, + } +} + +// NewAddNodeParamsWithContext creates a new AddNodeParams object +// with the ability to set a context for a request. +func NewAddNodeParamsWithContext(ctx context.Context) *AddNodeParams { + return &AddNodeParams{ + Context: ctx, + } +} + +// NewAddNodeParamsWithHTTPClient creates a new AddNodeParams object +// with the ability to set a custom HTTPClient for a request. +func NewAddNodeParamsWithHTTPClient(client *http.Client) *AddNodeParams { + return &AddNodeParams{ + HTTPClient: client, + } +} + +/* +AddNodeParams contains all the parameters to send to the API endpoint + + for the add node operation. + + Typically these are written to a http.Request. +*/ +type AddNodeParams struct { + // Body. + Body AddNodeBody + + timeout time.Duration + Context context.Context + HTTPClient *http.Client +} + +// WithDefaults hydrates default values in the add node params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddNodeParams) WithDefaults() *AddNodeParams { + o.SetDefaults() + return o +} + +// SetDefaults hydrates default values in the add node params (not the query body). +// +// All values with no default are reset to their zero value. +func (o *AddNodeParams) SetDefaults() { + // no default values defined for this parameter +} + +// WithTimeout adds the timeout to the add node params +func (o *AddNodeParams) WithTimeout(timeout time.Duration) *AddNodeParams { + o.SetTimeout(timeout) + return o +} + +// SetTimeout adds the timeout to the add node params +func (o *AddNodeParams) SetTimeout(timeout time.Duration) { + o.timeout = timeout +} + +// WithContext adds the context to the add node params +func (o *AddNodeParams) WithContext(ctx context.Context) *AddNodeParams { + o.SetContext(ctx) + return o +} + +// SetContext adds the context to the add node params +func (o *AddNodeParams) SetContext(ctx context.Context) { + o.Context = ctx +} + +// WithHTTPClient adds the HTTPClient to the add node params +func (o *AddNodeParams) WithHTTPClient(client *http.Client) *AddNodeParams { + o.SetHTTPClient(client) + return o +} + +// SetHTTPClient adds the HTTPClient to the add node params +func (o *AddNodeParams) SetHTTPClient(client *http.Client) { + o.HTTPClient = client +} + +// WithBody adds the body to the add node params +func (o *AddNodeParams) WithBody(body AddNodeBody) *AddNodeParams { + o.SetBody(body) + return o +} + +// SetBody adds the body to the add node params +func (o *AddNodeParams) SetBody(body AddNodeBody) { + o.Body = body +} + +// WriteToRequest writes these params to a swagger request +func (o *AddNodeParams) WriteToRequest(r runtime.ClientRequest, reg strfmt.Registry) error { + if err := r.SetTimeout(o.timeout); err != nil { + return err + } + var res []error + if err := r.SetBodyParam(o.Body); err != nil { + return err + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} diff --git a/api/inventorypb/json/client/nodes/add_node_responses.go b/api/inventorypb/json/client/nodes/add_node_responses.go new file mode 100644 index 0000000000..6242f93d67 --- /dev/null +++ b/api/inventorypb/json/client/nodes/add_node_responses.go @@ -0,0 +1,1363 @@ +// Code generated by go-swagger; DO NOT EDIT. + +package nodes + +// This file was generated by the swagger tool. +// Editing this file might prove futile when you re-run the swagger generate command + +import ( + "context" + "fmt" + "io" + "strconv" + + "github.com/go-openapi/errors" + "github.com/go-openapi/runtime" + "github.com/go-openapi/strfmt" + "github.com/go-openapi/swag" +) + +// AddNodeReader is a Reader for the AddNode structure. +type AddNodeReader struct { + formats strfmt.Registry +} + +// ReadResponse reads a server response into the received o. +func (o *AddNodeReader) ReadResponse(response runtime.ClientResponse, consumer runtime.Consumer) (interface{}, error) { + switch response.Code() { + case 200: + result := NewAddNodeOK() + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + return result, nil + default: + result := NewAddNodeDefault(response.Code()) + if err := result.readResponse(response, consumer, o.formats); err != nil { + return nil, err + } + if response.Code()/100 == 2 { + return result, nil + } + return nil, result + } +} + +// NewAddNodeOK creates a AddNodeOK with default headers values +func NewAddNodeOK() *AddNodeOK { + return &AddNodeOK{} +} + +/* +AddNodeOK describes a response with status code 200, with default header values. + +A successful response. +*/ +type AddNodeOK struct { + Payload *AddNodeOKBody +} + +func (o *AddNodeOK) Error() string { + return fmt.Sprintf("[POST /v1/inventory/Nodes/Add][%d] addNodeOk %+v", 200, o.Payload) +} + +func (o *AddNodeOK) GetPayload() *AddNodeOKBody { + return o.Payload +} + +func (o *AddNodeOK) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(AddNodeOKBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +// NewAddNodeDefault creates a AddNodeDefault with default headers values +func NewAddNodeDefault(code int) *AddNodeDefault { + return &AddNodeDefault{ + _statusCode: code, + } +} + +/* +AddNodeDefault describes a response with status code -1, with default header values. + +An unexpected error response. +*/ +type AddNodeDefault struct { + _statusCode int + + Payload *AddNodeDefaultBody +} + +// Code gets the status code for the add node default response +func (o *AddNodeDefault) Code() int { + return o._statusCode +} + +func (o *AddNodeDefault) Error() string { + return fmt.Sprintf("[POST /v1/inventory/Nodes/Add][%d] AddNode default %+v", o._statusCode, o.Payload) +} + +func (o *AddNodeDefault) GetPayload() *AddNodeDefaultBody { + return o.Payload +} + +func (o *AddNodeDefault) readResponse(response runtime.ClientResponse, consumer runtime.Consumer, formats strfmt.Registry) error { + o.Payload = new(AddNodeDefaultBody) + + // response payload + if err := consumer.Consume(response.Body(), o.Payload); err != nil && err != io.EOF { + return err + } + + return nil +} + +/* +AddNodeBody add node body +swagger:model AddNodeBody +*/ +type AddNodeBody struct { + // container + Container *AddNodeParamsBodyContainer `json:"container,omitempty"` + + // generic + Generic *AddNodeParamsBodyGeneric `json:"generic,omitempty"` + + // remote + Remote *AddNodeParamsBodyRemote `json:"remote,omitempty"` + + // remote azure + RemoteAzure *AddNodeParamsBodyRemoteAzure `json:"remote_azure,omitempty"` + + // remote rds + RemoteRDS *AddNodeParamsBodyRemoteRDS `json:"remote_rds,omitempty"` +} + +// Validate validates this add node body +func (o *AddNodeBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateContainer(formats); err != nil { + res = append(res, err) + } + + if err := o.validateGeneric(formats); err != nil { + res = append(res, err) + } + + if err := o.validateRemote(formats); err != nil { + res = append(res, err) + } + + if err := o.validateRemoteAzure(formats); err != nil { + res = append(res, err) + } + + if err := o.validateRemoteRDS(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddNodeBody) validateContainer(formats strfmt.Registry) error { + if swag.IsZero(o.Container) { // not required + return nil + } + + if o.Container != nil { + if err := o.Container.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "container") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "container") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) validateGeneric(formats strfmt.Registry) error { + if swag.IsZero(o.Generic) { // not required + return nil + } + + if o.Generic != nil { + if err := o.Generic.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "generic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "generic") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) validateRemote(formats strfmt.Registry) error { + if swag.IsZero(o.Remote) { // not required + return nil + } + + if o.Remote != nil { + if err := o.Remote.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "remote") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "remote") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) validateRemoteAzure(formats strfmt.Registry) error { + if swag.IsZero(o.RemoteAzure) { // not required + return nil + } + + if o.RemoteAzure != nil { + if err := o.RemoteAzure.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "remote_azure") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "remote_azure") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) validateRemoteRDS(formats strfmt.Registry) error { + if swag.IsZero(o.RemoteRDS) { // not required + return nil + } + + if o.RemoteRDS != nil { + if err := o.RemoteRDS.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "remote_rds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "remote_rds") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add node body based on the context it is used +func (o *AddNodeBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateContainer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateGeneric(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateRemote(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateRemoteAzure(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateRemoteRDS(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddNodeBody) contextValidateContainer(ctx context.Context, formats strfmt.Registry) error { + if o.Container != nil { + if err := o.Container.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "container") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "container") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) contextValidateGeneric(ctx context.Context, formats strfmt.Registry) error { + if o.Generic != nil { + if err := o.Generic.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "generic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "generic") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) contextValidateRemote(ctx context.Context, formats strfmt.Registry) error { + if o.Remote != nil { + if err := o.Remote.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "remote") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "remote") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) contextValidateRemoteAzure(ctx context.Context, formats strfmt.Registry) error { + if o.RemoteAzure != nil { + if err := o.RemoteAzure.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "remote_azure") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "remote_azure") + } + return err + } + } + + return nil +} + +func (o *AddNodeBody) contextValidateRemoteRDS(ctx context.Context, formats strfmt.Registry) error { + if o.RemoteRDS != nil { + if err := o.RemoteRDS.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("body" + "." + "remote_rds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("body" + "." + "remote_rds") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeBody) UnmarshalBinary(b []byte) error { + var res AddNodeBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeDefaultBody add node default body +swagger:model AddNodeDefaultBody +*/ +type AddNodeDefaultBody struct { + // code + Code int32 `json:"code,omitempty"` + + // message + Message string `json:"message,omitempty"` + + // details + Details []*AddNodeDefaultBodyDetailsItems0 `json:"details"` +} + +// Validate validates this add node default body +func (o *AddNodeDefaultBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateDetails(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddNodeDefaultBody) validateDetails(formats strfmt.Registry) error { + if swag.IsZero(o.Details) { // not required + return nil + } + + for i := 0; i < len(o.Details); i++ { + if swag.IsZero(o.Details[i]) { // not required + continue + } + + if o.Details[i] != nil { + if err := o.Details[i].Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddNode default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + + } + + return nil +} + +// ContextValidate validate this add node default body based on the context it is used +func (o *AddNodeDefaultBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateDetails(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddNodeDefaultBody) contextValidateDetails(ctx context.Context, formats strfmt.Registry) error { + for i := 0; i < len(o.Details); i++ { + if o.Details[i] != nil { + if err := o.Details[i].ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("AddNode default" + "." + "details" + "." + strconv.Itoa(i)) + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("AddNode default" + "." + "details" + "." + strconv.Itoa(i)) + } + return err + } + } + } + + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeDefaultBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeDefaultBody) UnmarshalBinary(b []byte) error { + var res AddNodeDefaultBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeDefaultBodyDetailsItems0 add node default body details items0 +swagger:model AddNodeDefaultBodyDetailsItems0 +*/ +type AddNodeDefaultBodyDetailsItems0 struct { + // at type + AtType string `json:"@type,omitempty"` +} + +// Validate validates this add node default body details items0 +func (o *AddNodeDefaultBodyDetailsItems0) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node default body details items0 based on context it is used +func (o *AddNodeDefaultBodyDetailsItems0) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeDefaultBodyDetailsItems0) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeDefaultBodyDetailsItems0) UnmarshalBinary(b []byte) error { + var res AddNodeDefaultBodyDetailsItems0 + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeOKBody add node OK body +swagger:model AddNodeOKBody +*/ +type AddNodeOKBody struct { + // container + Container *AddNodeOKBodyContainer `json:"container,omitempty"` + + // generic + Generic *AddNodeOKBodyGeneric `json:"generic,omitempty"` + + // remote + Remote *AddNodeOKBodyRemote `json:"remote,omitempty"` + + // remote azure database + RemoteAzureDatabase *AddNodeOKBodyRemoteAzureDatabase `json:"remote_azure_database,omitempty"` + + // remote rds + RemoteRDS *AddNodeOKBodyRemoteRDS `json:"remote_rds,omitempty"` +} + +// Validate validates this add node OK body +func (o *AddNodeOKBody) Validate(formats strfmt.Registry) error { + var res []error + + if err := o.validateContainer(formats); err != nil { + res = append(res, err) + } + + if err := o.validateGeneric(formats); err != nil { + res = append(res, err) + } + + if err := o.validateRemote(formats); err != nil { + res = append(res, err) + } + + if err := o.validateRemoteAzureDatabase(formats); err != nil { + res = append(res, err) + } + + if err := o.validateRemoteRDS(formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddNodeOKBody) validateContainer(formats strfmt.Registry) error { + if swag.IsZero(o.Container) { // not required + return nil + } + + if o.Container != nil { + if err := o.Container.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "container") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "container") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) validateGeneric(formats strfmt.Registry) error { + if swag.IsZero(o.Generic) { // not required + return nil + } + + if o.Generic != nil { + if err := o.Generic.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "generic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "generic") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) validateRemote(formats strfmt.Registry) error { + if swag.IsZero(o.Remote) { // not required + return nil + } + + if o.Remote != nil { + if err := o.Remote.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "remote") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "remote") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) validateRemoteAzureDatabase(formats strfmt.Registry) error { + if swag.IsZero(o.RemoteAzureDatabase) { // not required + return nil + } + + if o.RemoteAzureDatabase != nil { + if err := o.RemoteAzureDatabase.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "remote_azure_database") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "remote_azure_database") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) validateRemoteRDS(formats strfmt.Registry) error { + if swag.IsZero(o.RemoteRDS) { // not required + return nil + } + + if o.RemoteRDS != nil { + if err := o.RemoteRDS.Validate(formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "remote_rds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "remote_rds") + } + return err + } + } + + return nil +} + +// ContextValidate validate this add node OK body based on the context it is used +func (o *AddNodeOKBody) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + var res []error + + if err := o.contextValidateContainer(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateGeneric(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateRemote(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateRemoteAzureDatabase(ctx, formats); err != nil { + res = append(res, err) + } + + if err := o.contextValidateRemoteRDS(ctx, formats); err != nil { + res = append(res, err) + } + + if len(res) > 0 { + return errors.CompositeValidationError(res...) + } + return nil +} + +func (o *AddNodeOKBody) contextValidateContainer(ctx context.Context, formats strfmt.Registry) error { + if o.Container != nil { + if err := o.Container.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "container") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "container") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) contextValidateGeneric(ctx context.Context, formats strfmt.Registry) error { + if o.Generic != nil { + if err := o.Generic.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "generic") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "generic") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) contextValidateRemote(ctx context.Context, formats strfmt.Registry) error { + if o.Remote != nil { + if err := o.Remote.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "remote") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "remote") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) contextValidateRemoteAzureDatabase(ctx context.Context, formats strfmt.Registry) error { + if o.RemoteAzureDatabase != nil { + if err := o.RemoteAzureDatabase.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "remote_azure_database") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "remote_azure_database") + } + return err + } + } + + return nil +} + +func (o *AddNodeOKBody) contextValidateRemoteRDS(ctx context.Context, formats strfmt.Registry) error { + if o.RemoteRDS != nil { + if err := o.RemoteRDS.ContextValidate(ctx, formats); err != nil { + if ve, ok := err.(*errors.Validation); ok { + return ve.ValidateName("addNodeOk" + "." + "remote_rds") + } else if ce, ok := err.(*errors.CompositeError); ok { + return ce.ValidateName("addNodeOk" + "." + "remote_rds") + } + return err + } + } + + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeOKBody) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeOKBody) UnmarshalBinary(b []byte) error { + var res AddNodeOKBody + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeOKBodyContainer ContainerNode represents a Docker container. +swagger:model AddNodeOKBodyContainer +*/ +type AddNodeOKBodyContainer struct { + // Unique randomly generated instance identifier. + NodeID string `json:"node_id,omitempty"` + + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // Node address (DNS name or IP). + Address string `json:"address,omitempty"` + + // Linux machine-id of the Generic Node where this Container Node runs. + MachineID string `json:"machine_id,omitempty"` + + // Container identifier. If specified, must be a unique Docker container identifier. + ContainerID string `json:"container_id,omitempty"` + + // Container name. + ContainerName string `json:"container_name,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node OK body container +func (o *AddNodeOKBodyContainer) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node OK body container based on context it is used +func (o *AddNodeOKBodyContainer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeOKBodyContainer) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeOKBodyContainer) UnmarshalBinary(b []byte) error { + var res AddNodeOKBodyContainer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeOKBodyGeneric GenericNode represents a bare metal server or virtual machine. +swagger:model AddNodeOKBodyGeneric +*/ +type AddNodeOKBodyGeneric struct { + // Unique randomly generated instance identifier. + NodeID string `json:"node_id,omitempty"` + + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // Node address (DNS name or IP). + Address string `json:"address,omitempty"` + + // Linux machine-id. + MachineID string `json:"machine_id,omitempty"` + + // Linux distribution name and version. + Distro string `json:"distro,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node OK body generic +func (o *AddNodeOKBodyGeneric) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node OK body generic based on context it is used +func (o *AddNodeOKBodyGeneric) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeOKBodyGeneric) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeOKBodyGeneric) UnmarshalBinary(b []byte) error { + var res AddNodeOKBodyGeneric + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeOKBodyRemote RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes. +swagger:model AddNodeOKBodyRemote +*/ +type AddNodeOKBodyRemote struct { + // Unique randomly generated instance identifier. + NodeID string `json:"node_id,omitempty"` + + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // Node address (DNS name or IP). + Address string `json:"address,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node OK body remote +func (o *AddNodeOKBodyRemote) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node OK body remote based on context it is used +func (o *AddNodeOKBodyRemote) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeOKBodyRemote) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeOKBodyRemote) UnmarshalBinary(b []byte) error { + var res AddNodeOKBodyRemote + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeOKBodyRemoteAzureDatabase RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes. +swagger:model AddNodeOKBodyRemoteAzureDatabase +*/ +type AddNodeOKBodyRemoteAzureDatabase struct { + // Unique randomly generated instance identifier. + NodeID string `json:"node_id,omitempty"` + + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // DB instance identifier. + Address string `json:"address,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node OK body remote azure database +func (o *AddNodeOKBodyRemoteAzureDatabase) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node OK body remote azure database based on context it is used +func (o *AddNodeOKBodyRemoteAzureDatabase) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeOKBodyRemoteAzureDatabase) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeOKBodyRemoteAzureDatabase) UnmarshalBinary(b []byte) error { + var res AddNodeOKBodyRemoteAzureDatabase + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeOKBodyRemoteRDS RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes. +swagger:model AddNodeOKBodyRemoteRDS +*/ +type AddNodeOKBodyRemoteRDS struct { + // Unique randomly generated instance identifier. + NodeID string `json:"node_id,omitempty"` + + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // DB instance identifier. + Address string `json:"address,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node OK body remote RDS +func (o *AddNodeOKBodyRemoteRDS) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node OK body remote RDS based on context it is used +func (o *AddNodeOKBodyRemoteRDS) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeOKBodyRemoteRDS) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeOKBodyRemoteRDS) UnmarshalBinary(b []byte) error { + var res AddNodeOKBodyRemoteRDS + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeParamsBodyContainer add node params body container +swagger:model AddNodeParamsBodyContainer +*/ +type AddNodeParamsBodyContainer struct { + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // Node address (DNS name or IP). + Address string `json:"address,omitempty"` + + // Linux machine-id of the Generic Node where this Container Node runs. + MachineID string `json:"machine_id,omitempty"` + + // Container identifier. If specified, must be a unique Docker container identifier. + ContainerID string `json:"container_id,omitempty"` + + // Container name. + ContainerName string `json:"container_name,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node params body container +func (o *AddNodeParamsBodyContainer) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node params body container based on context it is used +func (o *AddNodeParamsBodyContainer) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeParamsBodyContainer) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeParamsBodyContainer) UnmarshalBinary(b []byte) error { + var res AddNodeParamsBodyContainer + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeParamsBodyGeneric add node params body generic +swagger:model AddNodeParamsBodyGeneric +*/ +type AddNodeParamsBodyGeneric struct { + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // Node address (DNS name or IP). + Address string `json:"address,omitempty"` + + // Linux machine-id. + MachineID string `json:"machine_id,omitempty"` + + // Linux distribution name and version. + Distro string `json:"distro,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node params body generic +func (o *AddNodeParamsBodyGeneric) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node params body generic based on context it is used +func (o *AddNodeParamsBodyGeneric) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeParamsBodyGeneric) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeParamsBodyGeneric) UnmarshalBinary(b []byte) error { + var res AddNodeParamsBodyGeneric + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeParamsBodyRemote add node params body remote +swagger:model AddNodeParamsBodyRemote +*/ +type AddNodeParamsBodyRemote struct { + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // Node address (DNS name or IP). + Address string `json:"address,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node params body remote +func (o *AddNodeParamsBodyRemote) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node params body remote based on context it is used +func (o *AddNodeParamsBodyRemote) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeParamsBodyRemote) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeParamsBodyRemote) UnmarshalBinary(b []byte) error { + var res AddNodeParamsBodyRemote + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeParamsBodyRemoteAzure add node params body remote azure +swagger:model AddNodeParamsBodyRemoteAzure +*/ +type AddNodeParamsBodyRemoteAzure struct { + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // DB instance identifier. + Address string `json:"address,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node params body remote azure +func (o *AddNodeParamsBodyRemoteAzure) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node params body remote azure based on context it is used +func (o *AddNodeParamsBodyRemoteAzure) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeParamsBodyRemoteAzure) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeParamsBodyRemoteAzure) UnmarshalBinary(b []byte) error { + var res AddNodeParamsBodyRemoteAzure + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} + +/* +AddNodeParamsBodyRemoteRDS add node params body remote RDS +swagger:model AddNodeParamsBodyRemoteRDS +*/ +type AddNodeParamsBodyRemoteRDS struct { + // Unique across all Nodes user-defined name. + NodeName string `json:"node_name,omitempty"` + + // DB instance identifier. + Address string `json:"address,omitempty"` + + // Node model. + NodeModel string `json:"node_model,omitempty"` + + // Node region. + Region string `json:"region,omitempty"` + + // Node availability zone. + Az string `json:"az,omitempty"` + + // Custom user-assigned labels. + CustomLabels map[string]string `json:"custom_labels,omitempty"` +} + +// Validate validates this add node params body remote RDS +func (o *AddNodeParamsBodyRemoteRDS) Validate(formats strfmt.Registry) error { + return nil +} + +// ContextValidate validates this add node params body remote RDS based on context it is used +func (o *AddNodeParamsBodyRemoteRDS) ContextValidate(ctx context.Context, formats strfmt.Registry) error { + return nil +} + +// MarshalBinary interface implementation +func (o *AddNodeParamsBodyRemoteRDS) MarshalBinary() ([]byte, error) { + if o == nil { + return nil, nil + } + return swag.WriteJSON(o) +} + +// UnmarshalBinary interface implementation +func (o *AddNodeParamsBodyRemoteRDS) UnmarshalBinary(b []byte) error { + var res AddNodeParamsBodyRemoteRDS + if err := swag.ReadJSON(b, &res); err != nil { + return err + } + *o = res + return nil +} diff --git a/api/inventorypb/json/client/nodes/add_remote_rds_node_responses.go b/api/inventorypb/json/client/nodes/add_remote_rds_node_responses.go index cbdcadf303..614e87de2a 100644 --- a/api/inventorypb/json/client/nodes/add_remote_rds_node_responses.go +++ b/api/inventorypb/json/client/nodes/add_remote_rds_node_responses.go @@ -424,10 +424,6 @@ type AddRemoteRDSNodeOKBodyRemoteRDS struct { Az string `json:"az,omitempty"` // Custom user-assigned labels. - // - // TODO https://jira.percona.com/browse/PMM-4314 - // string az = 8; - // string node_model = 9; CustomLabels map[string]string `json:"custom_labels,omitempty"` } diff --git a/api/inventorypb/json/client/nodes/get_node_responses.go b/api/inventorypb/json/client/nodes/get_node_responses.go index 3f22cfb738..6e1a34baf1 100644 --- a/api/inventorypb/json/client/nodes/get_node_responses.go +++ b/api/inventorypb/json/client/nodes/get_node_responses.go @@ -824,10 +824,6 @@ type GetNodeOKBodyRemoteRDS struct { Az string `json:"az,omitempty"` // Custom user-assigned labels. - // - // TODO https://jira.percona.com/browse/PMM-4314 - // string az = 8; - // string node_model = 9; CustomLabels map[string]string `json:"custom_labels,omitempty"` } diff --git a/api/inventorypb/json/client/nodes/list_nodes_responses.go b/api/inventorypb/json/client/nodes/list_nodes_responses.go index ca9b8b4dae..e8bf829521 100644 --- a/api/inventorypb/json/client/nodes/list_nodes_responses.go +++ b/api/inventorypb/json/client/nodes/list_nodes_responses.go @@ -935,10 +935,6 @@ type ListNodesOKBodyRemoteRDSItems0 struct { Az string `json:"az,omitempty"` // Custom user-assigned labels. - // - // TODO https://jira.percona.com/browse/PMM-4314 - // string az = 8; - // string node_model = 9; CustomLabels map[string]string `json:"custom_labels,omitempty"` } diff --git a/api/inventorypb/json/client/nodes/nodes_client.go b/api/inventorypb/json/client/nodes/nodes_client.go index 48d9df9312..1088e70c62 100644 --- a/api/inventorypb/json/client/nodes/nodes_client.go +++ b/api/inventorypb/json/client/nodes/nodes_client.go @@ -32,6 +32,8 @@ type ClientService interface { AddGenericNode(params *AddGenericNodeParams, opts ...ClientOption) (*AddGenericNodeOK, error) + AddNode(params *AddNodeParams, opts ...ClientOption) (*AddNodeOK, error) + AddRemoteAzureDatabaseNode(params *AddRemoteAzureDatabaseNodeParams, opts ...ClientOption) (*AddRemoteAzureDatabaseNodeOK, error) AddRemoteNode(params *AddRemoteNodeParams, opts ...ClientOption) (*AddRemoteNodeOK, error) @@ -48,9 +50,9 @@ type ClientService interface { } /* -AddContainerNode adds container node +AddContainerNode adds a container node -Adds container Node. +Adds a container Node. */ func (a *Client) AddContainerNode(params *AddContainerNodeParams, opts ...ClientOption) (*AddContainerNodeOK, error) { // TODO: Validate the params before sending @@ -87,9 +89,9 @@ func (a *Client) AddContainerNode(params *AddContainerNodeParams, opts ...Client } /* -AddGenericNode adds generic node +AddGenericNode adds a generic node -Adds generic Node. +Adds a generic Node. */ func (a *Client) AddGenericNode(params *AddGenericNodeParams, opts ...ClientOption) (*AddGenericNodeOK, error) { // TODO: Validate the params before sending @@ -126,9 +128,48 @@ func (a *Client) AddGenericNode(params *AddGenericNodeParams, opts ...ClientOpti } /* -AddRemoteAzureDatabaseNode adds remote azure database node +AddNode adds node + +Adds a Node. +*/ +func (a *Client) AddNode(params *AddNodeParams, opts ...ClientOption) (*AddNodeOK, error) { + // TODO: Validate the params before sending + if params == nil { + params = NewAddNodeParams() + } + op := &runtime.ClientOperation{ + ID: "AddNode", + Method: "POST", + PathPattern: "/v1/inventory/Nodes/Add", + ProducesMediaTypes: []string{"application/json"}, + ConsumesMediaTypes: []string{"application/json"}, + Schemes: []string{"http", "https"}, + Params: params, + Reader: &AddNodeReader{formats: a.formats}, + Context: params.Context, + Client: params.HTTPClient, + } + for _, opt := range opts { + opt(op) + } + + result, err := a.transport.Submit(op) + if err != nil { + return nil, err + } + success, ok := result.(*AddNodeOK) + if ok { + return success, nil + } + // unexpected success response + unexpectedSuccess := result.(*AddNodeDefault) + return nil, runtime.NewAPIError("unexpected success response: content available as default response in error", unexpectedSuccess, unexpectedSuccess.Code()) +} + +/* +AddRemoteAzureDatabaseNode addas a remote azure database node -Adds remote Azure database Node. +Adds a remote Azure database Node. */ func (a *Client) AddRemoteAzureDatabaseNode(params *AddRemoteAzureDatabaseNodeParams, opts ...ClientOption) (*AddRemoteAzureDatabaseNodeOK, error) { // TODO: Validate the params before sending @@ -165,9 +206,9 @@ func (a *Client) AddRemoteAzureDatabaseNode(params *AddRemoteAzureDatabaseNodePa } /* -AddRemoteNode adds remote node +AddRemoteNode adds a remote node -Adds remote Node. +Adds a remote Node. */ func (a *Client) AddRemoteNode(params *AddRemoteNodeParams, opts ...ClientOption) (*AddRemoteNodeOK, error) { // TODO: Validate the params before sending @@ -204,9 +245,9 @@ func (a *Client) AddRemoteNode(params *AddRemoteNodeParams, opts ...ClientOption } /* -AddRemoteRDSNode adds remote RDS node +AddRemoteRDSNode adds a remote RDS node -Adds remote RDS Node. +Adds a remote RDS Node. */ func (a *Client) AddRemoteRDSNode(params *AddRemoteRDSNodeParams, opts ...ClientOption) (*AddRemoteRDSNodeOK, error) { // TODO: Validate the params before sending @@ -321,9 +362,9 @@ func (a *Client) ListNodes(params *ListNodesParams, opts ...ClientOption) (*List } /* -RemoveNode removes node +RemoveNode removes a node -Removes Node. +Removes a Node. */ func (a *Client) RemoveNode(params *RemoveNodeParams, opts ...ClientOption) (*RemoveNodeOK, error) { // TODO: Validate the params before sending diff --git a/api/inventorypb/json/inventorypb.json b/api/inventorypb/json/inventorypb.json index 73ab50ba4d..f1cbb4024b 100644 --- a/api/inventorypb/json/inventorypb.json +++ b/api/inventorypb/json/inventorypb.json @@ -9156,14 +9156,548 @@ } } }, + "/v1/inventory/Nodes/Add": { + "post": { + "description": "Adds a Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Node", + "operationId": "AddNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "container": { + "type": "object", + "properties": { + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 7 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 3 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + }, + "machine_id": { + "description": "Linux machine-id of the Generic Node where this Container Node runs.", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 5 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 6 + } + }, + "x-order": 1 + }, + "generic": { + "type": "object", + "properties": { + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 6 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 4 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 5 + } + }, + "x-order": 0 + }, + "remote": { + "type": "object", + "properties": { + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + } + }, + "x-order": 2 + }, + "remote_azure": { + "type": "object", + "properties": { + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 1 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + } + }, + "x-order": 4 + }, + "remote_rds": { + "type": "object", + "properties": { + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 1 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + } + }, + "x-order": 3 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "container": { + "description": "ContainerNode represents a Docker container.", + "type": "object", + "properties": { + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + }, + "machine_id": { + "description": "Linux machine-id of the Generic Node where this Container Node runs.", + "type": "string", + "x-order": 3 + }, + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + } + }, + "x-order": 1 + }, + "generic": { + "description": "GenericNode represents a bare metal server or virtual machine.", + "type": "object", + "properties": { + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 4 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 3 + }, + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 5 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 6 + } + }, + "x-order": 0 + }, + "remote": { + "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", + "type": "object", + "properties": { + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + }, + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + } + }, + "x-order": 2 + }, + "remote_azure_database": { + "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", + "type": "object", + "properties": { + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 2 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + }, + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + } + }, + "x-order": 4 + }, + "remote_rds": { + "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", + "type": "object", + "properties": { + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 2 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + }, + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + } + }, + "x-order": 3 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "x-order": 0 + } + }, + "additionalProperties": false + }, + "x-order": 2 + }, + "message": { + "type": "string", + "x-order": 1 + } + } + } + } + } + } + }, "/v1/inventory/Nodes/AddContainer": { "post": { - "description": "Adds container Node.", + "description": "Adds a container Node.", "tags": [ "Nodes" ], - "summary": "Add Container Node", + "summary": "Add a Container Node", "operationId": "AddContainerNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -9329,12 +9863,13 @@ }, "/v1/inventory/Nodes/AddGeneric": { "post": { - "description": "Adds generic Node.", + "description": "Adds a generic Node.", "tags": [ "Nodes" ], - "summary": "Add Generic Node", + "summary": "Add a Generic Node", "operationId": "AddGenericNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -9490,12 +10025,13 @@ }, "/v1/inventory/Nodes/AddRemote": { "post": { - "description": "Adds remote Node.", + "description": "Adds a remote Node.", "tags": [ "Nodes" ], - "summary": "Add Remote Node", + "summary": "Add a Remote Node", "operationId": "AddRemoteNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -9631,12 +10167,13 @@ }, "/v1/inventory/Nodes/AddRemoteAzureDatabase": { "post": { - "description": "Adds remote Azure database Node.", + "description": "Adds a remote Azure database Node.", "tags": [ "Nodes" ], - "summary": "Add Remote Azure Database Node", + "summary": "Adda a Remote Azure Database Node", "operationId": "AddRemoteAzureDatabaseNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -9772,12 +10309,13 @@ }, "/v1/inventory/Nodes/AddRemoteRDS": { "post": { - "description": "Adds remote RDS Node.", + "description": "Adds a remote RDS Node.", "tags": [ "Nodes" ], - "summary": "Add Remote RDS Node", + "summary": "Add a Remote RDS Node", "operationId": "AddRemoteRDSNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -9844,7 +10382,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -10162,7 +10700,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -10503,7 +11041,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -10573,11 +11111,11 @@ }, "/v1/inventory/Nodes/Remove": { "post": { - "description": "Removes Node.", + "description": "Removes a Node.", "tags": [ "Nodes" ], - "summary": "Remove Node", + "summary": "Remove a Node", "operationId": "RemoveNode", "parameters": [ { diff --git a/api/inventorypb/nodes.pb.go b/api/inventorypb/nodes.pb.go index afabb19136..b0589adcca 100644 --- a/api/inventorypb/nodes.pb.go +++ b/api/inventorypb/nodes.pb.go @@ -941,6 +941,252 @@ func (*GetNodeResponse_RemoteRds) isGetNodeResponse_Node() {} func (*GetNodeResponse_RemoteAzureDatabase) isGetNodeResponse_Node() {} +type AddNodeRequest struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Request: + // + // *AddNodeRequest_Generic + // *AddNodeRequest_Container + // *AddNodeRequest_Remote + // *AddNodeRequest_RemoteRds + // *AddNodeRequest_RemoteAzure + Request isAddNodeRequest_Request `protobuf_oneof:"request"` +} + +func (x *AddNodeRequest) Reset() { + *x = AddNodeRequest{} + if protoimpl.UnsafeEnabled { + mi := &file_inventorypb_nodes_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddNodeRequest) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddNodeRequest) ProtoMessage() {} + +func (x *AddNodeRequest) ProtoReflect() protoreflect.Message { + mi := &file_inventorypb_nodes_proto_msgTypes[9] + 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 AddNodeRequest.ProtoReflect.Descriptor instead. +func (*AddNodeRequest) Descriptor() ([]byte, []int) { + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{9} +} + +func (m *AddNodeRequest) GetRequest() isAddNodeRequest_Request { + if m != nil { + return m.Request + } + return nil +} + +func (x *AddNodeRequest) GetGeneric() *AddGenericNodeRequest { + if x, ok := x.GetRequest().(*AddNodeRequest_Generic); ok { + return x.Generic + } + return nil +} + +func (x *AddNodeRequest) GetContainer() *AddContainerNodeRequest { + if x, ok := x.GetRequest().(*AddNodeRequest_Container); ok { + return x.Container + } + return nil +} + +func (x *AddNodeRequest) GetRemote() *AddRemoteNodeRequest { + if x, ok := x.GetRequest().(*AddNodeRequest_Remote); ok { + return x.Remote + } + return nil +} + +func (x *AddNodeRequest) GetRemoteRds() *AddRemoteRDSNodeRequest { + if x, ok := x.GetRequest().(*AddNodeRequest_RemoteRds); ok { + return x.RemoteRds + } + return nil +} + +func (x *AddNodeRequest) GetRemoteAzure() *AddRemoteAzureDatabaseNodeRequest { + if x, ok := x.GetRequest().(*AddNodeRequest_RemoteAzure); ok { + return x.RemoteAzure + } + return nil +} + +type isAddNodeRequest_Request interface { + isAddNodeRequest_Request() +} + +type AddNodeRequest_Generic struct { + Generic *AddGenericNodeRequest `protobuf:"bytes,1,opt,name=generic,proto3,oneof"` +} + +type AddNodeRequest_Container struct { + Container *AddContainerNodeRequest `protobuf:"bytes,2,opt,name=container,proto3,oneof"` +} + +type AddNodeRequest_Remote struct { + Remote *AddRemoteNodeRequest `protobuf:"bytes,3,opt,name=remote,proto3,oneof"` +} + +type AddNodeRequest_RemoteRds struct { + RemoteRds *AddRemoteRDSNodeRequest `protobuf:"bytes,4,opt,name=remote_rds,json=remoteRds,proto3,oneof"` +} + +type AddNodeRequest_RemoteAzure struct { + RemoteAzure *AddRemoteAzureDatabaseNodeRequest `protobuf:"bytes,5,opt,name=remote_azure,json=remoteAzure,proto3,oneof"` +} + +func (*AddNodeRequest_Generic) isAddNodeRequest_Request() {} + +func (*AddNodeRequest_Container) isAddNodeRequest_Request() {} + +func (*AddNodeRequest_Remote) isAddNodeRequest_Request() {} + +func (*AddNodeRequest_RemoteRds) isAddNodeRequest_Request() {} + +func (*AddNodeRequest_RemoteAzure) isAddNodeRequest_Request() {} + +type AddNodeResponse struct { + state protoimpl.MessageState + sizeCache protoimpl.SizeCache + unknownFields protoimpl.UnknownFields + + // Types that are assignable to Node: + // + // *AddNodeResponse_Generic + // *AddNodeResponse_Container + // *AddNodeResponse_Remote + // *AddNodeResponse_RemoteRds + // *AddNodeResponse_RemoteAzureDatabase + Node isAddNodeResponse_Node `protobuf_oneof:"node"` +} + +func (x *AddNodeResponse) Reset() { + *x = AddNodeResponse{} + if protoimpl.UnsafeEnabled { + mi := &file_inventorypb_nodes_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) + } +} + +func (x *AddNodeResponse) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*AddNodeResponse) ProtoMessage() {} + +func (x *AddNodeResponse) ProtoReflect() protoreflect.Message { + mi := &file_inventorypb_nodes_proto_msgTypes[10] + 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 AddNodeResponse.ProtoReflect.Descriptor instead. +func (*AddNodeResponse) Descriptor() ([]byte, []int) { + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{10} +} + +func (m *AddNodeResponse) GetNode() isAddNodeResponse_Node { + if m != nil { + return m.Node + } + return nil +} + +func (x *AddNodeResponse) GetGeneric() *GenericNode { + if x, ok := x.GetNode().(*AddNodeResponse_Generic); ok { + return x.Generic + } + return nil +} + +func (x *AddNodeResponse) GetContainer() *ContainerNode { + if x, ok := x.GetNode().(*AddNodeResponse_Container); ok { + return x.Container + } + return nil +} + +func (x *AddNodeResponse) GetRemote() *RemoteNode { + if x, ok := x.GetNode().(*AddNodeResponse_Remote); ok { + return x.Remote + } + return nil +} + +func (x *AddNodeResponse) GetRemoteRds() *RemoteRDSNode { + if x, ok := x.GetNode().(*AddNodeResponse_RemoteRds); ok { + return x.RemoteRds + } + return nil +} + +func (x *AddNodeResponse) GetRemoteAzureDatabase() *RemoteAzureDatabaseNode { + if x, ok := x.GetNode().(*AddNodeResponse_RemoteAzureDatabase); ok { + return x.RemoteAzureDatabase + } + return nil +} + +type isAddNodeResponse_Node interface { + isAddNodeResponse_Node() +} + +type AddNodeResponse_Generic struct { + Generic *GenericNode `protobuf:"bytes,1,opt,name=generic,proto3,oneof"` +} + +type AddNodeResponse_Container struct { + Container *ContainerNode `protobuf:"bytes,2,opt,name=container,proto3,oneof"` +} + +type AddNodeResponse_Remote struct { + Remote *RemoteNode `protobuf:"bytes,3,opt,name=remote,proto3,oneof"` +} + +type AddNodeResponse_RemoteRds struct { + RemoteRds *RemoteRDSNode `protobuf:"bytes,4,opt,name=remote_rds,json=remoteRds,proto3,oneof"` +} + +type AddNodeResponse_RemoteAzureDatabase struct { + RemoteAzureDatabase *RemoteAzureDatabaseNode `protobuf:"bytes,5,opt,name=remote_azure_database,json=remoteAzureDatabase,proto3,oneof"` +} + +func (*AddNodeResponse_Generic) isAddNodeResponse_Node() {} + +func (*AddNodeResponse_Container) isAddNodeResponse_Node() {} + +func (*AddNodeResponse_Remote) isAddNodeResponse_Node() {} + +func (*AddNodeResponse_RemoteRds) isAddNodeResponse_Node() {} + +func (*AddNodeResponse_RemoteAzureDatabase) isAddNodeResponse_Node() {} + type AddGenericNodeRequest struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -967,7 +1213,7 @@ type AddGenericNodeRequest struct { func (x *AddGenericNodeRequest) Reset() { *x = AddGenericNodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[9] + mi := &file_inventorypb_nodes_proto_msgTypes[11] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -980,7 +1226,7 @@ func (x *AddGenericNodeRequest) String() string { func (*AddGenericNodeRequest) ProtoMessage() {} func (x *AddGenericNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[9] + mi := &file_inventorypb_nodes_proto_msgTypes[11] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -993,7 +1239,7 @@ func (x *AddGenericNodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddGenericNodeRequest.ProtoReflect.Descriptor instead. func (*AddGenericNodeRequest) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{9} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{11} } func (x *AddGenericNodeRequest) GetNodeName() string { @@ -1052,6 +1298,7 @@ func (x *AddGenericNodeRequest) GetCustomLabels() map[string]string { return nil } +// Deprecated: Marked as deprecated in inventorypb/nodes.proto. type AddGenericNodeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1063,7 +1310,7 @@ type AddGenericNodeResponse struct { func (x *AddGenericNodeResponse) Reset() { *x = AddGenericNodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[10] + mi := &file_inventorypb_nodes_proto_msgTypes[12] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1076,7 +1323,7 @@ func (x *AddGenericNodeResponse) String() string { func (*AddGenericNodeResponse) ProtoMessage() {} func (x *AddGenericNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[10] + mi := &file_inventorypb_nodes_proto_msgTypes[12] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1089,7 +1336,7 @@ func (x *AddGenericNodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddGenericNodeResponse.ProtoReflect.Descriptor instead. func (*AddGenericNodeResponse) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{10} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{12} } func (x *AddGenericNodeResponse) GetGeneric() *GenericNode { @@ -1127,7 +1374,7 @@ type AddContainerNodeRequest struct { func (x *AddContainerNodeRequest) Reset() { *x = AddContainerNodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[11] + mi := &file_inventorypb_nodes_proto_msgTypes[13] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1140,7 +1387,7 @@ func (x *AddContainerNodeRequest) String() string { func (*AddContainerNodeRequest) ProtoMessage() {} func (x *AddContainerNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[11] + mi := &file_inventorypb_nodes_proto_msgTypes[13] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1153,7 +1400,7 @@ func (x *AddContainerNodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddContainerNodeRequest.ProtoReflect.Descriptor instead. func (*AddContainerNodeRequest) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{11} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{13} } func (x *AddContainerNodeRequest) GetNodeName() string { @@ -1219,6 +1466,7 @@ func (x *AddContainerNodeRequest) GetCustomLabels() map[string]string { return nil } +// Deprecated: Marked as deprecated in inventorypb/nodes.proto. type AddContainerNodeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1230,7 +1478,7 @@ type AddContainerNodeResponse struct { func (x *AddContainerNodeResponse) Reset() { *x = AddContainerNodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[12] + mi := &file_inventorypb_nodes_proto_msgTypes[14] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1243,7 +1491,7 @@ func (x *AddContainerNodeResponse) String() string { func (*AddContainerNodeResponse) ProtoMessage() {} func (x *AddContainerNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[12] + mi := &file_inventorypb_nodes_proto_msgTypes[14] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1256,7 +1504,7 @@ func (x *AddContainerNodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddContainerNodeResponse.ProtoReflect.Descriptor instead. func (*AddContainerNodeResponse) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{12} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{14} } func (x *AddContainerNodeResponse) GetContainer() *ContainerNode { @@ -1288,7 +1536,7 @@ type AddRemoteNodeRequest struct { func (x *AddRemoteNodeRequest) Reset() { *x = AddRemoteNodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[13] + mi := &file_inventorypb_nodes_proto_msgTypes[15] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1301,7 +1549,7 @@ func (x *AddRemoteNodeRequest) String() string { func (*AddRemoteNodeRequest) ProtoMessage() {} func (x *AddRemoteNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[13] + mi := &file_inventorypb_nodes_proto_msgTypes[15] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1314,7 +1562,7 @@ func (x *AddRemoteNodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddRemoteNodeRequest.ProtoReflect.Descriptor instead. func (*AddRemoteNodeRequest) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{13} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{15} } func (x *AddRemoteNodeRequest) GetNodeName() string { @@ -1359,6 +1607,7 @@ func (x *AddRemoteNodeRequest) GetCustomLabels() map[string]string { return nil } +// Deprecated: Marked as deprecated in inventorypb/nodes.proto. type AddRemoteNodeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1370,7 +1619,7 @@ type AddRemoteNodeResponse struct { func (x *AddRemoteNodeResponse) Reset() { *x = AddRemoteNodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[14] + mi := &file_inventorypb_nodes_proto_msgTypes[16] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1383,7 +1632,7 @@ func (x *AddRemoteNodeResponse) String() string { func (*AddRemoteNodeResponse) ProtoMessage() {} func (x *AddRemoteNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[14] + mi := &file_inventorypb_nodes_proto_msgTypes[16] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1396,7 +1645,7 @@ func (x *AddRemoteNodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddRemoteNodeResponse.ProtoReflect.Descriptor instead. func (*AddRemoteNodeResponse) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{14} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{16} } func (x *AddRemoteNodeResponse) GetRemote() *RemoteNode { @@ -1428,7 +1677,7 @@ type AddRemoteRDSNodeRequest struct { func (x *AddRemoteRDSNodeRequest) Reset() { *x = AddRemoteRDSNodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[15] + mi := &file_inventorypb_nodes_proto_msgTypes[17] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1441,7 +1690,7 @@ func (x *AddRemoteRDSNodeRequest) String() string { func (*AddRemoteRDSNodeRequest) ProtoMessage() {} func (x *AddRemoteRDSNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[15] + mi := &file_inventorypb_nodes_proto_msgTypes[17] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1454,7 +1703,7 @@ func (x *AddRemoteRDSNodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use AddRemoteRDSNodeRequest.ProtoReflect.Descriptor instead. func (*AddRemoteRDSNodeRequest) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{15} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{17} } func (x *AddRemoteRDSNodeRequest) GetNodeName() string { @@ -1499,6 +1748,7 @@ func (x *AddRemoteRDSNodeRequest) GetCustomLabels() map[string]string { return nil } +// Deprecated: Marked as deprecated in inventorypb/nodes.proto. type AddRemoteRDSNodeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1510,7 +1760,7 @@ type AddRemoteRDSNodeResponse struct { func (x *AddRemoteRDSNodeResponse) Reset() { *x = AddRemoteRDSNodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[16] + mi := &file_inventorypb_nodes_proto_msgTypes[18] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1523,7 +1773,7 @@ func (x *AddRemoteRDSNodeResponse) String() string { func (*AddRemoteRDSNodeResponse) ProtoMessage() {} func (x *AddRemoteRDSNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[16] + mi := &file_inventorypb_nodes_proto_msgTypes[18] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1536,7 +1786,7 @@ func (x *AddRemoteRDSNodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use AddRemoteRDSNodeResponse.ProtoReflect.Descriptor instead. func (*AddRemoteRDSNodeResponse) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{16} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{18} } func (x *AddRemoteRDSNodeResponse) GetRemoteRds() *RemoteRDSNode { @@ -1568,7 +1818,7 @@ type AddRemoteAzureDatabaseNodeRequest struct { func (x *AddRemoteAzureDatabaseNodeRequest) Reset() { *x = AddRemoteAzureDatabaseNodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[17] + mi := &file_inventorypb_nodes_proto_msgTypes[19] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1581,7 +1831,7 @@ func (x *AddRemoteAzureDatabaseNodeRequest) String() string { func (*AddRemoteAzureDatabaseNodeRequest) ProtoMessage() {} func (x *AddRemoteAzureDatabaseNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[17] + mi := &file_inventorypb_nodes_proto_msgTypes[19] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1594,7 +1844,7 @@ func (x *AddRemoteAzureDatabaseNodeRequest) ProtoReflect() protoreflect.Message // Deprecated: Use AddRemoteAzureDatabaseNodeRequest.ProtoReflect.Descriptor instead. func (*AddRemoteAzureDatabaseNodeRequest) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{17} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{19} } func (x *AddRemoteAzureDatabaseNodeRequest) GetNodeName() string { @@ -1639,6 +1889,7 @@ func (x *AddRemoteAzureDatabaseNodeRequest) GetCustomLabels() map[string]string return nil } +// Deprecated: Marked as deprecated in inventorypb/nodes.proto. type AddRemoteAzureDatabaseNodeResponse struct { state protoimpl.MessageState sizeCache protoimpl.SizeCache @@ -1650,7 +1901,7 @@ type AddRemoteAzureDatabaseNodeResponse struct { func (x *AddRemoteAzureDatabaseNodeResponse) Reset() { *x = AddRemoteAzureDatabaseNodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[18] + mi := &file_inventorypb_nodes_proto_msgTypes[20] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1663,7 +1914,7 @@ func (x *AddRemoteAzureDatabaseNodeResponse) String() string { func (*AddRemoteAzureDatabaseNodeResponse) ProtoMessage() {} func (x *AddRemoteAzureDatabaseNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[18] + mi := &file_inventorypb_nodes_proto_msgTypes[20] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1676,7 +1927,7 @@ func (x *AddRemoteAzureDatabaseNodeResponse) ProtoReflect() protoreflect.Message // Deprecated: Use AddRemoteAzureDatabaseNodeResponse.ProtoReflect.Descriptor instead. func (*AddRemoteAzureDatabaseNodeResponse) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{18} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{20} } func (x *AddRemoteAzureDatabaseNodeResponse) GetRemoteAzureDatabase() *RemoteAzureDatabaseNode { @@ -1700,7 +1951,7 @@ type RemoveNodeRequest struct { func (x *RemoveNodeRequest) Reset() { *x = RemoveNodeRequest{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[19] + mi := &file_inventorypb_nodes_proto_msgTypes[21] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1713,7 +1964,7 @@ func (x *RemoveNodeRequest) String() string { func (*RemoveNodeRequest) ProtoMessage() {} func (x *RemoveNodeRequest) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[19] + mi := &file_inventorypb_nodes_proto_msgTypes[21] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1726,7 +1977,7 @@ func (x *RemoveNodeRequest) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveNodeRequest.ProtoReflect.Descriptor instead. func (*RemoveNodeRequest) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{19} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{21} } func (x *RemoveNodeRequest) GetNodeId() string { @@ -1752,7 +2003,7 @@ type RemoveNodeResponse struct { func (x *RemoveNodeResponse) Reset() { *x = RemoveNodeResponse{} if protoimpl.UnsafeEnabled { - mi := &file_inventorypb_nodes_proto_msgTypes[20] + mi := &file_inventorypb_nodes_proto_msgTypes[22] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -1765,7 +2016,7 @@ func (x *RemoveNodeResponse) String() string { func (*RemoveNodeResponse) ProtoMessage() {} func (x *RemoveNodeResponse) ProtoReflect() protoreflect.Message { - mi := &file_inventorypb_nodes_proto_msgTypes[20] + mi := &file_inventorypb_nodes_proto_msgTypes[22] if protoimpl.UnsafeEnabled && x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -1778,7 +2029,7 @@ func (x *RemoveNodeResponse) ProtoReflect() protoreflect.Message { // Deprecated: Use RemoveNodeResponse.ProtoReflect.Descriptor instead. func (*RemoveNodeResponse) Descriptor() ([]byte, []int) { - return file_inventorypb_nodes_proto_rawDescGZIP(), []int{20} + return file_inventorypb_nodes_proto_rawDescGZIP(), []int{22} } var File_inventorypb_nodes_proto protoreflect.FileDescriptor @@ -1950,68 +2201,165 @@ var file_inventorypb_nodes_proto_rawDesc = []byte{ 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x48, 0x00, 0x52, 0x13, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x42, 0x06, - 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0xf8, 0x02, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x47, 0x65, - 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0xf0, 0x02, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x4e, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x3c, 0x0a, 0x07, 0x67, 0x65, 0x6e, + 0x65, 0x72, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x69, 0x6e, 0x76, + 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, + 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x07, + 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x12, 0x42, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, + 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x6e, 0x76, + 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, + 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x39, 0x0a, 0x06, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1f, 0x2e, 0x69, 0x6e, + 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, 0x52, 0x06, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x12, 0x43, 0x0a, 0x0a, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x5f, 0x72, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x6e, 0x76, + 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, 0x00, + 0x52, 0x09, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x64, 0x73, 0x12, 0x51, 0x0a, 0x0c, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, + 0x0b, 0x32, 0x2c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, + 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, + 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x48, + 0x00, 0x52, 0x0b, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x42, 0x09, + 0x0a, 0x07, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xcd, 0x02, 0x0a, 0x0f, 0x41, 0x64, + 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x32, 0x0a, + 0x07, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, + 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x48, 0x00, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, + 0x63, 0x12, 0x38, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x48, 0x00, + 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x12, 0x2f, 0x0a, 0x06, 0x72, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x69, 0x6e, + 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, + 0x64, 0x65, 0x48, 0x00, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x12, 0x39, 0x0a, 0x0a, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x72, 0x64, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x18, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x48, 0x00, 0x52, 0x09, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x64, 0x73, 0x12, 0x58, 0x0a, 0x15, 0x72, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, + 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, + 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x48, 0x00, 0x52, 0x13, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, + 0x65, 0x42, 0x06, 0x0a, 0x04, 0x6e, 0x6f, 0x64, 0x65, 0x22, 0xf8, 0x02, 0x0a, 0x15, 0x41, 0x64, + 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, + 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x07, 0x61, 0x64, 0x64, + 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, + 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, + 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x09, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, + 0x69, 0x73, 0x74, 0x72, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x73, + 0x74, 0x72, 0x6f, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, + 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, + 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, + 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x61, 0x7a, 0x12, 0x57, 0x0a, 0x0d, 0x63, 0x75, + 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, + 0x0b, 0x32, 0x32, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, + 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, + 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, + 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, + 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, + 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, + 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, + 0x3a, 0x02, 0x38, 0x01, 0x22, 0x4e, 0x0a, 0x16, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, + 0x0a, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, + 0x16, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x6e, 0x65, + 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, + 0x3a, 0x02, 0x18, 0x01, 0x22, 0xae, 0x03, 0x0a, 0x17, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, - 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x69, 0x73, 0x74, - 0x72, 0x6f, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x69, 0x73, 0x74, 0x72, 0x6f, - 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x05, + 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x61, + 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, + 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, + 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, + 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x61, 0x7a, 0x12, 0x59, 0x0a, 0x0d, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, + 0x32, 0x34, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, + 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, + 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, + 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, + 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, + 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, + 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x56, 0x0a, 0x18, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, + 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x36, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, + 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, + 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x09, + 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xbf, 0x02, + 0x0a, 0x14, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, + 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, + 0x10, 0x01, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, 0x07, + 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, + 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, + 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, + 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x16, + 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, + 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x05, 0x20, 0x01, + 0x28, 0x09, 0x52, 0x02, 0x61, 0x7a, 0x12, 0x56, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x31, 0x2e, + 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3f, + 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, + 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, + 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, + 0x4a, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, 0x06, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, + 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, + 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xce, 0x02, 0x0a, 0x17, + 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, + 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, + 0x02, 0x10, 0x01, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, 0x0a, + 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, + 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, + 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, - 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x07, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x02, 0x61, 0x7a, 0x12, 0x57, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, - 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x08, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x32, - 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x65, - 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, - 0x01, 0x22, 0x4a, 0x0a, 0x16, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x07, 0x67, - 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x69, - 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, - 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x07, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x22, 0xae, 0x03, - 0x0a, 0x17, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, - 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, - 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, - 0x21, 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, - 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x5f, 0x69, 0x64, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6d, 0x61, 0x63, 0x68, 0x69, 0x6e, 0x65, 0x49, - 0x64, 0x12, 0x21, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x5f, 0x69, - 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x49, 0x64, 0x12, 0x25, 0x0a, 0x0e, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, - 0x72, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, - 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, - 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, - 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, - 0x61, 0x7a, 0x12, 0x59, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6e, 0x76, 0x65, - 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, - 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, - 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, - 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, - 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x52, - 0x0a, 0x18, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, - 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x09, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x22, 0xbf, 0x02, 0x0a, 0x14, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, + 0x1f, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, + 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, + 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x61, 0x7a, + 0x12, 0x59, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, + 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, + 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x43, + 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, + 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, + 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, + 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x57, 0x0a, 0x18, + 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x72, 0x65, 0x6d, 0x6f, + 0x74, 0x65, 0x5f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x69, + 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, + 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x64, + 0x73, 0x3a, 0x02, 0x18, 0x01, 0x22, 0xe2, 0x02, 0x0a, 0x21, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, @@ -2019,192 +2367,152 @@ var file_inventorypb_nodes_proto_rawDesc = []byte{ 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, - 0x64, 0x65, 0x6c, 0x12, 0x16, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, - 0x7a, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x61, 0x7a, 0x12, 0x56, 0x0a, 0x0d, 0x63, - 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x31, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, - 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, - 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, - 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, - 0x3a, 0x02, 0x38, 0x01, 0x22, 0x46, 0x0a, 0x15, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2d, 0x0a, - 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x15, 0x2e, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x06, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x22, 0xce, 0x02, 0x0a, - 0x17, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, - 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, - 0x12, 0x1f, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, - 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x61, - 0x7a, 0x12, 0x59, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x34, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, - 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, - 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, - 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, - 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, 0x11, - 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, - 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, - 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x53, 0x0a, - 0x18, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0a, 0x72, 0x65, 0x6d, - 0x6f, 0x74, 0x65, 0x5f, 0x72, 0x64, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x18, 0x2e, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x09, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, - 0x64, 0x73, 0x22, 0xe2, 0x02, 0x0a, 0x21, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x24, 0x0a, 0x09, 0x6e, 0x6f, 0x64, 0x65, - 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, - 0x72, 0x02, 0x10, 0x01, 0x52, 0x08, 0x6e, 0x6f, 0x64, 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x21, - 0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, - 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, - 0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6e, 0x6f, 0x64, 0x65, 0x4d, 0x6f, 0x64, 0x65, 0x6c, - 0x12, 0x1f, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, - 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x61, - 0x7a, 0x12, 0x63, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, 0x61, 0x62, 0x65, - 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, - 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, - 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, - 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, - 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, - 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, - 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x76, 0x61, - 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x7c, 0x0a, 0x22, 0x41, 0x64, 0x64, 0x52, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x56, 0x0a, - 0x15, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, 0x65, 0x5f, 0x64, 0x61, - 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x69, - 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, - 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, - 0x52, 0x13, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, - 0x61, 0x62, 0x61, 0x73, 0x65, 0x22, 0x4b, 0x0a, 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, - 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x6e, 0x6f, - 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, - 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x6e, 0x6f, 0x64, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, - 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, - 0x63, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2a, 0x8d, 0x01, 0x0a, 0x08, 0x4e, 0x6f, 0x64, - 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x54, 0x59, - 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, - 0x47, 0x45, 0x4e, 0x45, 0x52, 0x49, 0x43, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x01, 0x12, 0x12, - 0x0a, 0x0e, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, 0x4e, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x44, 0x45, - 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x4e, 0x4f, 0x44, - 0x45, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x52, 0x45, 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x52, 0x44, - 0x53, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x04, 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x45, 0x4d, 0x4f, - 0x54, 0x45, 0x5f, 0x41, 0x5a, 0x55, 0x52, 0x45, 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, - 0x45, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x05, 0x32, 0x82, 0x0b, 0x0a, 0x05, 0x4e, 0x6f, 0x64, - 0x65, 0x73, 0x12, 0x98, 0x01, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, - 0x12, 0x1b, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, - 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, - 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, - 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x2a, - 0x12, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x1a, 0x1c, 0x52, 0x65, - 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, - 0x61, 0x6c, 0x6c, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, - 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, - 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x8f, 0x01, - 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x19, 0x2e, 0x69, 0x6e, 0x76, 0x65, - 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, - 0x22, 0x4d, 0x92, 0x41, 0x28, 0x12, 0x08, 0x47, 0x65, 0x74, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, - 0x1c, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, - 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x20, 0x62, 0x79, 0x20, 0x49, 0x44, 0x2e, 0x82, 0xd3, 0xe4, - 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, - 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x12, - 0xa9, 0x01, 0x0a, 0x0e, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, - 0x64, 0x65, 0x12, 0x20, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, - 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2e, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x52, 0x92, 0x41, 0x26, 0x12, 0x10, 0x41, 0x64, - 0x64, 0x20, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x12, - 0x41, 0x64, 0x64, 0x73, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x20, 0x4e, 0x6f, 0x64, - 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31, + 0x64, 0x65, 0x6c, 0x12, 0x1f, 0x0a, 0x06, 0x72, 0x65, 0x67, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x72, 0x65, + 0x67, 0x69, 0x6f, 0x6e, 0x12, 0x0e, 0x0a, 0x02, 0x61, 0x7a, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, + 0x52, 0x02, 0x61, 0x7a, 0x12, 0x63, 0x0a, 0x0d, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x5f, 0x6c, + 0x61, 0x62, 0x65, 0x6c, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3e, 0x2e, 0x69, 0x6e, + 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, + 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f, 0x6d, + 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0c, 0x63, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x1a, 0x3f, 0x0a, 0x11, 0x43, 0x75, 0x73, + 0x74, 0x6f, 0x6d, 0x4c, 0x61, 0x62, 0x65, 0x6c, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, + 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, + 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, + 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x80, 0x01, 0x0a, 0x22, 0x41, + 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, + 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, + 0x65, 0x12, 0x56, 0x0a, 0x15, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x5f, 0x61, 0x7a, 0x75, 0x72, + 0x65, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, + 0x32, 0x22, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x13, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, + 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x3a, 0x02, 0x18, 0x01, 0x22, 0x4b, 0x0a, + 0x11, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, + 0x73, 0x74, 0x12, 0x20, 0x0a, 0x07, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, + 0x01, 0x28, 0x09, 0x42, 0x07, 0xfa, 0x42, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x6e, 0x6f, + 0x64, 0x65, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x18, 0x02, 0x20, + 0x01, 0x28, 0x08, 0x52, 0x05, 0x66, 0x6f, 0x72, 0x63, 0x65, 0x22, 0x14, 0x0a, 0x12, 0x52, 0x65, + 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x2a, 0x8d, 0x01, 0x0a, 0x08, 0x4e, 0x6f, 0x64, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x15, 0x0a, + 0x11, 0x4e, 0x4f, 0x44, 0x45, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x56, 0x41, 0x4c, + 0x49, 0x44, 0x10, 0x00, 0x12, 0x10, 0x0a, 0x0c, 0x47, 0x45, 0x4e, 0x45, 0x52, 0x49, 0x43, 0x5f, + 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x01, 0x12, 0x12, 0x0a, 0x0e, 0x43, 0x4f, 0x4e, 0x54, 0x41, 0x49, + 0x4e, 0x45, 0x52, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x02, 0x12, 0x0f, 0x0a, 0x0b, 0x52, 0x45, + 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x03, 0x12, 0x13, 0x0a, 0x0f, 0x52, + 0x45, 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x52, 0x44, 0x53, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x04, + 0x12, 0x1e, 0x0a, 0x1a, 0x52, 0x45, 0x4d, 0x4f, 0x54, 0x45, 0x5f, 0x41, 0x5a, 0x55, 0x52, 0x45, + 0x5f, 0x44, 0x41, 0x54, 0x41, 0x42, 0x41, 0x53, 0x45, 0x5f, 0x4e, 0x4f, 0x44, 0x45, 0x10, 0x05, + 0x32, 0xb6, 0x0c, 0x0a, 0x05, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x98, 0x01, 0x0a, 0x09, 0x4c, + 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x12, 0x1b, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, + 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, + 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, + 0x79, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x50, 0x92, 0x41, 0x2a, 0x12, 0x0a, 0x4c, 0x69, 0x73, 0x74, 0x20, 0x4e, + 0x6f, 0x64, 0x65, 0x73, 0x1a, 0x1c, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, 0x20, 0x61, 0x20, + 0x6c, 0x69, 0x73, 0x74, 0x20, 0x6f, 0x66, 0x20, 0x61, 0x6c, 0x6c, 0x20, 0x4e, 0x6f, 0x64, 0x65, + 0x73, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x3a, 0x01, 0x2a, 0x22, 0x18, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, - 0x2f, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x12, 0xb5, 0x01, 0x0a, 0x10, - 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, - 0x12, 0x22, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, - 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, - 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x58, 0x92, 0x41, 0x2a, 0x12, 0x12, - 0x41, 0x64, 0x64, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x4e, 0x6f, - 0x64, 0x65, 0x1a, 0x14, 0x41, 0x64, 0x64, 0x73, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, - 0x65, 0x72, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, - 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, - 0x6e, 0x65, 0x72, 0x12, 0xa3, 0x01, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1f, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, - 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x20, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, - 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, - 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4f, 0x92, 0x41, 0x24, 0x12, 0x0f, 0x41, - 0x64, 0x64, 0x20, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x11, - 0x41, 0x64, 0x64, 0x73, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, - 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x76, 0x31, 0x2f, + 0x2f, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x8f, 0x01, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, + 0x65, 0x12, 0x19, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, + 0x74, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x69, + 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x47, 0x65, 0x74, 0x4e, 0x6f, 0x64, 0x65, + 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x4d, 0x92, 0x41, 0x28, 0x12, 0x08, 0x47, + 0x65, 0x74, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x1c, 0x52, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x73, + 0x20, 0x61, 0x20, 0x73, 0x69, 0x6e, 0x67, 0x6c, 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x20, 0x62, + 0x79, 0x20, 0x49, 0x44, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, 0x17, + 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, + 0x64, 0x65, 0x73, 0x2f, 0x47, 0x65, 0x74, 0x12, 0x7f, 0x0a, 0x07, 0x41, 0x64, 0x64, 0x4e, 0x6f, + 0x64, 0x65, 0x12, 0x19, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, + 0x64, 0x64, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, + 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x4e, 0x6f, 0x64, + 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x3d, 0x92, 0x41, 0x18, 0x12, 0x08, + 0x41, 0x64, 0x64, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x0c, 0x41, 0x64, 0x64, 0x73, 0x20, 0x61, + 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1c, 0x3a, 0x01, 0x2a, 0x22, + 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, + 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x12, 0xb2, 0x01, 0x0a, 0x0e, 0x41, 0x64, 0x64, + 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x20, 0x2e, 0x69, 0x6e, + 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, + 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, + 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x69, 0x63, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, + 0x22, 0x5b, 0x92, 0x41, 0x2c, 0x12, 0x12, 0x41, 0x64, 0x64, 0x20, 0x61, 0x20, 0x47, 0x65, 0x6e, + 0x65, 0x72, 0x69, 0x63, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x14, 0x41, 0x64, 0x64, 0x73, 0x20, + 0x61, 0x20, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x58, + 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, - 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x12, 0xb7, 0x01, 0x0a, 0x10, 0x41, 0x64, - 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x22, - 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, - 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, - 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, + 0x41, 0x64, 0x64, 0x47, 0x65, 0x6e, 0x65, 0x72, 0x69, 0x63, 0x88, 0x02, 0x01, 0x12, 0xbe, 0x01, + 0x0a, 0x10, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, + 0x64, 0x65, 0x12, 0x22, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, + 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, 0x6f, 0x64, 0x65, 0x52, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, + 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x4e, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x61, 0x92, 0x41, 0x30, + 0x12, 0x14, 0x41, 0x64, 0x64, 0x20, 0x61, 0x20, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, + 0x72, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x16, 0x41, 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, 0x63, + 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x58, 0x01, + 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x69, + 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x41, + 0x64, 0x64, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x69, 0x6e, 0x65, 0x72, 0x88, 0x02, 0x01, 0x12, 0xac, + 0x01, 0x0a, 0x0d, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, + 0x12, 0x1f, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, + 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, + 0x74, 0x1a, 0x20, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, + 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, + 0x6e, 0x73, 0x65, 0x22, 0x58, 0x92, 0x41, 0x2a, 0x12, 0x11, 0x41, 0x64, 0x64, 0x20, 0x61, 0x20, + 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x13, 0x41, 0x64, 0x64, + 0x73, 0x20, 0x61, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, + 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x01, 0x2a, 0x22, 0x1d, 0x2f, 0x76, 0x31, + 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, + 0x2f, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x88, 0x02, 0x01, 0x12, 0xc0, 0x01, + 0x0a, 0x10, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, + 0x64, 0x65, 0x12, 0x22, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x5a, 0x92, 0x41, 0x2c, 0x12, 0x13, 0x41, 0x64, - 0x64, 0x20, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x52, 0x44, 0x53, 0x20, 0x4e, 0x6f, 0x64, - 0x65, 0x1a, 0x15, 0x41, 0x64, 0x64, 0x73, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x52, - 0x44, 0x53, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, - 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x52, 0x44, 0x53, 0x12, 0xf5, 0x01, 0x0a, 0x1a, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, - 0x64, 0x65, 0x12, 0x2c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, - 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, - 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x1a, 0x2d, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, - 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, - 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, - 0x7a, 0x92, 0x41, 0x42, 0x12, 0x1e, 0x41, 0x64, 0x64, 0x20, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, - 0x20, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x20, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x20, - 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x20, 0x41, 0x64, 0x64, 0x73, 0x20, 0x72, 0x65, 0x6d, 0x6f, 0x74, - 0x65, 0x20, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, - 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2f, 0x3a, 0x01, 0x2a, 0x22, - 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, - 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, - 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x12, 0x8f, 0x01, 0x0a, 0x0a, - 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, 0x1c, 0x2e, 0x69, 0x6e, 0x76, - 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, - 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, - 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, - 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x44, 0x92, 0x41, 0x1c, 0x12, 0x0b, 0x52, 0x65, - 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, - 0x65, 0x73, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, - 0x2a, 0x22, 0x1a, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, - 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x42, 0x87, 0x01, - 0x0a, 0x0d, 0x63, 0x6f, 0x6d, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x42, - 0x0a, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x67, - 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, - 0x61, 0x2f, 0x70, 0x6d, 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, - 0x6f, 0x72, 0x79, 0x70, 0x62, 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x49, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0xca, 0x02, 0x09, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, - 0x6f, 0x72, 0x79, 0xe2, 0x02, 0x15, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x5c, - 0x47, 0x50, 0x42, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x49, 0x6e, - 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, + 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, + 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x4e, + 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x63, 0x92, 0x41, 0x32, + 0x12, 0x15, 0x41, 0x64, 0x64, 0x20, 0x61, 0x20, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x52, + 0x44, 0x53, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x17, 0x41, 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, + 0x72, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x52, 0x44, 0x53, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, + 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x3a, 0x01, 0x2a, 0x22, 0x20, 0x2f, 0x76, 0x31, + 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, + 0x2f, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x52, 0x44, 0x53, 0x88, 0x02, 0x01, + 0x12, 0x80, 0x02, 0x0a, 0x1a, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, + 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x12, + 0x2c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, + 0x65, 0x6d, 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, + 0x73, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2d, 0x2e, + 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x84, 0x01, 0x92, + 0x41, 0x49, 0x12, 0x21, 0x41, 0x64, 0x64, 0x61, 0x20, 0x61, 0x20, 0x52, 0x65, 0x6d, 0x6f, 0x74, + 0x65, 0x20, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x20, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x1a, 0x22, 0x41, 0x64, 0x64, 0x73, 0x20, 0x61, 0x20, 0x72, 0x65, + 0x6d, 0x6f, 0x74, 0x65, 0x20, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x20, 0x64, 0x61, 0x74, 0x61, 0x62, + 0x61, 0x73, 0x65, 0x20, 0x4e, 0x6f, 0x64, 0x65, 0x2e, 0x58, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, + 0x2f, 0x3a, 0x01, 0x2a, 0x22, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, 0x65, 0x73, 0x2f, 0x41, 0x64, 0x64, 0x52, 0x65, 0x6d, + 0x6f, 0x74, 0x65, 0x41, 0x7a, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, + 0x88, 0x02, 0x01, 0x12, 0x93, 0x01, 0x0a, 0x0a, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, + 0x64, 0x65, 0x12, 0x1c, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, + 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, + 0x1a, 0x1d, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2e, 0x52, 0x65, 0x6d, + 0x6f, 0x76, 0x65, 0x4e, 0x6f, 0x64, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, + 0x48, 0x92, 0x41, 0x20, 0x12, 0x0d, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x20, 0x61, 0x20, 0x4e, + 0x6f, 0x64, 0x65, 0x1a, 0x0f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x73, 0x20, 0x61, 0x20, 0x4e, + 0x6f, 0x64, 0x65, 0x2e, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x01, 0x2a, 0x22, 0x1a, 0x2f, + 0x76, 0x31, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x2f, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x2f, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x42, 0x87, 0x01, 0x0a, 0x0d, 0x63, 0x6f, + 0x6d, 0x2e, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x42, 0x0a, 0x4e, 0x6f, 0x64, + 0x65, 0x73, 0x50, 0x72, 0x6f, 0x74, 0x6f, 0x50, 0x01, 0x5a, 0x26, 0x67, 0x69, 0x74, 0x68, 0x75, + 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x70, 0x65, 0x72, 0x63, 0x6f, 0x6e, 0x61, 0x2f, 0x70, 0x6d, + 0x6d, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x69, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x70, + 0x62, 0xa2, 0x02, 0x03, 0x49, 0x58, 0x58, 0xaa, 0x02, 0x09, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0xca, 0x02, 0x09, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0xe2, + 0x02, 0x15, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, 0x6f, 0x72, 0x79, 0x5c, 0x47, 0x50, 0x42, 0x4d, + 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0xea, 0x02, 0x09, 0x49, 0x6e, 0x76, 0x65, 0x6e, 0x74, + 0x6f, 0x72, 0x79, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, } var ( @@ -2221,7 +2529,7 @@ func file_inventorypb_nodes_proto_rawDescGZIP() []byte { var ( file_inventorypb_nodes_proto_enumTypes = make([]protoimpl.EnumInfo, 1) - file_inventorypb_nodes_proto_msgTypes = make([]protoimpl.MessageInfo, 31) + file_inventorypb_nodes_proto_msgTypes = make([]protoimpl.MessageInfo, 33) file_inventorypb_nodes_proto_goTypes = []interface{}{ (NodeType)(0), // 0: inventory.NodeType (*GenericNode)(nil), // 1: inventory.GenericNode @@ -2233,37 +2541,39 @@ var ( (*ListNodesResponse)(nil), // 7: inventory.ListNodesResponse (*GetNodeRequest)(nil), // 8: inventory.GetNodeRequest (*GetNodeResponse)(nil), // 9: inventory.GetNodeResponse - (*AddGenericNodeRequest)(nil), // 10: inventory.AddGenericNodeRequest - (*AddGenericNodeResponse)(nil), // 11: inventory.AddGenericNodeResponse - (*AddContainerNodeRequest)(nil), // 12: inventory.AddContainerNodeRequest - (*AddContainerNodeResponse)(nil), // 13: inventory.AddContainerNodeResponse - (*AddRemoteNodeRequest)(nil), // 14: inventory.AddRemoteNodeRequest - (*AddRemoteNodeResponse)(nil), // 15: inventory.AddRemoteNodeResponse - (*AddRemoteRDSNodeRequest)(nil), // 16: inventory.AddRemoteRDSNodeRequest - (*AddRemoteRDSNodeResponse)(nil), // 17: inventory.AddRemoteRDSNodeResponse - (*AddRemoteAzureDatabaseNodeRequest)(nil), // 18: inventory.AddRemoteAzureDatabaseNodeRequest - (*AddRemoteAzureDatabaseNodeResponse)(nil), // 19: inventory.AddRemoteAzureDatabaseNodeResponse - (*RemoveNodeRequest)(nil), // 20: inventory.RemoveNodeRequest - (*RemoveNodeResponse)(nil), // 21: inventory.RemoveNodeResponse - nil, // 22: inventory.GenericNode.CustomLabelsEntry - nil, // 23: inventory.ContainerNode.CustomLabelsEntry - nil, // 24: inventory.RemoteNode.CustomLabelsEntry - nil, // 25: inventory.RemoteRDSNode.CustomLabelsEntry - nil, // 26: inventory.RemoteAzureDatabaseNode.CustomLabelsEntry - nil, // 27: inventory.AddGenericNodeRequest.CustomLabelsEntry - nil, // 28: inventory.AddContainerNodeRequest.CustomLabelsEntry - nil, // 29: inventory.AddRemoteNodeRequest.CustomLabelsEntry - nil, // 30: inventory.AddRemoteRDSNodeRequest.CustomLabelsEntry - nil, // 31: inventory.AddRemoteAzureDatabaseNodeRequest.CustomLabelsEntry + (*AddNodeRequest)(nil), // 10: inventory.AddNodeRequest + (*AddNodeResponse)(nil), // 11: inventory.AddNodeResponse + (*AddGenericNodeRequest)(nil), // 12: inventory.AddGenericNodeRequest + (*AddGenericNodeResponse)(nil), // 13: inventory.AddGenericNodeResponse + (*AddContainerNodeRequest)(nil), // 14: inventory.AddContainerNodeRequest + (*AddContainerNodeResponse)(nil), // 15: inventory.AddContainerNodeResponse + (*AddRemoteNodeRequest)(nil), // 16: inventory.AddRemoteNodeRequest + (*AddRemoteNodeResponse)(nil), // 17: inventory.AddRemoteNodeResponse + (*AddRemoteRDSNodeRequest)(nil), // 18: inventory.AddRemoteRDSNodeRequest + (*AddRemoteRDSNodeResponse)(nil), // 19: inventory.AddRemoteRDSNodeResponse + (*AddRemoteAzureDatabaseNodeRequest)(nil), // 20: inventory.AddRemoteAzureDatabaseNodeRequest + (*AddRemoteAzureDatabaseNodeResponse)(nil), // 21: inventory.AddRemoteAzureDatabaseNodeResponse + (*RemoveNodeRequest)(nil), // 22: inventory.RemoveNodeRequest + (*RemoveNodeResponse)(nil), // 23: inventory.RemoveNodeResponse + nil, // 24: inventory.GenericNode.CustomLabelsEntry + nil, // 25: inventory.ContainerNode.CustomLabelsEntry + nil, // 26: inventory.RemoteNode.CustomLabelsEntry + nil, // 27: inventory.RemoteRDSNode.CustomLabelsEntry + nil, // 28: inventory.RemoteAzureDatabaseNode.CustomLabelsEntry + nil, // 29: inventory.AddGenericNodeRequest.CustomLabelsEntry + nil, // 30: inventory.AddContainerNodeRequest.CustomLabelsEntry + nil, // 31: inventory.AddRemoteNodeRequest.CustomLabelsEntry + nil, // 32: inventory.AddRemoteRDSNodeRequest.CustomLabelsEntry + nil, // 33: inventory.AddRemoteAzureDatabaseNodeRequest.CustomLabelsEntry } ) var file_inventorypb_nodes_proto_depIdxs = []int32{ - 22, // 0: inventory.GenericNode.custom_labels:type_name -> inventory.GenericNode.CustomLabelsEntry - 23, // 1: inventory.ContainerNode.custom_labels:type_name -> inventory.ContainerNode.CustomLabelsEntry - 24, // 2: inventory.RemoteNode.custom_labels:type_name -> inventory.RemoteNode.CustomLabelsEntry - 25, // 3: inventory.RemoteRDSNode.custom_labels:type_name -> inventory.RemoteRDSNode.CustomLabelsEntry - 26, // 4: inventory.RemoteAzureDatabaseNode.custom_labels:type_name -> inventory.RemoteAzureDatabaseNode.CustomLabelsEntry + 24, // 0: inventory.GenericNode.custom_labels:type_name -> inventory.GenericNode.CustomLabelsEntry + 25, // 1: inventory.ContainerNode.custom_labels:type_name -> inventory.ContainerNode.CustomLabelsEntry + 26, // 2: inventory.RemoteNode.custom_labels:type_name -> inventory.RemoteNode.CustomLabelsEntry + 27, // 3: inventory.RemoteRDSNode.custom_labels:type_name -> inventory.RemoteRDSNode.CustomLabelsEntry + 28, // 4: inventory.RemoteAzureDatabaseNode.custom_labels:type_name -> inventory.RemoteAzureDatabaseNode.CustomLabelsEntry 0, // 5: inventory.ListNodesRequest.node_type:type_name -> inventory.NodeType 1, // 6: inventory.ListNodesResponse.generic:type_name -> inventory.GenericNode 2, // 7: inventory.ListNodesResponse.container:type_name -> inventory.ContainerNode @@ -2275,37 +2585,49 @@ var file_inventorypb_nodes_proto_depIdxs = []int32{ 3, // 13: inventory.GetNodeResponse.remote:type_name -> inventory.RemoteNode 4, // 14: inventory.GetNodeResponse.remote_rds:type_name -> inventory.RemoteRDSNode 5, // 15: inventory.GetNodeResponse.remote_azure_database:type_name -> inventory.RemoteAzureDatabaseNode - 27, // 16: inventory.AddGenericNodeRequest.custom_labels:type_name -> inventory.AddGenericNodeRequest.CustomLabelsEntry - 1, // 17: inventory.AddGenericNodeResponse.generic:type_name -> inventory.GenericNode - 28, // 18: inventory.AddContainerNodeRequest.custom_labels:type_name -> inventory.AddContainerNodeRequest.CustomLabelsEntry - 2, // 19: inventory.AddContainerNodeResponse.container:type_name -> inventory.ContainerNode - 29, // 20: inventory.AddRemoteNodeRequest.custom_labels:type_name -> inventory.AddRemoteNodeRequest.CustomLabelsEntry - 3, // 21: inventory.AddRemoteNodeResponse.remote:type_name -> inventory.RemoteNode - 30, // 22: inventory.AddRemoteRDSNodeRequest.custom_labels:type_name -> inventory.AddRemoteRDSNodeRequest.CustomLabelsEntry - 4, // 23: inventory.AddRemoteRDSNodeResponse.remote_rds:type_name -> inventory.RemoteRDSNode - 31, // 24: inventory.AddRemoteAzureDatabaseNodeRequest.custom_labels:type_name -> inventory.AddRemoteAzureDatabaseNodeRequest.CustomLabelsEntry - 5, // 25: inventory.AddRemoteAzureDatabaseNodeResponse.remote_azure_database:type_name -> inventory.RemoteAzureDatabaseNode - 6, // 26: inventory.Nodes.ListNodes:input_type -> inventory.ListNodesRequest - 8, // 27: inventory.Nodes.GetNode:input_type -> inventory.GetNodeRequest - 10, // 28: inventory.Nodes.AddGenericNode:input_type -> inventory.AddGenericNodeRequest - 12, // 29: inventory.Nodes.AddContainerNode:input_type -> inventory.AddContainerNodeRequest - 14, // 30: inventory.Nodes.AddRemoteNode:input_type -> inventory.AddRemoteNodeRequest - 16, // 31: inventory.Nodes.AddRemoteRDSNode:input_type -> inventory.AddRemoteRDSNodeRequest - 18, // 32: inventory.Nodes.AddRemoteAzureDatabaseNode:input_type -> inventory.AddRemoteAzureDatabaseNodeRequest - 20, // 33: inventory.Nodes.RemoveNode:input_type -> inventory.RemoveNodeRequest - 7, // 34: inventory.Nodes.ListNodes:output_type -> inventory.ListNodesResponse - 9, // 35: inventory.Nodes.GetNode:output_type -> inventory.GetNodeResponse - 11, // 36: inventory.Nodes.AddGenericNode:output_type -> inventory.AddGenericNodeResponse - 13, // 37: inventory.Nodes.AddContainerNode:output_type -> inventory.AddContainerNodeResponse - 15, // 38: inventory.Nodes.AddRemoteNode:output_type -> inventory.AddRemoteNodeResponse - 17, // 39: inventory.Nodes.AddRemoteRDSNode:output_type -> inventory.AddRemoteRDSNodeResponse - 19, // 40: inventory.Nodes.AddRemoteAzureDatabaseNode:output_type -> inventory.AddRemoteAzureDatabaseNodeResponse - 21, // 41: inventory.Nodes.RemoveNode:output_type -> inventory.RemoveNodeResponse - 34, // [34:42] is the sub-list for method output_type - 26, // [26:34] is the sub-list for method input_type - 26, // [26:26] is the sub-list for extension type_name - 26, // [26:26] is the sub-list for extension extendee - 0, // [0:26] is the sub-list for field type_name + 12, // 16: inventory.AddNodeRequest.generic:type_name -> inventory.AddGenericNodeRequest + 14, // 17: inventory.AddNodeRequest.container:type_name -> inventory.AddContainerNodeRequest + 16, // 18: inventory.AddNodeRequest.remote:type_name -> inventory.AddRemoteNodeRequest + 18, // 19: inventory.AddNodeRequest.remote_rds:type_name -> inventory.AddRemoteRDSNodeRequest + 20, // 20: inventory.AddNodeRequest.remote_azure:type_name -> inventory.AddRemoteAzureDatabaseNodeRequest + 1, // 21: inventory.AddNodeResponse.generic:type_name -> inventory.GenericNode + 2, // 22: inventory.AddNodeResponse.container:type_name -> inventory.ContainerNode + 3, // 23: inventory.AddNodeResponse.remote:type_name -> inventory.RemoteNode + 4, // 24: inventory.AddNodeResponse.remote_rds:type_name -> inventory.RemoteRDSNode + 5, // 25: inventory.AddNodeResponse.remote_azure_database:type_name -> inventory.RemoteAzureDatabaseNode + 29, // 26: inventory.AddGenericNodeRequest.custom_labels:type_name -> inventory.AddGenericNodeRequest.CustomLabelsEntry + 1, // 27: inventory.AddGenericNodeResponse.generic:type_name -> inventory.GenericNode + 30, // 28: inventory.AddContainerNodeRequest.custom_labels:type_name -> inventory.AddContainerNodeRequest.CustomLabelsEntry + 2, // 29: inventory.AddContainerNodeResponse.container:type_name -> inventory.ContainerNode + 31, // 30: inventory.AddRemoteNodeRequest.custom_labels:type_name -> inventory.AddRemoteNodeRequest.CustomLabelsEntry + 3, // 31: inventory.AddRemoteNodeResponse.remote:type_name -> inventory.RemoteNode + 32, // 32: inventory.AddRemoteRDSNodeRequest.custom_labels:type_name -> inventory.AddRemoteRDSNodeRequest.CustomLabelsEntry + 4, // 33: inventory.AddRemoteRDSNodeResponse.remote_rds:type_name -> inventory.RemoteRDSNode + 33, // 34: inventory.AddRemoteAzureDatabaseNodeRequest.custom_labels:type_name -> inventory.AddRemoteAzureDatabaseNodeRequest.CustomLabelsEntry + 5, // 35: inventory.AddRemoteAzureDatabaseNodeResponse.remote_azure_database:type_name -> inventory.RemoteAzureDatabaseNode + 6, // 36: inventory.Nodes.ListNodes:input_type -> inventory.ListNodesRequest + 8, // 37: inventory.Nodes.GetNode:input_type -> inventory.GetNodeRequest + 10, // 38: inventory.Nodes.AddNode:input_type -> inventory.AddNodeRequest + 12, // 39: inventory.Nodes.AddGenericNode:input_type -> inventory.AddGenericNodeRequest + 14, // 40: inventory.Nodes.AddContainerNode:input_type -> inventory.AddContainerNodeRequest + 16, // 41: inventory.Nodes.AddRemoteNode:input_type -> inventory.AddRemoteNodeRequest + 18, // 42: inventory.Nodes.AddRemoteRDSNode:input_type -> inventory.AddRemoteRDSNodeRequest + 20, // 43: inventory.Nodes.AddRemoteAzureDatabaseNode:input_type -> inventory.AddRemoteAzureDatabaseNodeRequest + 22, // 44: inventory.Nodes.RemoveNode:input_type -> inventory.RemoveNodeRequest + 7, // 45: inventory.Nodes.ListNodes:output_type -> inventory.ListNodesResponse + 9, // 46: inventory.Nodes.GetNode:output_type -> inventory.GetNodeResponse + 11, // 47: inventory.Nodes.AddNode:output_type -> inventory.AddNodeResponse + 13, // 48: inventory.Nodes.AddGenericNode:output_type -> inventory.AddGenericNodeResponse + 15, // 49: inventory.Nodes.AddContainerNode:output_type -> inventory.AddContainerNodeResponse + 17, // 50: inventory.Nodes.AddRemoteNode:output_type -> inventory.AddRemoteNodeResponse + 19, // 51: inventory.Nodes.AddRemoteRDSNode:output_type -> inventory.AddRemoteRDSNodeResponse + 21, // 52: inventory.Nodes.AddRemoteAzureDatabaseNode:output_type -> inventory.AddRemoteAzureDatabaseNodeResponse + 23, // 53: inventory.Nodes.RemoveNode:output_type -> inventory.RemoveNodeResponse + 45, // [45:54] is the sub-list for method output_type + 36, // [36:45] is the sub-list for method input_type + 36, // [36:36] is the sub-list for extension type_name + 36, // [36:36] is the sub-list for extension extendee + 0, // [0:36] is the sub-list for field type_name } func init() { file_inventorypb_nodes_proto_init() } @@ -2423,7 +2745,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddGenericNodeRequest); i { + switch v := v.(*AddNodeRequest); i { case 0: return &v.state case 1: @@ -2435,7 +2757,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddGenericNodeResponse); i { + switch v := v.(*AddNodeResponse); i { case 0: return &v.state case 1: @@ -2447,7 +2769,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddContainerNodeRequest); i { + switch v := v.(*AddGenericNodeRequest); i { case 0: return &v.state case 1: @@ -2459,7 +2781,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddContainerNodeResponse); i { + switch v := v.(*AddGenericNodeResponse); i { case 0: return &v.state case 1: @@ -2471,7 +2793,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddRemoteNodeRequest); i { + switch v := v.(*AddContainerNodeRequest); i { case 0: return &v.state case 1: @@ -2483,7 +2805,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddRemoteNodeResponse); i { + switch v := v.(*AddContainerNodeResponse); i { case 0: return &v.state case 1: @@ -2495,7 +2817,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddRemoteRDSNodeRequest); i { + switch v := v.(*AddRemoteNodeRequest); i { case 0: return &v.state case 1: @@ -2507,7 +2829,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddRemoteRDSNodeResponse); i { + switch v := v.(*AddRemoteNodeResponse); i { case 0: return &v.state case 1: @@ -2519,7 +2841,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddRemoteAzureDatabaseNodeRequest); i { + switch v := v.(*AddRemoteRDSNodeRequest); i { case 0: return &v.state case 1: @@ -2531,7 +2853,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*AddRemoteAzureDatabaseNodeResponse); i { + switch v := v.(*AddRemoteRDSNodeResponse); i { case 0: return &v.state case 1: @@ -2543,7 +2865,7 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*RemoveNodeRequest); i { + switch v := v.(*AddRemoteAzureDatabaseNodeRequest); i { case 0: return &v.state case 1: @@ -2555,6 +2877,30 @@ func file_inventorypb_nodes_proto_init() { } } file_inventorypb_nodes_proto_msgTypes[20].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*AddRemoteAzureDatabaseNodeResponse); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inventorypb_nodes_proto_msgTypes[21].Exporter = func(v interface{}, i int) interface{} { + switch v := v.(*RemoveNodeRequest); i { + case 0: + return &v.state + case 1: + return &v.sizeCache + case 2: + return &v.unknownFields + default: + return nil + } + } + file_inventorypb_nodes_proto_msgTypes[22].Exporter = func(v interface{}, i int) interface{} { switch v := v.(*RemoveNodeResponse); i { case 0: return &v.state @@ -2574,13 +2920,27 @@ func file_inventorypb_nodes_proto_init() { (*GetNodeResponse_RemoteRds)(nil), (*GetNodeResponse_RemoteAzureDatabase)(nil), } + file_inventorypb_nodes_proto_msgTypes[9].OneofWrappers = []interface{}{ + (*AddNodeRequest_Generic)(nil), + (*AddNodeRequest_Container)(nil), + (*AddNodeRequest_Remote)(nil), + (*AddNodeRequest_RemoteRds)(nil), + (*AddNodeRequest_RemoteAzure)(nil), + } + file_inventorypb_nodes_proto_msgTypes[10].OneofWrappers = []interface{}{ + (*AddNodeResponse_Generic)(nil), + (*AddNodeResponse_Container)(nil), + (*AddNodeResponse_Remote)(nil), + (*AddNodeResponse_RemoteRds)(nil), + (*AddNodeResponse_RemoteAzureDatabase)(nil), + } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: file_inventorypb_nodes_proto_rawDesc, NumEnums: 1, - NumMessages: 31, + NumMessages: 33, NumExtensions: 0, NumServices: 1, }, diff --git a/api/inventorypb/nodes.pb.gw.go b/api/inventorypb/nodes.pb.gw.go index 91d1c6a5a5..9789ecfcb6 100644 --- a/api/inventorypb/nodes.pb.gw.go +++ b/api/inventorypb/nodes.pb.gw.go @@ -97,6 +97,38 @@ func local_request_Nodes_GetNode_0(ctx context.Context, marshaler runtime.Marsha return msg, metadata, err } +func request_Nodes_AddNode_0(ctx context.Context, marshaler runtime.Marshaler, client NodesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddNodeRequest + 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) + } + + msg, err := client.AddNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD)) + return msg, metadata, err +} + +func local_request_Nodes_AddNode_0(ctx context.Context, marshaler runtime.Marshaler, server NodesServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { + var protoReq AddNodeRequest + 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) + } + + msg, err := server.AddNode(ctx, &protoReq) + return msg, metadata, err +} + func request_Nodes_AddGenericNode_0(ctx context.Context, marshaler runtime.Marshaler, client NodesClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) { var protoReq AddGenericNodeRequest var metadata runtime.ServerMetadata @@ -342,6 +374,30 @@ func RegisterNodesHandlerServer(ctx context.Context, mux *runtime.ServeMux, serv forward_Nodes_GetNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle("POST", pattern_Nodes_AddNode_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) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/inventory.Nodes/AddNode", runtime.WithHTTPPathPattern("/v1/inventory/Nodes/Add")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := local_request_Nodes_AddNode_0(annotatedContext, inboundMarshaler, server, req, pathParams) + md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer()) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Nodes_AddNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle("POST", pattern_Nodes_AddGenericNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -568,6 +624,27 @@ func RegisterNodesHandlerClient(ctx context.Context, mux *runtime.ServeMux, clie forward_Nodes_GetNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) }) + mux.Handle("POST", pattern_Nodes_AddNode_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) + var err error + var annotatedContext context.Context + annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/inventory.Nodes/AddNode", runtime.WithHTTPPathPattern("/v1/inventory/Nodes/Add")) + if err != nil { + runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err) + return + } + resp, md, err := request_Nodes_AddNode_0(annotatedContext, inboundMarshaler, client, req, pathParams) + annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md) + if err != nil { + runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err) + return + } + + forward_Nodes_AddNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...) + }) + mux.Handle("POST", pattern_Nodes_AddGenericNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) { ctx, cancel := context.WithCancel(req.Context()) defer cancel() @@ -702,6 +779,8 @@ var ( pattern_Nodes_GetNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "inventory", "Nodes", "Get"}, "")) + pattern_Nodes_AddNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "inventory", "Nodes", "Add"}, "")) + pattern_Nodes_AddGenericNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "inventory", "Nodes", "AddGeneric"}, "")) pattern_Nodes_AddContainerNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 2, 3}, []string{"v1", "inventory", "Nodes", "AddContainer"}, "")) @@ -720,6 +799,8 @@ var ( forward_Nodes_GetNode_0 = runtime.ForwardResponseMessage + forward_Nodes_AddNode_0 = runtime.ForwardResponseMessage + forward_Nodes_AddGenericNode_0 = runtime.ForwardResponseMessage forward_Nodes_AddContainerNode_0 = runtime.ForwardResponseMessage diff --git a/api/inventorypb/nodes.pb.validate.go b/api/inventorypb/nodes.pb.validate.go index 84b7fe914d..79c6ccb2fd 100644 --- a/api/inventorypb/nodes.pb.validate.go +++ b/api/inventorypb/nodes.pb.validate.go @@ -1410,6 +1410,626 @@ var _ interface { ErrorName() string } = GetNodeResponseValidationError{} +// Validate checks the field values on AddNodeRequest with the rules defined in +// the proto definition for this message. If any rules are violated, the first +// error encountered is returned, or nil if there are no violations. +func (m *AddNodeRequest) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on AddNodeRequest with the rules defined +// in the proto definition for this message. If any rules are violated, the +// result is a list of violation errors wrapped in AddNodeRequestMultiError, +// or nil if none found. +func (m *AddNodeRequest) ValidateAll() error { + return m.validate(true) +} + +func (m *AddNodeRequest) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + switch v := m.Request.(type) { + case *AddNodeRequest_Generic: + if v == nil { + err := AddNodeRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetGeneric()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "Generic", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "Generic", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGeneric()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeRequestValidationError{ + field: "Generic", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeRequest_Container: + if v == nil { + err := AddNodeRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetContainer()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "Container", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "Container", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetContainer()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeRequestValidationError{ + field: "Container", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeRequest_Remote: + if v == nil { + err := AddNodeRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetRemote()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "Remote", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "Remote", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRemote()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeRequestValidationError{ + field: "Remote", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeRequest_RemoteRds: + if v == nil { + err := AddNodeRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetRemoteRds()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "RemoteRds", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "RemoteRds", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRemoteRds()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeRequestValidationError{ + field: "RemoteRds", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeRequest_RemoteAzure: + if v == nil { + err := AddNodeRequestValidationError{ + field: "Request", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetRemoteAzure()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "RemoteAzure", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeRequestValidationError{ + field: "RemoteAzure", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRemoteAzure()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeRequestValidationError{ + field: "RemoteAzure", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + + if len(errors) > 0 { + return AddNodeRequestMultiError(errors) + } + + return nil +} + +// AddNodeRequestMultiError is an error wrapping multiple validation errors +// returned by AddNodeRequest.ValidateAll() if the designated constraints +// aren't met. +type AddNodeRequestMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m AddNodeRequestMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m AddNodeRequestMultiError) AllErrors() []error { return m } + +// AddNodeRequestValidationError is the validation error returned by +// AddNodeRequest.Validate if the designated constraints aren't met. +type AddNodeRequestValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AddNodeRequestValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AddNodeRequestValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AddNodeRequestValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AddNodeRequestValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AddNodeRequestValidationError) ErrorName() string { return "AddNodeRequestValidationError" } + +// Error satisfies the builtin error interface +func (e AddNodeRequestValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAddNodeRequest.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AddNodeRequestValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AddNodeRequestValidationError{} + +// Validate checks the field values on AddNodeResponse with the rules defined +// in the proto definition for this message. If any rules are violated, the +// first error encountered is returned, or nil if there are no violations. +func (m *AddNodeResponse) Validate() error { + return m.validate(false) +} + +// ValidateAll checks the field values on AddNodeResponse with the rules +// defined in the proto definition for this message. If any rules are +// violated, the result is a list of violation errors wrapped in +// AddNodeResponseMultiError, or nil if none found. +func (m *AddNodeResponse) ValidateAll() error { + return m.validate(true) +} + +func (m *AddNodeResponse) validate(all bool) error { + if m == nil { + return nil + } + + var errors []error + + switch v := m.Node.(type) { + case *AddNodeResponse_Generic: + if v == nil { + err := AddNodeResponseValidationError{ + field: "Node", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetGeneric()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "Generic", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "Generic", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetGeneric()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeResponseValidationError{ + field: "Generic", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeResponse_Container: + if v == nil { + err := AddNodeResponseValidationError{ + field: "Node", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetContainer()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "Container", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "Container", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetContainer()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeResponseValidationError{ + field: "Container", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeResponse_Remote: + if v == nil { + err := AddNodeResponseValidationError{ + field: "Node", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetRemote()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "Remote", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "Remote", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRemote()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeResponseValidationError{ + field: "Remote", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeResponse_RemoteRds: + if v == nil { + err := AddNodeResponseValidationError{ + field: "Node", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetRemoteRds()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "RemoteRds", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "RemoteRds", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRemoteRds()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeResponseValidationError{ + field: "RemoteRds", + reason: "embedded message failed validation", + cause: err, + } + } + } + + case *AddNodeResponse_RemoteAzureDatabase: + if v == nil { + err := AddNodeResponseValidationError{ + field: "Node", + reason: "oneof value cannot be a typed-nil", + } + if !all { + return err + } + errors = append(errors, err) + } + + if all { + switch v := interface{}(m.GetRemoteAzureDatabase()).(type) { + case interface{ ValidateAll() error }: + if err := v.ValidateAll(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "RemoteAzureDatabase", + reason: "embedded message failed validation", + cause: err, + }) + } + case interface{ Validate() error }: + if err := v.Validate(); err != nil { + errors = append(errors, AddNodeResponseValidationError{ + field: "RemoteAzureDatabase", + reason: "embedded message failed validation", + cause: err, + }) + } + } + } else if v, ok := interface{}(m.GetRemoteAzureDatabase()).(interface{ Validate() error }); ok { + if err := v.Validate(); err != nil { + return AddNodeResponseValidationError{ + field: "RemoteAzureDatabase", + reason: "embedded message failed validation", + cause: err, + } + } + } + + default: + _ = v // ensures v is used + } + + if len(errors) > 0 { + return AddNodeResponseMultiError(errors) + } + + return nil +} + +// AddNodeResponseMultiError is an error wrapping multiple validation errors +// returned by AddNodeResponse.ValidateAll() if the designated constraints +// aren't met. +type AddNodeResponseMultiError []error + +// Error returns a concatenation of all the error messages it wraps. +func (m AddNodeResponseMultiError) Error() string { + var msgs []string + for _, err := range m { + msgs = append(msgs, err.Error()) + } + return strings.Join(msgs, "; ") +} + +// AllErrors returns a list of validation violation errors. +func (m AddNodeResponseMultiError) AllErrors() []error { return m } + +// AddNodeResponseValidationError is the validation error returned by +// AddNodeResponse.Validate if the designated constraints aren't met. +type AddNodeResponseValidationError struct { + field string + reason string + cause error + key bool +} + +// Field function returns field value. +func (e AddNodeResponseValidationError) Field() string { return e.field } + +// Reason function returns reason value. +func (e AddNodeResponseValidationError) Reason() string { return e.reason } + +// Cause function returns cause value. +func (e AddNodeResponseValidationError) Cause() error { return e.cause } + +// Key function returns key value. +func (e AddNodeResponseValidationError) Key() bool { return e.key } + +// ErrorName returns error name. +func (e AddNodeResponseValidationError) ErrorName() string { return "AddNodeResponseValidationError" } + +// Error satisfies the builtin error interface +func (e AddNodeResponseValidationError) Error() string { + cause := "" + if e.cause != nil { + cause = fmt.Sprintf(" | caused by: %v", e.cause) + } + + key := "" + if e.key { + key = "key for " + } + + return fmt.Sprintf( + "invalid %sAddNodeResponse.%s: %s%s", + key, + e.field, + e.reason, + cause) +} + +var _ error = AddNodeResponseValidationError{} + +var _ interface { + Field() string + Reason() string + Key() bool + Cause() error + ErrorName() string +} = AddNodeResponseValidationError{} + // Validate checks the field values on AddGenericNodeRequest with the rules // defined in the proto definition for this message. If any rules are // violated, the first error encountered is returned, or nil if there are no violations. diff --git a/api/inventorypb/nodes.proto b/api/inventorypb/nodes.proto index 8ad0c3d36f..e14a3446d0 100644 --- a/api/inventorypb/nodes.proto +++ b/api/inventorypb/nodes.proto @@ -98,9 +98,6 @@ message RemoteRDSNode { string az = 6; // Custom user-assigned labels. map custom_labels = 7; - // TODO https://jira.percona.com/browse/PMM-4314 - // string az = 8; - // string node_model = 9; } // RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes. @@ -153,6 +150,28 @@ message GetNodeResponse { } } +// Add any Node + +message AddNodeRequest { + oneof request { + AddGenericNodeRequest generic = 1; + AddContainerNodeRequest container = 2; + AddRemoteNodeRequest remote = 3; + AddRemoteRDSNodeRequest remote_rds = 4; + AddRemoteAzureDatabaseNodeRequest remote_azure = 5; + } +} + +message AddNodeResponse { + oneof node { + GenericNode generic = 1; + ContainerNode container = 2; + RemoteNode remote = 3; + RemoteRDSNode remote_rds = 4; + RemoteAzureDatabaseNode remote_azure_database = 5; + } +} + // Add Generic message AddGenericNodeRequest { @@ -175,6 +194,8 @@ message AddGenericNodeRequest { } message AddGenericNodeResponse { + option deprecated = true; + GenericNode generic = 1; } @@ -202,6 +223,8 @@ message AddContainerNodeRequest { } message AddContainerNodeResponse { + option deprecated = true; + ContainerNode container = 1; } @@ -223,6 +246,8 @@ message AddRemoteNodeRequest { } message AddRemoteNodeResponse { + option deprecated = true; + RemoteNode remote = 1; } @@ -244,6 +269,8 @@ message AddRemoteRDSNodeRequest { } message AddRemoteRDSNodeResponse { + option deprecated = true; + RemoteRDSNode remote_rds = 1; } @@ -265,6 +292,8 @@ message AddRemoteAzureDatabaseNodeRequest { } message AddRemoteAzureDatabaseNodeResponse { + option deprecated = true; + RemoteAzureDatabaseNode remote_azure_database = 1; } @@ -303,70 +332,91 @@ service Nodes { description: "Returns a single Node by ID." }; } - // AddGenericNode adds generic Node. + // AddNode adds any type of Node. + rpc AddNode(AddNodeRequest) returns (AddNodeResponse) { + option (google.api.http) = { + post: "/v1/inventory/Nodes/Add" + body: "*" + }; + option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { + summary: "Add Node" + description: "Adds a Node." + }; + } + // AddGenericNode adds a generic Node. rpc AddGenericNode(AddGenericNodeRequest) returns (AddGenericNodeResponse) { + option deprecated = true; option (google.api.http) = { post: "/v1/inventory/Nodes/AddGeneric" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Add Generic Node" - description: "Adds generic Node." + deprecated: true + summary: "Add a Generic Node" + description: "Adds a generic Node." }; } - // AddContainerNode adds Container Node. + // AddContainerNode adds a container Node. rpc AddContainerNode(AddContainerNodeRequest) returns (AddContainerNodeResponse) { + option deprecated = true; option (google.api.http) = { post: "/v1/inventory/Nodes/AddContainer" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Add Container Node" - description: "Adds container Node." + deprecated: true + summary: "Add a Container Node" + description: "Adds a container Node." }; } - // AddRemoteNode adds remote Node. + // AddRemoteNode adds a remote Node. rpc AddRemoteNode(AddRemoteNodeRequest) returns (AddRemoteNodeResponse) { + option deprecated = true; option (google.api.http) = { post: "/v1/inventory/Nodes/AddRemote" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Add Remote Node" - description: "Adds remote Node." + deprecated: true + summary: "Add a Remote Node" + description: "Adds a remote Node." }; } - // AddRemoteRDSNode adds remote RDS Node. + // AddRemoteRDSNode adds a remote RDS Node. rpc AddRemoteRDSNode(AddRemoteRDSNodeRequest) returns (AddRemoteRDSNodeResponse) { + option deprecated = true; option (google.api.http) = { post: "/v1/inventory/Nodes/AddRemoteRDS" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Add Remote RDS Node" - description: "Adds remote RDS Node." + deprecated: true + summary: "Add a Remote RDS Node" + description: "Adds a remote RDS Node." }; } - // AddRemoteAzureDatabaseNode adds remote Azure database Node. + // AddRemoteAzureDatabaseNode adds a remote Azure database Node. rpc AddRemoteAzureDatabaseNode(AddRemoteAzureDatabaseNodeRequest) returns (AddRemoteAzureDatabaseNodeResponse) { + option deprecated = true; option (google.api.http) = { post: "/v1/inventory/Nodes/AddRemoteAzureDatabase" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Add Remote Azure Database Node" - description: "Adds remote Azure database Node." + deprecated: true + summary: "Adda a Remote Azure Database Node" + description: "Adds a remote Azure database Node." }; } - // RemoveNode removes Node. + // RemoveNode removes a Node. rpc RemoveNode(RemoveNodeRequest) returns (RemoveNodeResponse) { option (google.api.http) = { post: "/v1/inventory/Nodes/Remove" body: "*" }; option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_operation) = { - summary: "Remove Node" - description: "Removes Node." + summary: "Remove a Node" + description: "Removes a Node." }; } } diff --git a/api/inventorypb/nodes_grpc.pb.go b/api/inventorypb/nodes_grpc.pb.go index 372069998c..1cf7c5bed6 100644 --- a/api/inventorypb/nodes_grpc.pb.go +++ b/api/inventorypb/nodes_grpc.pb.go @@ -22,6 +22,7 @@ const _ = grpc.SupportPackageIsVersion7 const ( Nodes_ListNodes_FullMethodName = "/inventory.Nodes/ListNodes" Nodes_GetNode_FullMethodName = "/inventory.Nodes/GetNode" + Nodes_AddNode_FullMethodName = "/inventory.Nodes/AddNode" Nodes_AddGenericNode_FullMethodName = "/inventory.Nodes/AddGenericNode" Nodes_AddContainerNode_FullMethodName = "/inventory.Nodes/AddContainerNode" Nodes_AddRemoteNode_FullMethodName = "/inventory.Nodes/AddRemoteNode" @@ -38,17 +39,24 @@ type NodesClient interface { ListNodes(ctx context.Context, in *ListNodesRequest, opts ...grpc.CallOption) (*ListNodesResponse, error) // GetNode returns a single Node by ID. GetNode(ctx context.Context, in *GetNodeRequest, opts ...grpc.CallOption) (*GetNodeResponse, error) - // AddGenericNode adds generic Node. + // AddNode adds any type of Node. + AddNode(ctx context.Context, in *AddNodeRequest, opts ...grpc.CallOption) (*AddNodeResponse, error) + // Deprecated: Do not use. + // AddGenericNode adds a generic Node. AddGenericNode(ctx context.Context, in *AddGenericNodeRequest, opts ...grpc.CallOption) (*AddGenericNodeResponse, error) - // AddContainerNode adds Container Node. + // Deprecated: Do not use. + // AddContainerNode adds a container Node. AddContainerNode(ctx context.Context, in *AddContainerNodeRequest, opts ...grpc.CallOption) (*AddContainerNodeResponse, error) - // AddRemoteNode adds remote Node. + // Deprecated: Do not use. + // AddRemoteNode adds a remote Node. AddRemoteNode(ctx context.Context, in *AddRemoteNodeRequest, opts ...grpc.CallOption) (*AddRemoteNodeResponse, error) - // AddRemoteRDSNode adds remote RDS Node. + // Deprecated: Do not use. + // AddRemoteRDSNode adds a remote RDS Node. AddRemoteRDSNode(ctx context.Context, in *AddRemoteRDSNodeRequest, opts ...grpc.CallOption) (*AddRemoteRDSNodeResponse, error) - // AddRemoteAzureDatabaseNode adds remote Azure database Node. + // Deprecated: Do not use. + // AddRemoteAzureDatabaseNode adds a remote Azure database Node. AddRemoteAzureDatabaseNode(ctx context.Context, in *AddRemoteAzureDatabaseNodeRequest, opts ...grpc.CallOption) (*AddRemoteAzureDatabaseNodeResponse, error) - // RemoveNode removes Node. + // RemoveNode removes a Node. RemoveNode(ctx context.Context, in *RemoveNodeRequest, opts ...grpc.CallOption) (*RemoveNodeResponse, error) } @@ -78,6 +86,16 @@ func (c *nodesClient) GetNode(ctx context.Context, in *GetNodeRequest, opts ...g return out, nil } +func (c *nodesClient) AddNode(ctx context.Context, in *AddNodeRequest, opts ...grpc.CallOption) (*AddNodeResponse, error) { + out := new(AddNodeResponse) + err := c.cc.Invoke(ctx, Nodes_AddNode_FullMethodName, in, out, opts...) + if err != nil { + return nil, err + } + return out, nil +} + +// Deprecated: Do not use. func (c *nodesClient) AddGenericNode(ctx context.Context, in *AddGenericNodeRequest, opts ...grpc.CallOption) (*AddGenericNodeResponse, error) { out := new(AddGenericNodeResponse) err := c.cc.Invoke(ctx, Nodes_AddGenericNode_FullMethodName, in, out, opts...) @@ -87,6 +105,7 @@ func (c *nodesClient) AddGenericNode(ctx context.Context, in *AddGenericNodeRequ return out, nil } +// Deprecated: Do not use. func (c *nodesClient) AddContainerNode(ctx context.Context, in *AddContainerNodeRequest, opts ...grpc.CallOption) (*AddContainerNodeResponse, error) { out := new(AddContainerNodeResponse) err := c.cc.Invoke(ctx, Nodes_AddContainerNode_FullMethodName, in, out, opts...) @@ -96,6 +115,7 @@ func (c *nodesClient) AddContainerNode(ctx context.Context, in *AddContainerNode return out, nil } +// Deprecated: Do not use. func (c *nodesClient) AddRemoteNode(ctx context.Context, in *AddRemoteNodeRequest, opts ...grpc.CallOption) (*AddRemoteNodeResponse, error) { out := new(AddRemoteNodeResponse) err := c.cc.Invoke(ctx, Nodes_AddRemoteNode_FullMethodName, in, out, opts...) @@ -105,6 +125,7 @@ func (c *nodesClient) AddRemoteNode(ctx context.Context, in *AddRemoteNodeReques return out, nil } +// Deprecated: Do not use. func (c *nodesClient) AddRemoteRDSNode(ctx context.Context, in *AddRemoteRDSNodeRequest, opts ...grpc.CallOption) (*AddRemoteRDSNodeResponse, error) { out := new(AddRemoteRDSNodeResponse) err := c.cc.Invoke(ctx, Nodes_AddRemoteRDSNode_FullMethodName, in, out, opts...) @@ -114,6 +135,7 @@ func (c *nodesClient) AddRemoteRDSNode(ctx context.Context, in *AddRemoteRDSNode return out, nil } +// Deprecated: Do not use. func (c *nodesClient) AddRemoteAzureDatabaseNode(ctx context.Context, in *AddRemoteAzureDatabaseNodeRequest, opts ...grpc.CallOption) (*AddRemoteAzureDatabaseNodeResponse, error) { out := new(AddRemoteAzureDatabaseNodeResponse) err := c.cc.Invoke(ctx, Nodes_AddRemoteAzureDatabaseNode_FullMethodName, in, out, opts...) @@ -140,17 +162,24 @@ type NodesServer interface { ListNodes(context.Context, *ListNodesRequest) (*ListNodesResponse, error) // GetNode returns a single Node by ID. GetNode(context.Context, *GetNodeRequest) (*GetNodeResponse, error) - // AddGenericNode adds generic Node. + // AddNode adds any type of Node. + AddNode(context.Context, *AddNodeRequest) (*AddNodeResponse, error) + // Deprecated: Do not use. + // AddGenericNode adds a generic Node. AddGenericNode(context.Context, *AddGenericNodeRequest) (*AddGenericNodeResponse, error) - // AddContainerNode adds Container Node. + // Deprecated: Do not use. + // AddContainerNode adds a container Node. AddContainerNode(context.Context, *AddContainerNodeRequest) (*AddContainerNodeResponse, error) - // AddRemoteNode adds remote Node. + // Deprecated: Do not use. + // AddRemoteNode adds a remote Node. AddRemoteNode(context.Context, *AddRemoteNodeRequest) (*AddRemoteNodeResponse, error) - // AddRemoteRDSNode adds remote RDS Node. + // Deprecated: Do not use. + // AddRemoteRDSNode adds a remote RDS Node. AddRemoteRDSNode(context.Context, *AddRemoteRDSNodeRequest) (*AddRemoteRDSNodeResponse, error) - // AddRemoteAzureDatabaseNode adds remote Azure database Node. + // Deprecated: Do not use. + // AddRemoteAzureDatabaseNode adds a remote Azure database Node. AddRemoteAzureDatabaseNode(context.Context, *AddRemoteAzureDatabaseNodeRequest) (*AddRemoteAzureDatabaseNodeResponse, error) - // RemoveNode removes Node. + // RemoveNode removes a Node. RemoveNode(context.Context, *RemoveNodeRequest) (*RemoveNodeResponse, error) mustEmbedUnimplementedNodesServer() } @@ -166,6 +195,10 @@ func (UnimplementedNodesServer) GetNode(context.Context, *GetNodeRequest) (*GetN return nil, status.Errorf(codes.Unimplemented, "method GetNode not implemented") } +func (UnimplementedNodesServer) AddNode(context.Context, *AddNodeRequest) (*AddNodeResponse, error) { + return nil, status.Errorf(codes.Unimplemented, "method AddNode not implemented") +} + func (UnimplementedNodesServer) AddGenericNode(context.Context, *AddGenericNodeRequest) (*AddGenericNodeResponse, error) { return nil, status.Errorf(codes.Unimplemented, "method AddGenericNode not implemented") } @@ -238,6 +271,24 @@ func _Nodes_GetNode_Handler(srv interface{}, ctx context.Context, dec func(inter return interceptor(ctx, in, info, handler) } +func _Nodes_AddNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { + in := new(AddNodeRequest) + if err := dec(in); err != nil { + return nil, err + } + if interceptor == nil { + return srv.(NodesServer).AddNode(ctx, in) + } + info := &grpc.UnaryServerInfo{ + Server: srv, + FullMethod: Nodes_AddNode_FullMethodName, + } + handler := func(ctx context.Context, req interface{}) (interface{}, error) { + return srv.(NodesServer).AddNode(ctx, req.(*AddNodeRequest)) + } + return interceptor(ctx, in, info, handler) +} + func _Nodes_AddGenericNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { in := new(AddGenericNodeRequest) if err := dec(in); err != nil { @@ -361,6 +412,10 @@ var Nodes_ServiceDesc = grpc.ServiceDesc{ MethodName: "GetNode", Handler: _Nodes_GetNode_Handler, }, + { + MethodName: "AddNode", + Handler: _Nodes_AddNode_Handler, + }, { MethodName: "AddGenericNode", Handler: _Nodes_AddGenericNode_Handler, diff --git a/api/managementpb/json/client/rds/add_rds_responses.go b/api/managementpb/json/client/rds/add_rds_responses.go index 0c5c17da70..739b758db0 100644 --- a/api/managementpb/json/client/rds/add_rds_responses.go +++ b/api/managementpb/json/client/rds/add_rds_responses.go @@ -1219,10 +1219,6 @@ type AddRDSOKBodyNode struct { Az string `json:"az,omitempty"` // Custom user-assigned labels. - // - // TODO https://jira.percona.com/browse/PMM-4314 - // string az = 8; - // string node_model = 9; CustomLabels map[string]string `json:"custom_labels,omitempty"` } diff --git a/api/managementpb/json/managementpb.json b/api/managementpb/json/managementpb.json index b5c9de7585..57b8c1da00 100644 --- a/api/managementpb/json/managementpb.json +++ b/api/managementpb/json/managementpb.json @@ -5407,7 +5407,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" diff --git a/api/swagger/swagger-dev.json b/api/swagger/swagger-dev.json index 8801f4cba5..af4af60aaa 100644 --- a/api/swagger/swagger-dev.json +++ b/api/swagger/swagger-dev.json @@ -13307,14 +13307,548 @@ } } }, + "/v1/inventory/Nodes/Add": { + "post": { + "description": "Adds a Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Node", + "operationId": "AddNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "generic": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 4 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 5 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 6 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + } + }, + "x-order": 0 + }, + "container": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id of the Generic Node where this Container Node runs.", + "type": "string", + "x-order": 2 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 3 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 4 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 5 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 6 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + }, + "x-order": 1 + }, + "remote": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + } + }, + "x-order": 2 + }, + "remote_rds": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 1 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + } + }, + "x-order": 3 + }, + "remote_azure": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 1 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + } + }, + "x-order": 4 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "generic": { + "description": "GenericNode represents a bare metal server or virtual machine.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 3 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 4 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 5 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 6 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + }, + "x-order": 0 + }, + "container": { + "description": "ContainerNode represents a Docker container.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "machine_id": { + "description": "Linux machine-id of the Generic Node where this Container Node runs.", + "type": "string", + "x-order": 3 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + } + }, + "x-order": 1 + }, + "remote": { + "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + } + }, + "x-order": 2 + }, + "remote_rds": { + "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + } + }, + "x-order": 3 + }, + "remote_azure_database": { + "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + } + }, + "x-order": 4 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "x-order": 0 + } + }, + "additionalProperties": false + }, + "x-order": 2 + } + } + } + } + } + } + }, "/v1/inventory/Nodes/AddContainer": { "post": { - "description": "Adds container Node.", + "description": "Adds a container Node.", "tags": [ "Nodes" ], - "summary": "Add Container Node", + "summary": "Add a Container Node", "operationId": "AddContainerNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -13480,12 +14014,13 @@ }, "/v1/inventory/Nodes/AddGeneric": { "post": { - "description": "Adds generic Node.", + "description": "Adds a generic Node.", "tags": [ "Nodes" ], - "summary": "Add Generic Node", + "summary": "Add a Generic Node", "operationId": "AddGenericNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -13641,12 +14176,13 @@ }, "/v1/inventory/Nodes/AddRemote": { "post": { - "description": "Adds remote Node.", + "description": "Adds a remote Node.", "tags": [ "Nodes" ], - "summary": "Add Remote Node", + "summary": "Add a Remote Node", "operationId": "AddRemoteNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -13782,12 +14318,13 @@ }, "/v1/inventory/Nodes/AddRemoteAzureDatabase": { "post": { - "description": "Adds remote Azure database Node.", + "description": "Adds a remote Azure database Node.", "tags": [ "Nodes" ], - "summary": "Add Remote Azure Database Node", + "summary": "Adda a Remote Azure Database Node", "operationId": "AddRemoteAzureDatabaseNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -13923,12 +14460,13 @@ }, "/v1/inventory/Nodes/AddRemoteRDS": { "post": { - "description": "Adds remote RDS Node.", + "description": "Adds a remote RDS Node.", "tags": [ "Nodes" ], - "summary": "Add Remote RDS Node", + "summary": "Add a Remote RDS Node", "operationId": "AddRemoteRDSNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -14015,7 +14553,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -14288,7 +14826,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -14626,7 +15164,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -14724,11 +15262,11 @@ }, "/v1/inventory/Nodes/Remove": { "post": { - "description": "Removes Node.", + "description": "Removes a Node.", "tags": [ "Nodes" ], - "summary": "Remove Node", + "summary": "Remove a Node", "operationId": "RemoveNode", "parameters": [ { @@ -28232,7 +28770,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" diff --git a/api/swagger/swagger.json b/api/swagger/swagger.json index f1e0ccb21b..13fd52ea88 100644 --- a/api/swagger/swagger.json +++ b/api/swagger/swagger.json @@ -10463,14 +10463,548 @@ } } }, + "/v1/inventory/Nodes/Add": { + "post": { + "description": "Adds a Node.", + "tags": [ + "Nodes" + ], + "summary": "Add Node", + "operationId": "AddNode", + "parameters": [ + { + "name": "body", + "in": "body", + "required": true, + "schema": { + "type": "object", + "properties": { + "generic": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 2 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 3 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 4 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 5 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 6 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 7 + } + }, + "x-order": 0 + }, + "container": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "machine_id": { + "description": "Linux machine-id of the Generic Node where this Container Node runs.", + "type": "string", + "x-order": 2 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 3 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 4 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 5 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 6 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + }, + "x-order": 1 + }, + "remote": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 1 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + } + }, + "x-order": 2 + }, + "remote_rds": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 1 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + } + }, + "x-order": 3 + }, + "remote_azure": { + "type": "object", + "properties": { + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 0 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 1 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 2 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 3 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 4 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 5 + } + }, + "x-order": 4 + } + } + } + } + ], + "responses": { + "200": { + "description": "A successful response.", + "schema": { + "type": "object", + "properties": { + "generic": { + "description": "GenericNode represents a bare metal server or virtual machine.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "machine_id": { + "description": "Linux machine-id.", + "type": "string", + "x-order": 3 + }, + "distro": { + "description": "Linux distribution name and version.", + "type": "string", + "x-order": 4 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 5 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 6 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 7 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 8 + } + }, + "x-order": 0 + }, + "container": { + "description": "ContainerNode represents a Docker container.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "machine_id": { + "description": "Linux machine-id of the Generic Node where this Container Node runs.", + "type": "string", + "x-order": 3 + }, + "container_id": { + "description": "Container identifier. If specified, must be a unique Docker container identifier.", + "type": "string", + "x-order": 4 + }, + "container_name": { + "description": "Container name.", + "type": "string", + "x-order": 5 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 6 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 7 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 8 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 9 + } + }, + "x-order": 1 + }, + "remote": { + "description": "RemoteNode represents generic remote Node. It's a node where we don't run pmm-agents. Only external exporters can run on Remote Nodes.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "Node address (DNS name or IP).", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + } + }, + "x-order": 2 + }, + "remote_rds": { + "description": "RemoteRDSNode represents remote RDS Node. Agents can't run on Remote RDS Nodes.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + } + }, + "x-order": 3 + }, + "remote_azure_database": { + "description": "RemoteAzureDatabaseNode represents remote AzureDatabase Node. Agents can't run on Remote AzureDatabase Nodes.", + "type": "object", + "properties": { + "node_id": { + "description": "Unique randomly generated instance identifier.", + "type": "string", + "x-order": 0 + }, + "node_name": { + "description": "Unique across all Nodes user-defined name.", + "type": "string", + "x-order": 1 + }, + "address": { + "description": "DB instance identifier.", + "type": "string", + "x-order": 2 + }, + "node_model": { + "description": "Node model.", + "type": "string", + "x-order": 3 + }, + "region": { + "description": "Node region.", + "type": "string", + "x-order": 4 + }, + "az": { + "description": "Node availability zone.", + "type": "string", + "x-order": 5 + }, + "custom_labels": { + "description": "Custom user-assigned labels.", + "type": "object", + "additionalProperties": { + "type": "string" + }, + "x-order": 6 + } + }, + "x-order": 4 + } + } + } + }, + "default": { + "description": "An unexpected error response.", + "schema": { + "type": "object", + "properties": { + "code": { + "type": "integer", + "format": "int32", + "x-order": 0 + }, + "message": { + "type": "string", + "x-order": 1 + }, + "details": { + "type": "array", + "items": { + "type": "object", + "properties": { + "@type": { + "type": "string", + "x-order": 0 + } + }, + "additionalProperties": false + }, + "x-order": 2 + } + } + } + } + } + } + }, "/v1/inventory/Nodes/AddContainer": { "post": { - "description": "Adds container Node.", + "description": "Adds a container Node.", "tags": [ "Nodes" ], - "summary": "Add Container Node", + "summary": "Add a Container Node", "operationId": "AddContainerNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -10636,12 +11170,13 @@ }, "/v1/inventory/Nodes/AddGeneric": { "post": { - "description": "Adds generic Node.", + "description": "Adds a generic Node.", "tags": [ "Nodes" ], - "summary": "Add Generic Node", + "summary": "Add a Generic Node", "operationId": "AddGenericNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -10797,12 +11332,13 @@ }, "/v1/inventory/Nodes/AddRemote": { "post": { - "description": "Adds remote Node.", + "description": "Adds a remote Node.", "tags": [ "Nodes" ], - "summary": "Add Remote Node", + "summary": "Add a Remote Node", "operationId": "AddRemoteNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -10938,12 +11474,13 @@ }, "/v1/inventory/Nodes/AddRemoteAzureDatabase": { "post": { - "description": "Adds remote Azure database Node.", + "description": "Adds a remote Azure database Node.", "tags": [ "Nodes" ], - "summary": "Add Remote Azure Database Node", + "summary": "Adda a Remote Azure Database Node", "operationId": "AddRemoteAzureDatabaseNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -11079,12 +11616,13 @@ }, "/v1/inventory/Nodes/AddRemoteRDS": { "post": { - "description": "Adds remote RDS Node.", + "description": "Adds a remote RDS Node.", "tags": [ "Nodes" ], - "summary": "Add Remote RDS Node", + "summary": "Add a Remote RDS Node", "operationId": "AddRemoteRDSNode", + "deprecated": true, "parameters": [ { "name": "body", @@ -11171,7 +11709,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -11444,7 +11982,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -11782,7 +12320,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" @@ -11880,11 +12418,11 @@ }, "/v1/inventory/Nodes/Remove": { "post": { - "description": "Removes Node.", + "description": "Removes a Node.", "tags": [ "Nodes" ], - "summary": "Remove Node", + "summary": "Remove a Node", "operationId": "RemoveNode", "parameters": [ { @@ -19401,7 +19939,7 @@ "x-order": 5 }, "custom_labels": { - "description": "Custom user-assigned labels.\n\nTODO https://jira.percona.com/browse/PMM-4314\n string az = 8;\n string node_model = 9;", + "description": "Custom user-assigned labels.", "type": "object", "additionalProperties": { "type": "string" diff --git a/docs/api/addnode.md b/docs/api/addnode.md new file mode 100644 index 0000000000..2b177c72bf --- /dev/null +++ b/docs/api/addnode.md @@ -0,0 +1,69 @@ +--- +slug: 'addnode' +--- + +## Add a Node + +This section describes how to add a Node of any type to the inventory. + +In PMM versions prior to 2.40.0, we featured a separate API call for each Node type. Starting with PMM 2.40.0, we have a single API call for all Node types. The API call is `Add` and the Node type is specified in the `node_type` field. The `node_type` field is required. Along with this single API endpoint, we are deprecating the separate API calls for each Node type. + +Let's see how to add a Node of type `GENERIC_NODE` using the old and new API calls. + +Old API call: + +````bash: + +```bash +curl --insecure -X POST \ + -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ + -H 'Accept: application/json' \ + -H 'Content-Type: application/json' \ + --url https://127.0.0.1/v1/inventory/Nodes/AddGeneric \ + --data ' +{ + "node_name": "mysql-sales-db-prod-1", + "region": "us-east-1", + "az": "us-east-1a", + "address": "209.0.25.100", + "custom_labels": { + "environment": "sales-prod", + "department": "sales" + } +} +' +```` + +New API call: + +```bash +curl --insecure -X POST \ + -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ + -H 'Accept: application/json' \ + -H 'Content-Type: application/json' \ + --url https://127.0.0.1/v1/inventory/Nodes/Add \ + --data ' +{ + "generic": { + "node_name": "mysql-sales-db-prod-1", + "region": "us-east-1", + "az": "us-east-1a", + "address": "209.0.25.100", + "custom_labels": { + "environment": "sales-prod", + "department": "sales" + } + } +} +' +``` + +To get the authentication token, please visit [this page](ref:authentication). + +You can choose from the following Node types: + +- GENERIC_NODE: `generic` +- CONTAINER_NODE: `container` +- REMOTE_NODE: `remote` +- REMOTE_RDS_NODE: `remote_rds` +- REMOTE_AZURE_DATABASE_NODE: `remote_azure` diff --git a/docs/api/adhoc-backup.md b/docs/api/adhoc-backup.md index 4988cf9c3a..fcd94af324 100644 --- a/docs/api/adhoc-backup.md +++ b/docs/api/adhoc-backup.md @@ -4,16 +4,14 @@ slug: 'adhoc-backup' ## Ad hoc Backup -PMM can backup the monitored servers. +PMM can backup the monitored servers. This section describes making ad hoc backups from a service. - ### Creating a Backup Here is an example of a Curl API call to create a backup: - ```bash curl --insecure -X POST -H 'Authorization: Bearer XXXXX' \ --request POST \ @@ -32,9 +30,8 @@ curl --insecure -X POST -H 'Authorization: Bearer XXXXX' \ ' ``` -You require an authentication string which is described [here](ref:authentication). +You require an authentication token, which is described [here](ref:authentication). Also, you require the [service_id](ref:listservices) and [location_id](ref:listlocations). -You can choose a `name` and `description` for the backup. You can also configure `retry_interval` and `retries` if required. - +You can choose a `name` and `description` for the backup. You can also configure `retry_interval` and `retries` if required. diff --git a/docs/api/authentication.md b/docs/api/authentication.md index 4e04f11d1a..2379589217 100644 --- a/docs/api/authentication.md +++ b/docs/api/authentication.md @@ -23,7 +23,7 @@ Let's assume the username is `admin` and the password is also `admin`. Then the ```bash curl -X GET -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ - -H 'Content-Type: application/json' https://127.0.0.1/v1/version + -H 'Content-Type: application/json' https://127.0.0.1/v1/version ``` If you use `curl` to make API calls, a simple equivalent to the command above is: @@ -34,19 +34,18 @@ curl -X GET -u admin:admin -H 'Content-Type: application/json' https://127.0.0.1 ### Bearer Authentication -Bearer authentication (also called token authentication) is an HTTP authentication scheme that involves security tokens called bearer tokens. The bearer token is a cryptic API key, which can be generated by the server admin from the Settings UI or via a respective API call (read more about how to generate an API key). The client must send the API key in the `Authorization` header when making requests to protected resources: +Bearer authentication (also called token authentication) is an HTTP authentication scheme that involves security tokens called bearer tokens. The bearer token is a cryptic API key, which can be generated by the server admin from the Settings UI or via a respective API call (read more about how to generate an API key). The client must send the API key in the `Authorization` header when making requests to protected resources: ```bash curl -X GET -H 'Authorization: Bearer eyJrIjoiUXRkeDNMS1g1bFVyY0tUj1o0SmhBc3g4QUdTRVAwekoiLCJuIjoicG1tLXRlc3QiLCJpZCI6MX0=' \ - -H 'Content-Type: application/json' https://127.0.0.1/v1/version + -H 'Content-Type: application/json' https://127.0.0.1/v1/version ``` You can use the API key in basic authentication as well: ```bash curl -X GET -H 'Content-Type: application/json' \ -https://api_key:eyJrIjoiUXRkeDNMS1g1bFVyY0tUj1o0SmhBc3g4QUdTRVAwekoiLCJuIjoicG1tLXRlc3QiLCJpZCI6MX0=@127.0.0.1/v1/version - + https://api_key:eyJrIjoiUXRkeDNMS1g1bFVyY0tUj1o0SmhBc3g4QUdTRVAwekoiLCJuIjoicG1tLXRlc3QiLCJpZCI6MX0=@127.0.0.1/v1/version ``` ### Protecting Credentials @@ -58,11 +57,13 @@ In the previous examples, the credentials can be gleaned from the shell history It is possible to hide from the shell history: bash + ```bash set +o history ``` zsh + ```zsh SAVEHIST=0 ``` @@ -78,16 +79,19 @@ password admin ``` This can then be used as follows: + ```bash curl --netrc -X GET -H 'Content-Type: application/json' https://127.0.0.1/v1/version ``` Should you wish to use a different file then the `--netrc-file` option needs to be used. If we have the credentials stored in `~/.netrc-pmm` then the command would become: + ```bash curl --netrc --netrc-file ~/.netrc-pmm -X GET -H 'Content-Type: application/json' https://127.0.0.1/v1/version ``` You can use API keys in this way too, for example: + ``` machine 127.0.0.1 login api_key diff --git a/docs/api/listlocations.md b/docs/api/listlocations.md index 0053a47bcf..63d0187575 100644 --- a/docs/api/listlocations.md +++ b/docs/api/listlocations.md @@ -4,14 +4,14 @@ slug: 'listlocations' ## List Locations -The following Curl API call will list all the available Locations: +The following API call will list all the available Locations: ```bash -curl --insecure -X POST -H 'Authorization: Bearer XXXXX' \ - --request POST \ - --url https://127.0.0.1/v1/management/backup/Locations/List \ - --header 'Accept: application/json' \ - --header 'Content-Type: application/json' +curl --insecure -X POST \ + -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ + -H 'Accept: application/json' \ + -H 'Content-Type: application/json' \ + --url https://127.0.0.1/v1/management/backup/Locations/List \ ``` -You will need the [authetication string](ref:authentication). \ No newline at end of file +You will need the [authetication token](ref:authentication). diff --git a/docs/api/listnodes.md b/docs/api/listnodes.md index 6a45b229cb..ba5740e3e5 100644 --- a/docs/api/listnodes.md +++ b/docs/api/listnodes.md @@ -4,26 +4,25 @@ slug: 'listnodes' ## List Nodes -This section describes listing the Nodes in the inventory. +This section describes how to list PMM Inventory Nodes. Example: + ```bash -curl --insecure -X POST -H 'Authorization: Bearer XXXXX' - --request POST - --url https://127.0.0.1/v1/inventory/Nodes/List - --header 'Accept: application/json' - --header 'Content-Type: application/json' - --data ' -{ - "node_type": "GENERIC_NODE" -} -' +curl --insecure -X POST \ + -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ + -H 'Accept: application/json' \ + -H 'Content-Type: application/json' \ + --url https://127.0.0.1/v1/inventory/Nodes/List \ + --data '{"node_type": "GENERIC_NODE"}' ``` -Firstly, get the [authentication string](ref:authentication). - -Then, choose from the following Node types: -`NODE_TYPE_INVALID, GENERIC_NODE, CONTAINER_NODE, REMOTE_NODE, REMOTE_RDS_NODE, REMOTE_AZURE_DATABASE_NODE` - +First, get the [authentication token](ref:authentication). +Then, choose from the following Node types: +- GENERIC_NODE +- CONTAINER_NODE +- REMOTE_NODE +- REMOTE_RDS_NODE +- REMOTE_AZURE_DATABASE_NODE` diff --git a/docs/api/listservices.md b/docs/api/listservices.md index b95bed1f1f..51d79dcb19 100644 --- a/docs/api/listservices.md +++ b/docs/api/listservices.md @@ -7,25 +7,31 @@ slug: 'listservices' The following API call lists the available services on a Node: ```bash -curl --insecure -X POST -H 'Authorization: Bearer XXXXX' \ - --request POST \ - --url https://127.0.0.1/v1/inventory/Services/List \ - --header 'Accept: application/json' \ - --header 'Content-Type: application/json' \ - --data ' +curl --insecure -X POST \ + -H 'Authorization: Basic YWRtaW46YWRtaW4=' \ + -H 'Accept: application/json' \ + -H 'Content-Type: application/json' \ + --url https://127.0.0.1/v1/inventory/Services/List \ + --data ' { "node_id": "/node_id/XXXXX", "service_type": "MYSQL_SERVICE" }' ``` -Firstly, get the [authentication string](ref:authentication). +First, get the [authentication token](ref:authentication). -Then, you require the [node_id](ref:listnodes). +Then, you need to know the [node_id](ref:listnodes). Choose the `service_type` that you want to list. The options are: -`SERVICE_TYPE_INVALID, MYSQL_SERVICE, MONGODB_SERVICE, POSTGRESQL_SERVICE, PROXYSQL_SERVICE, HAPROXY_SERVICE, EXTERNAL_SERVICE` + +- MYSQL_SERVICE +- MONGODB_SERVICE +- POSTGRESQL_SERVICE +- PROXYSQL_SERVICE +- HAPROXY_SERVICE +- EXTERNAL_SERVICE If you prefer to get all services running on the node, you can omit the `service_type` parameter. -However, calling the same endpoint without any parameters will return all services known to this PMM instance. +Otherwise, calling the same endpoint with no parameters will return all services known to this PMM instance. diff --git a/docs/process/tech_stack.md b/docs/process/tech_stack.md index 1785731eba..a5778b127d 100644 --- a/docs/process/tech_stack.md +++ b/docs/process/tech_stack.md @@ -10,14 +10,14 @@ Currently, our development team has fewer people than components/repositories. I - [protobuf v3](https://developers.google.com/protocol-buffers/) gives us [strongly-typed](https://developers.google.com/protocol-buffers/docs/proto3) serialization format with good [forward- and backward-compatibility](https://developers.google.com/protocol-buffers/docs/gotutorial#extending-a-protocol-buffer), [canonical mapping to and from JSON](https://developers.google.com/protocol-buffers/docs/proto3#json), and a large ecosystem of libraries and tools. We don't have to write code to work with it because there are code generators for a lot of languages. - [gRPC](https://grpc.io/) extends protobuf with RPC mechanism. Both single requests/responses and bi-directional streams are supported. Error handling is built-in. Again, there are code generators for both client- and server-side code, so we don't have to write it by ourselves. -- [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) takes gRPC specification and generates code for HTTP JSON API server-side wrapper for it. It also generates [Swagger](https://swagger.io/) specification from protocol specification and annotations, with documentation from comments. In turn, it is used to generate client-side code for environments where gRPC is not yet supported natively (e.g. web browser). No manual writing of serialization and communication code, and documentation with examples and interactive tools – gRPC specification becomes the single source of truth. +- [grpc-gateway](https://github.com/grpc-ecosystem/grpc-gateway) takes gRPC specification and generates code for HTTP JSON API server-side wrapper for it. It also generates [Swagger](https://swagger.io/) specification from protocol specification and annotations, with documentation built up from comments. In turn, it is used to generate client-side code for environments where gRPC is not yet supported natively (e.g. web browser). No manual writing of serialization and communication code, and documentation with examples and interactive tools – gRPC specification becomes the single source of truth. - [logrus](https://github.com/sirupsen/logrus) or stdlib `log` package should be used for logging. Always log to unbuffered stderr, let process supervisor do the rest. - [prometheus client](https://github.com/prometheus/client_golang) is used for exposing internal metrics of application and gRPC library. - [testify](https://github.com/stretchr/testify) or stdlib `testing` package should be used for writing tests. Testify should be used only for `assert` and `require` packages – suites here have some problems with logging and parallel tests. Common setups and teardowns should be implemented with `testing` [subtests](https://golang.org/pkg/testing/#hdr-Subtests_and_Sub_benchmarks). - [golangci-lint](https://github.com/golangci/golangci-lint) is used for static code checks. - [gocov.io](http://gocov.io/) and [gocoverutil](https://github.com/AlekSi/gocoverutil) gather code coverage metrics. - [Docker Compose](https://docs.docker.com/compose/) is used for a local development environment and in CI. -- [Kong](https://github.com/alecthomas/kong) for pmm CLI and [kingpin.v2](http://gopkg.in/alecthomas/kingpin.v2) for exporters and some other code. Use [Kong](https://github.com/alecthomas/kong) if you need some new CLI or need to make significant changes to the old `kingpin.v2` CLI. +- [Kong](https://github.com/alecthomas/kong) for PMM CLI and [kingpin.v2](http://gopkg.in/alecthomas/kingpin.v2) for exporters and some other code. Use [Kong](https://github.com/alecthomas/kong) if you want to contribute a brand new CLI or need to make significant changes to the old `kingpin.v2`-based CLI. - [go modules](https://go.dev/ref/mod#introduction) for vendoring. ## Open questions diff --git a/managed/services/inventory/grpc/nodes_server.go b/managed/services/inventory/grpc/nodes_server.go index ba08800ad8..12fafcce8d 100644 --- a/managed/services/inventory/grpc/nodes_server.go +++ b/managed/services/inventory/grpc/nodes_server.go @@ -106,6 +106,10 @@ func (s *nodesServer) GetNode(ctx context.Context, req *inventorypb.GetNodeReque return res, nil } +func (s *nodesServer) AddNode(ctx context.Context, req *inventorypb.AddNodeRequest) (*inventorypb.AddNodeResponse, error) { + return s.svc.AddNode(ctx, req) +} + // AddGenericNode adds Generic Node. func (s *nodesServer) AddGenericNode(ctx context.Context, req *inventorypb.AddGenericNodeRequest) (*inventorypb.AddGenericNodeResponse, error) { node, err := s.svc.AddGenericNode(ctx, req) diff --git a/managed/services/inventory/nodes.go b/managed/services/inventory/nodes.go index 10516dfd2d..66bbd95c54 100644 --- a/managed/services/inventory/nodes.go +++ b/managed/services/inventory/nodes.go @@ -46,11 +46,9 @@ func NewNodesService(db *reform.DB, r agentsRegistry, state agentsStateUpdater, } // List returns a list of all Nodes. -// -//nolint:unparam func (s *NodesService) List(ctx context.Context, filters models.NodeFilters) ([]inventorypb.Node, error) { var nodes []*models.Node - e := s.db.InTransaction(func(tx *reform.TX) error { + e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { var err error nodes, err = models.FindNodes(tx.Querier, filters) return err @@ -70,9 +68,9 @@ func (s *NodesService) List(ctx context.Context, filters models.NodeFilters) ([] } // Get returns a single Node by ID. -func (s *NodesService) Get(ctx context.Context, req *inventorypb.GetNodeRequest) (inventorypb.Node, error) { //nolint:unparam,ireturn +func (s *NodesService) Get(ctx context.Context, req *inventorypb.GetNodeRequest) (inventorypb.Node, error) { //nolint:ireturn modelNode := &models.Node{} - e := s.db.InTransaction(func(tx *reform.TX) error { + e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { var err error modelNode, err = models.FindNodeByID(tx.Querier, req.NodeId) if err != nil { @@ -92,9 +90,49 @@ func (s *NodesService) Get(ctx context.Context, req *inventorypb.GetNodeRequest) return node, nil } +// AddNode adds any type of Node. +func (s *NodesService) AddNode(ctx context.Context, req *inventorypb.AddNodeRequest) (*inventorypb.AddNodeResponse, error) { + res := &inventorypb.AddNodeResponse{} + + switch req.Request.(type) { + case *inventorypb.AddNodeRequest_Generic: + node, err := s.AddGenericNode(ctx, req.GetGeneric()) + if err != nil { + return nil, err + } + res.Node = &inventorypb.AddNodeResponse_Generic{Generic: node} + case *inventorypb.AddNodeRequest_Container: + node, err := s.AddContainerNode(ctx, req.GetContainer()) + if err != nil { + return nil, err + } + res.Node = &inventorypb.AddNodeResponse_Container{Container: node} + case *inventorypb.AddNodeRequest_Remote: + node, err := s.AddRemoteNode(ctx, req.GetRemote()) + if err != nil { + return nil, err + } + res.Node = &inventorypb.AddNodeResponse_Remote{Remote: node} + case *inventorypb.AddNodeRequest_RemoteRds: + node, err := s.AddRemoteRDSNode(ctx, req.GetRemoteRds()) + if err != nil { + return nil, err + } + res.Node = &inventorypb.AddNodeResponse_RemoteRds{RemoteRds: node} + case *inventorypb.AddNodeRequest_RemoteAzure: + node, err := s.AddRemoteAzureDatabaseNode(ctx, req.GetRemoteAzure()) + if err != nil { + return nil, err + } + res.Node = &inventorypb.AddNodeResponse_RemoteAzureDatabase{RemoteAzureDatabase: node} + default: + return nil, errors.Errorf("invalid request %v", req.GetRequest()) + } + + return res, nil +} + // AddGenericNode adds Generic Node. -// -//nolint:unparam func (s *NodesService) AddGenericNode(ctx context.Context, req *inventorypb.AddGenericNodeRequest) (*inventorypb.GenericNode, error) { params := &models.CreateNodeParams{ NodeName: req.NodeName, @@ -108,7 +146,7 @@ func (s *NodesService) AddGenericNode(ctx context.Context, req *inventorypb.AddG } node := &models.Node{} - e := s.db.InTransaction(func(tx *reform.TX) error { + e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { var err error node, err = models.CreateNode(tx.Querier, models.GenericNodeType, params) if err != nil { @@ -129,8 +167,6 @@ func (s *NodesService) AddGenericNode(ctx context.Context, req *inventorypb.AddG } // AddContainerNode adds Container Node. -// -//nolint:unparam func (s *NodesService) AddContainerNode(ctx context.Context, req *inventorypb.AddContainerNodeRequest) (*inventorypb.ContainerNode, error) { params := &models.CreateNodeParams{ NodeName: req.NodeName, @@ -145,7 +181,7 @@ func (s *NodesService) AddContainerNode(ctx context.Context, req *inventorypb.Ad } node := &models.Node{} - e := s.db.InTransaction(func(tx *reform.TX) error { + e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { var err error node, err = models.CreateNode(tx.Querier, models.ContainerNodeType, params) if err != nil { @@ -166,8 +202,6 @@ func (s *NodesService) AddContainerNode(ctx context.Context, req *inventorypb.Ad } // AddRemoteNode adds Remote Node. -// -//nolint:unparam func (s *NodesService) AddRemoteNode(ctx context.Context, req *inventorypb.AddRemoteNodeRequest) (*inventorypb.RemoteNode, error) { params := &models.CreateNodeParams{ NodeName: req.NodeName, @@ -179,7 +213,7 @@ func (s *NodesService) AddRemoteNode(ctx context.Context, req *inventorypb.AddRe } node := &models.Node{} - e := s.db.InTransaction(func(tx *reform.TX) error { + e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { var err error node, err = models.CreateNode(tx.Querier, models.RemoteNodeType, params) if err != nil { @@ -200,8 +234,6 @@ func (s *NodesService) AddRemoteNode(ctx context.Context, req *inventorypb.AddRe } // AddRemoteRDSNode adds a new RDS node -// -//nolint:unparam func (s *NodesService) AddRemoteRDSNode(ctx context.Context, req *inventorypb.AddRemoteRDSNodeRequest) (*inventorypb.RemoteRDSNode, error) { params := &models.CreateNodeParams{ NodeName: req.NodeName, @@ -213,7 +245,7 @@ func (s *NodesService) AddRemoteRDSNode(ctx context.Context, req *inventorypb.Ad } node := &models.Node{} - e := s.db.InTransaction(func(tx *reform.TX) error { + e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { var err error node, err = models.CreateNode(tx.Querier, models.RemoteRDSNodeType, params) if err != nil { @@ -235,7 +267,7 @@ func (s *NodesService) AddRemoteRDSNode(ctx context.Context, req *inventorypb.Ad // AddRemoteAzureDatabaseNode adds a new Azure database node // -//nolint:unparam,dupl +//nolint:dupl func (s *NodesService) AddRemoteAzureDatabaseNode(ctx context.Context, req *inventorypb.AddRemoteAzureDatabaseNodeRequest) (*inventorypb.RemoteAzureDatabaseNode, error) { params := &models.CreateNodeParams{ NodeName: req.NodeName, @@ -247,7 +279,7 @@ func (s *NodesService) AddRemoteAzureDatabaseNode(ctx context.Context, req *inve } node := &models.Node{} - e := s.db.InTransaction(func(tx *reform.TX) error { + e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { var err error node, err = models.CreateNode(tx.Querier, models.RemoteAzureDatabaseNodeType, params) if err != nil { @@ -274,7 +306,7 @@ func (s *NodesService) Remove(ctx context.Context, id string, force bool) error idsToKick := make(map[string]struct{}) idsToSetState := make(map[string]struct{}) - if e := s.db.InTransaction(func(tx *reform.TX) error { + if e := s.db.InTransactionContext(ctx, nil, func(tx *reform.TX) error { mode := models.RemoveRestrict if force { mode = models.RemoveCascade diff --git a/managed/services/inventory/nodes_test.go b/managed/services/inventory/nodes_test.go index afd2ad42a8..7dd7a874b0 100644 --- a/managed/services/inventory/nodes_test.go +++ b/managed/services/inventory/nodes_test.go @@ -16,6 +16,7 @@ package inventory import ( + "fmt" "testing" "github.com/stretchr/testify/assert" @@ -31,7 +32,7 @@ import ( func TestNodes(t *testing.T) { t.Run("Basic", func(t *testing.T) { _, _, ns, teardown, ctx, _ := setup(t) - defer teardown(t) + t.Cleanup(func() { teardown(t) }) actualNodes, err := ns.List(ctx, models.NodeFilters{}) require.NoError(t, err) @@ -63,7 +64,7 @@ func TestNodes(t *testing.T) { t.Run("GetEmptyID", func(t *testing.T) { _, _, ns, teardown, ctx, _ := setup(t) - defer teardown(t) + t.Cleanup(func() { teardown(t) }) getNodeResponse, err := ns.Get(ctx, &inventorypb.GetNodeRequest{NodeId: ""}) tests.AssertGRPCError(t, status.New(codes.InvalidArgument, `Empty Node ID.`), err) @@ -72,7 +73,7 @@ func TestNodes(t *testing.T) { t.Run("AddNameEmpty", func(t *testing.T) { _, _, ns, teardown, ctx, _ := setup(t) - defer teardown(t) + t.Cleanup(func() { teardown(t) }) _, err := ns.AddGenericNode(ctx, &inventorypb.AddGenericNodeRequest{NodeName: ""}) tests.AssertGRPCError(t, status.New(codes.InvalidArgument, `Empty Node name.`), err) @@ -80,7 +81,7 @@ func TestNodes(t *testing.T) { t.Run("AddNameNotUnique", func(t *testing.T) { _, _, ns, teardown, ctx, _ := setup(t) - defer teardown(t) + t.Cleanup(func() { teardown(t) }) _, err := ns.AddGenericNode(ctx, &inventorypb.AddGenericNodeRequest{NodeName: "test", Address: "test"}) require.NoError(t, err) @@ -91,7 +92,7 @@ func TestNodes(t *testing.T) { t.Run("AddHostnameNotUnique", func(t *testing.T) { _, _, ns, teardown, ctx, _ := setup(t) - defer teardown(t) + t.Cleanup(func() { teardown(t) }) _, err := ns.AddGenericNode(ctx, &inventorypb.AddGenericNodeRequest{NodeName: "test1", Address: "test"}) require.NoError(t, err) @@ -100,24 +101,9 @@ func TestNodes(t *testing.T) { require.NoError(t, err) }) - /* - TODO - t.Run("AddInstanceRegionNotUnique", func(t *testing.T) { - ns, teardown := setup(t) - defer teardown(t) - - _, err := ns.AddRemoteAmazonRDSNode(ctx, &inventorypb.AddRemoteAmazonRDSNodeRequest{NodeName: "test1", Instance: "test-instance", Region: "test-region"}) - require.NoError(t, err) - - _, err = ns.AddRemoteAmazonRDSNode(ctx, &inventorypb.AddRemoteAmazonRDSNodeRequest{NodeName: "test2", Instance: "test-instance", Region: "test-region"}) - expected := status.New(codes.AlreadyExists, `Node with instance "test-instance" and region "test-region" already exists.`) - tests.AssertGRPCError(t, expected, err) - }) - */ - - t.Run("AddRemoteRDSNode", func(t *testing.T) { + t.Run("AddRemoteRDSNodeNotUnique", func(t *testing.T) { _, _, ns, teardown, ctx, _ := setup(t) - defer teardown(t) + t.Cleanup(func() { teardown(t) }) _, err := ns.AddRemoteRDSNode(ctx, &inventorypb.AddRemoteRDSNodeRequest{NodeName: "test1", Region: "test-region", Address: "test"}) require.NoError(t, err) @@ -135,3 +121,250 @@ func TestNodes(t *testing.T) { tests.AssertGRPCError(t, status.New(codes.NotFound, `Node with ID "no-such-id" not found.`), err) }) } + +func TestAddNode(t *testing.T) { + t.Run("BasicGeneric", func(t *testing.T) { + const nodeID = "/node_id/00000000-0000-4000-8000-000000000005" + _, _, ns, teardown, ctx, _ := setup(t) + t.Cleanup(func() { teardown(t) }) + + actualNodes, err := ns.List(ctx, models.NodeFilters{}) + require.NoError(t, err) + require.Len(t, actualNodes, 1) // PMM Server Node + + addNodeResponse, err := ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Generic{ + Generic: &inventorypb.AddGenericNodeRequest{NodeName: "test-bm", Region: "test-region", Address: "test"}, + }, + }) + require.NoError(t, err) + + expectedNode := &inventorypb.GenericNode{ + NodeId: nodeID, + NodeName: "test-bm", + Region: "test-region", + Address: "test", + } + assert.Equal(t, expectedNode, addNodeResponse.GetGeneric()) + + getNodeResponse, err := ns.Get(ctx, &inventorypb.GetNodeRequest{NodeId: nodeID}) + require.NoError(t, err) + assert.Equal(t, expectedNode, getNodeResponse) + + nodesResponse, err := ns.List(ctx, models.NodeFilters{}) + require.NoError(t, err) + require.Len(t, nodesResponse, 2) + assert.Equal(t, expectedNode, nodesResponse[0]) + + err = ns.Remove(ctx, nodeID, false) + require.NoError(t, err) + getNodeResponse, err = ns.Get(ctx, &inventorypb.GetNodeRequest{NodeId: nodeID}) + tests.AssertGRPCError(t, status.New(codes.NotFound, fmt.Sprintf("Node with ID %q not found.", nodeID)), err) + assert.Nil(t, getNodeResponse) + }) + + t.Run("AddAllNodeTypes", func(t *testing.T) { + const ( + nodeID1 = "/node_id/00000000-0000-4000-8000-000000000005" + nodeID2 = "/node_id/00000000-0000-4000-8000-000000000006" + nodeID3 = "/node_id/00000000-0000-4000-8000-000000000007" + nodeID4 = "/node_id/00000000-0000-4000-8000-000000000008" + nodeID5 = "/node_id/00000000-0000-4000-8000-000000000009" + ) + _, _, ns, teardown, ctx, _ := setup(t) + t.Cleanup(func() { teardown(t) }) + + actualNodes, err := ns.List(ctx, models.NodeFilters{}) + require.NoError(t, err) + require.Len(t, actualNodes, 1) // PMM Server Node + + expectedNode1 := &inventorypb.GenericNode{ + NodeId: nodeID1, + NodeName: "test-name1", + Region: "test-region", + Address: "test1", + } + addNodeResponse, err := ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Generic{ + Generic: &inventorypb.AddGenericNodeRequest{ + NodeName: "test-name1", + Region: "test-region", + Address: "test1", + }, + }, + }) + require.NoError(t, err) + assert.Equal(t, expectedNode1, addNodeResponse.GetGeneric()) + + expectedNode2 := &inventorypb.ContainerNode{ + NodeId: nodeID2, + NodeName: "test-name2", + Region: "test-region", + Address: "test2", + } + addNodeResponse, err = ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Container{ + Container: &inventorypb.AddContainerNodeRequest{ + NodeName: "test-name2", + Region: "test-region", + Address: "test2", + }, + }, + }) + require.NoError(t, err) + assert.Equal(t, expectedNode2, addNodeResponse.GetContainer()) + + expectedNode3 := &inventorypb.RemoteNode{ + NodeId: nodeID3, + NodeName: "test-name3", + Region: "test-region", + Address: "test3", + CustomLabels: map[string]string{ + "testkey": "test-value", + "region": "test-region", + }, + } + addNodeResponse, err = ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Remote{ + Remote: &inventorypb.AddRemoteNodeRequest{ + NodeName: "test-name3", + Region: "test-region", + Address: "test3", + CustomLabels: map[string]string{ + "testkey": "test-value", + "region": "test-region", + }, + }, + }, + }) + require.NoError(t, err) + assert.Equal(t, expectedNode3, addNodeResponse.GetRemote()) + + expectedNode4 := &inventorypb.RemoteAzureDatabaseNode{ + NodeId: nodeID4, + NodeName: "test-name4", + Region: "test-region", + Az: "test-region-az", + Address: "test4", + } + addNodeResponse, err = ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_RemoteAzure{ + RemoteAzure: &inventorypb.AddRemoteAzureDatabaseNodeRequest{ + NodeName: "test-name4", + Region: "test-region", + Az: "test-region-az", + Address: "test4", + }, + }, + }) + require.NoError(t, err) + assert.Equal(t, expectedNode4, addNodeResponse.GetRemoteAzureDatabase()) + + expectedNode5 := &inventorypb.RemoteRDSNode{ + NodeId: nodeID5, + NodeName: "test-name5", + Region: "test-region", + Az: "test-region-az", + Address: "test5", + } + addNodeResponse, err = ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_RemoteRds{ + RemoteRds: &inventorypb.AddRemoteRDSNodeRequest{ + NodeName: "test-name5", + Region: "test-region", + Az: "test-region-az", + Address: "test5", + }, + }, + }) + require.NoError(t, err) + assert.Equal(t, expectedNode5, addNodeResponse.GetRemoteRds()) + + getNodeResponse, err := ns.Get(ctx, &inventorypb.GetNodeRequest{NodeId: nodeID1}) + require.NoError(t, err) + assert.Equal(t, expectedNode1, getNodeResponse) + + nodesResponse, err := ns.List(ctx, models.NodeFilters{}) + require.NoError(t, err) + require.Len(t, nodesResponse, 6) + assert.Equal(t, expectedNode1, nodesResponse[0]) + + err = ns.Remove(ctx, nodeID1, false) + require.NoError(t, err) + getNodeResponse, err = ns.Get(ctx, &inventorypb.GetNodeRequest{NodeId: nodeID1}) + tests.AssertGRPCError(t, status.New(codes.NotFound, fmt.Sprintf("Node with ID %q not found.", nodeID1)), err) + assert.Nil(t, getNodeResponse) + }) + + t.Run("AddRemoteRDSNodeNonUnique", func(t *testing.T) { + _, _, ns, teardown, ctx, _ := setup(t) + t.Cleanup(func() { teardown(t) }) + + _, err := ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_RemoteRds{ + RemoteRds: &inventorypb.AddRemoteRDSNodeRequest{NodeName: "test1", Region: "test-region", Address: "test"}, + }, + }) + require.NoError(t, err) + + _, err = ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_RemoteRds{ + RemoteRds: &inventorypb.AddRemoteRDSNodeRequest{NodeName: "test2", Region: "test-region", Address: "test"}, + }, + }) + expected := status.New(codes.AlreadyExists, `Node with instance "test" and region "test-region" already exists.`) + tests.AssertGRPCError(t, expected, err) + }) + + t.Run("AddHostnameNotUnique", func(t *testing.T) { + _, _, ns, teardown, ctx, _ := setup(t) + t.Cleanup(func() { teardown(t) }) + + _, err := ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Generic{ + Generic: &inventorypb.AddGenericNodeRequest{NodeName: "test1", Address: "test"}, + }, + }) + require.NoError(t, err) + + _, err = ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Generic{ + Generic: &inventorypb.AddGenericNodeRequest{NodeName: "test2", Address: "test"}, + }, + }) + require.NoError(t, err) + }) + + t.Run("AddNameEmpty", func(t *testing.T) { + _, _, ns, teardown, ctx, _ := setup(t) + t.Cleanup(func() { teardown(t) }) + + _, err := ns.AddNode(ctx, + &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Generic{ + Generic: &inventorypb.AddGenericNodeRequest{NodeName: ""}, + }, + }, + ) + tests.AssertGRPCError(t, status.New(codes.InvalidArgument, `Empty Node name.`), err) + }) + + t.Run("AddNameNotUnique", func(t *testing.T) { + _, _, ns, teardown, ctx, _ := setup(t) + t.Cleanup(func() { teardown(t) }) + + _, err := ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Generic{ + Generic: &inventorypb.AddGenericNodeRequest{NodeName: "test", Address: "test"}, + }, + }) + require.NoError(t, err) + + _, err = ns.AddNode(ctx, &inventorypb.AddNodeRequest{ + Request: &inventorypb.AddNodeRequest_Remote{ + Remote: &inventorypb.AddRemoteNodeRequest{NodeName: "test"}, + }, + }) + tests.AssertGRPCError(t, status.New(codes.AlreadyExists, `Node with name "test" already exists.`), err) + }) +}