diff --git a/cmd/cmd/activate/inboundendpoint.go b/cmd/cmd/activate/inboundendpoint.go
new file mode 100644
index 000000000..26a73bac5
--- /dev/null
+++ b/cmd/cmd/activate/inboundendpoint.go
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
+*
+* WSO2 LLC. licenses this file to you under the Apache License,
+* Version 2.0 (the "License"); you may not use this file except
+* in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+ */
+
+package activate
+
+import (
+ "fmt"
+
+ "github.com/spf13/cobra"
+ "github.com/wso2/product-mi-tooling/cmd/credentials"
+ impl "github.com/wso2/product-mi-tooling/cmd/impl"
+ miUtils "github.com/wso2/product-mi-tooling/cmd/utils"
+)
+
+var activateInboundEndpointCmdEnvironment string
+
+const artifactInboundEndpoint = "inbound endpoint"
+const activateInboundEndpointCmdLiteral = "inbound-endpoint [inboundendpoint-name]"
+
+var activateInboundEndpointCmd = &cobra.Command{
+ Use: activateInboundEndpointCmdLiteral,
+ Short: generateActivateCmdShortDescForArtifact(artifactInboundEndpoint),
+ Long: generateActivateCmdLongDescForArtifact(artifactInboundEndpoint, "inboundendpoint-name"),
+ Example: generateActivateCmdExamplesForArtifact(artifactInboundEndpoint, miUtils.GetTrimmedCmdLiteral(activateInboundEndpointCmdLiteral), "TestInboundEndpoint"),
+ Args: cobra.ExactArgs(1),
+ Run: func(cmd *cobra.Command, args []string) {
+ handleActivateInboundEndpointCmdArguments(args)
+ },
+}
+
+func init() {
+ ActivateCmd.AddCommand(activateInboundEndpointCmd)
+ setEnvFlag(activateInboundEndpointCmd, &activateInboundEndpointCmdEnvironment, artifactInboundEndpoint)
+}
+
+func handleActivateInboundEndpointCmdArguments(args []string) {
+ printActivateCmdVerboseLog(miUtils.GetTrimmedCmdLiteral(activateInboundEndpointCmdLiteral))
+ credentials.HandleMissingCredentials(activateInboundEndpointCmdEnvironment)
+ executeActivateInboundEndpoint(args[0])
+}
+
+func executeActivateInboundEndpoint(inboundEndpointName string) {
+ resp, err := impl.ActivateInboundEndpoint(activateInboundEndpointCmdEnvironment, inboundEndpointName)
+ if err != nil {
+ printErrorForArtifact(artifactInboundEndpoint, inboundEndpointName, err)
+ } else {
+ fmt.Println(resp)
+ }
+}
diff --git a/cmd/cmd/deactivate/inboundendpoint.go b/cmd/cmd/deactivate/inboundendpoint.go
new file mode 100644
index 000000000..325c0b504
--- /dev/null
+++ b/cmd/cmd/deactivate/inboundendpoint.go
@@ -0,0 +1,64 @@
+/*
+* Copyright (c) WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
+*
+* WSO2 LLC. licenses this file to you under the Apache License,
+* Version 2.0 (the "License"); you may not use this file except
+* in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+ */
+
+package deactivate
+
+import (
+ "fmt"
+
+ "github.com/spf13/cobra"
+ "github.com/wso2/product-mi-tooling/cmd/credentials"
+ "github.com/wso2/product-mi-tooling/cmd/impl"
+ miUtils "github.com/wso2/product-mi-tooling/cmd/utils"
+)
+
+var deactivateInboundEndpointCmdEnvironment string
+
+const artifactInboundEndpoint = "inbound endpoint"
+const deactivateInboundEndpointCmdLiteral = "inbound-endpoint [inboundendpoint-name]"
+
+var deactivateInboundEndpointCmd = &cobra.Command{
+ Use: deactivateInboundEndpointCmdLiteral,
+ Short: generateDeactivateCmdShortDescForArtifact(artifactInboundEndpoint),
+ Long: generateDeactivateCmdLongDescForArtifact(artifactInboundEndpoint, "inboundendpoint-name"),
+ Example: generateDeactivateCmdExamplesForArtifact(artifactInboundEndpoint, miUtils.GetTrimmedCmdLiteral(deactivateInboundEndpointCmdLiteral), "TestInboundEndpoint"),
+ Args: cobra.ExactArgs(1),
+ Run: func(cmd *cobra.Command, args []string) {
+ handleDeactivateInboundEndpointCmdArguments(args)
+ },
+}
+
+func init() {
+ DeactivateCmd.AddCommand(deactivateInboundEndpointCmd)
+ setEnvFlag(deactivateInboundEndpointCmd, &deactivateInboundEndpointCmdEnvironment, artifactInboundEndpoint)
+}
+
+func handleDeactivateInboundEndpointCmdArguments(args []string) {
+ printDeactivateCmdVerboseLog(miUtils.GetTrimmedCmdLiteral(deactivateInboundEndpointCmdLiteral))
+ credentials.HandleMissingCredentials(deactivateInboundEndpointCmdEnvironment)
+ executeDeactivateInboundEndpoint(args[0])
+}
+
+func executeDeactivateInboundEndpoint(inboundEndpointName string) {
+ resp, err := impl.DeactivateInboundEndpoint(deactivateInboundEndpointCmdEnvironment, inboundEndpointName)
+ if err != nil {
+ printErrorForArtifact(artifactInboundEndpoint, inboundEndpointName, err)
+ } else {
+ fmt.Println(resp)
+ }
+}
diff --git a/cmd/impl/getInboundEndpoints.go b/cmd/impl/getInboundEndpoints.go
index ea44d5f22..e1ac267be 100644
--- a/cmd/impl/getInboundEndpoints.go
+++ b/cmd/impl/getInboundEndpoints.go
@@ -31,11 +31,12 @@ import (
)
const (
- defaultInboundEndpointListTableFormat = "table {{.Name}}\t{{.Type}}"
+ defaultInboundEndpointListTableFormat = "table {{.Name}}\t{{.Type}}\t{{.Status}}"
defaultInboundEndpointDetailedFormat = "detail Name - {{.Name}}\n" +
"Type - {{.Type}}\n" +
"Stats - {{.Stats}}\n" +
"Tracing - {{.Tracing}}\n" +
+ "Status - {{.Status}}\n" +
"Parameters :\n" +
"NAME\tVALUE\n" +
"{{range .Parameters}}{{.Name}}\t{{.Value}}\n{{end}}"
@@ -68,6 +69,7 @@ func PrintInboundEndpointList(inboundEPList *artifactUtils.InboundEndpointList,
inboundEPListTableHeaders := map[string]string{
"Name": nameHeader,
"Type": typeHeader,
+ "Status": statusHeader,
}
if err := inboundEPListContext.Write(renderer, inboundEPListTableHeaders); err != nil {
fmt.Println("Error executing template:", err.Error())
diff --git a/cmd/impl/inboundEndpoint.go b/cmd/impl/inboundEndpoint.go
new file mode 100644
index 000000000..a9a8493a1
--- /dev/null
+++ b/cmd/impl/inboundEndpoint.go
@@ -0,0 +1,38 @@
+/*
+* Copyright (c) WSO2 LLC. (http://www.wso2.org) All Rights Reserved.
+*
+* WSO2 LLC. licenses this file to you under the Apache License,
+* Version 2.0 (the "License"); you may not use this file except
+* in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+* KIND, either express or implied. See the License for the
+* specific language governing permissions and limitations
+* under the License.
+ */
+
+package impl
+
+import (
+ "github.com/wso2/product-mi-tooling/cmd/utils"
+)
+
+// ActivateInboundEndpoint activates an inbound endpoint deployed in the micro integrator in a given environment
+func ActivateInboundEndpoint(env, inboundEndpointName string) (interface{}, error) {
+ return updateInboundEndpointServiceState(env, inboundEndpointName, "active")
+}
+
+// DeactivateInboundEndpoint deactivates an inbound endpoint deployed in the micro integrator in a given environment
+func DeactivateInboundEndpoint(env, inboundEndpointName string) (interface{}, error) {
+ return updateInboundEndpointServiceState(env, inboundEndpointName, "inactive")
+}
+
+func updateInboundEndpointServiceState(env, inboundEndpointName, state string) (interface{}, error) {
+ url := utils.GetMIManagementEndpointOfResource(utils.MiManagementInboundEndpointResource, env, utils.MainConfigFilePath)
+ return updateArtifactState(url, inboundEndpointName, state, env)
+}
diff --git a/cmd/shell-completions/mi_bash_completion.sh b/cmd/shell-completions/mi_bash_completion.sh
index 211c726be..ca231da3f 100644
--- a/cmd/shell-completions/mi_bash_completion.sh
+++ b/cmd/shell-completions/mi_bash_completion.sh
@@ -1470,6 +1470,35 @@ _mi_activate_endpoint()
noun_aliases=()
}
+_mi_activate_inbound-endpoint()
+{
+ last_command="mi_activate_inbound-endpoint"
+
+ command_aliases=()
+
+ commands=()
+
+ flags=()
+ two_word_flags=()
+ local_nonpersistent_flags=()
+ flags_with_completion=()
+ flags_completion=()
+
+ flags+=("--environment=")
+ two_word_flags+=("--environment")
+ two_word_flags+=("-e")
+ local_nonpersistent_flags+=("--environment=")
+ flags+=("--insecure")
+ flags+=("-k")
+ flags+=("--verbose")
+
+ must_have_one_flag=()
+ must_have_one_flag+=("--environment=")
+ must_have_one_flag+=("-e")
+ must_have_one_noun=()
+ noun_aliases=()
+}
+
_mi_activate_message-processor()
{
last_command="mi_activate_message-processor"
@@ -1536,6 +1565,7 @@ _mi_activate()
commands=()
commands+=("endpoint")
+ commands+=("inbound-endpoint")
commands+=("message-processor")
commands+=("proxy-service")
@@ -1583,6 +1613,35 @@ _mi_deactivate_endpoint()
noun_aliases=()
}
+_mi_deactivate_inbound-endpoint()
+{
+ last_command="mi_deactivate_inbound-endpoint"
+
+ command_aliases=()
+
+ commands=()
+
+ flags=()
+ two_word_flags=()
+ local_nonpersistent_flags=()
+ flags_with_completion=()
+ flags_completion=()
+
+ flags+=("--environment=")
+ two_word_flags+=("--environment")
+ two_word_flags+=("-e")
+ local_nonpersistent_flags+=("--environment=")
+ flags+=("--insecure")
+ flags+=("-k")
+ flags+=("--verbose")
+
+ must_have_one_flag=()
+ must_have_one_flag+=("--environment=")
+ must_have_one_flag+=("-e")
+ must_have_one_noun=()
+ noun_aliases=()
+}
+
_mi_deactivate_message-processor()
{
last_command="mi_deactivate_message-processor"
@@ -1649,6 +1708,7 @@ _mi_deactivate()
commands=()
commands+=("endpoint")
+ commands+=("inbound-endpoint")
commands+=("message-processor")
commands+=("proxy-service")
diff --git a/cmd/shell-completions/mi_bash_completion.sh-e b/cmd/shell-completions/mi_bash_completion.sh-e
index 211c726be..ca231da3f 100644
--- a/cmd/shell-completions/mi_bash_completion.sh-e
+++ b/cmd/shell-completions/mi_bash_completion.sh-e
@@ -1470,6 +1470,35 @@ _mi_activate_endpoint()
noun_aliases=()
}
+_mi_activate_inbound-endpoint()
+{
+ last_command="mi_activate_inbound-endpoint"
+
+ command_aliases=()
+
+ commands=()
+
+ flags=()
+ two_word_flags=()
+ local_nonpersistent_flags=()
+ flags_with_completion=()
+ flags_completion=()
+
+ flags+=("--environment=")
+ two_word_flags+=("--environment")
+ two_word_flags+=("-e")
+ local_nonpersistent_flags+=("--environment=")
+ flags+=("--insecure")
+ flags+=("-k")
+ flags+=("--verbose")
+
+ must_have_one_flag=()
+ must_have_one_flag+=("--environment=")
+ must_have_one_flag+=("-e")
+ must_have_one_noun=()
+ noun_aliases=()
+}
+
_mi_activate_message-processor()
{
last_command="mi_activate_message-processor"
@@ -1536,6 +1565,7 @@ _mi_activate()
commands=()
commands+=("endpoint")
+ commands+=("inbound-endpoint")
commands+=("message-processor")
commands+=("proxy-service")
@@ -1583,6 +1613,35 @@ _mi_deactivate_endpoint()
noun_aliases=()
}
+_mi_deactivate_inbound-endpoint()
+{
+ last_command="mi_deactivate_inbound-endpoint"
+
+ command_aliases=()
+
+ commands=()
+
+ flags=()
+ two_word_flags=()
+ local_nonpersistent_flags=()
+ flags_with_completion=()
+ flags_completion=()
+
+ flags+=("--environment=")
+ two_word_flags+=("--environment")
+ two_word_flags+=("-e")
+ local_nonpersistent_flags+=("--environment=")
+ flags+=("--insecure")
+ flags+=("-k")
+ flags+=("--verbose")
+
+ must_have_one_flag=()
+ must_have_one_flag+=("--environment=")
+ must_have_one_flag+=("-e")
+ must_have_one_noun=()
+ noun_aliases=()
+}
+
_mi_deactivate_message-processor()
{
last_command="mi_deactivate_message-processor"
@@ -1649,6 +1708,7 @@ _mi_deactivate()
commands=()
commands+=("endpoint")
+ commands+=("inbound-endpoint")
commands+=("message-processor")
commands+=("proxy-service")
diff --git a/cmd/utils/artifactUtils/inboundEndpointUtils.go b/cmd/utils/artifactUtils/inboundEndpointUtils.go
index 9609cd86d..d86c6dde2 100644
--- a/cmd/utils/artifactUtils/inboundEndpointUtils.go
+++ b/cmd/utils/artifactUtils/inboundEndpointUtils.go
@@ -8,6 +8,7 @@ type InboundEndpointList struct {
type InboundEndpointSummary struct {
Name string `json:"name"`
Type string `json:"protocol"`
+ Status string `json:"status"`
}
type InboundEndpoint struct {
@@ -16,6 +17,7 @@ type InboundEndpoint struct {
Stats string `json:"stats"`
Tracing string `json:"tracing"`
Parameters []Parameter `json:"parameters"`
+ Status string `json:"status"`
}
type Parameter struct {
diff --git a/monitoring-dashboard/components/org.wso2.ei.dashboard.core/src/main/java/org/wso2/ei/dashboard/micro/integrator/delegates/InboundEndpointDelegate.java b/monitoring-dashboard/components/org.wso2.ei.dashboard.core/src/main/java/org/wso2/ei/dashboard/micro/integrator/delegates/InboundEndpointDelegate.java
index 66d2253e7..f9f764da9 100644
--- a/monitoring-dashboard/components/org.wso2.ei.dashboard.core/src/main/java/org/wso2/ei/dashboard/micro/integrator/delegates/InboundEndpointDelegate.java
+++ b/monitoring-dashboard/components/org.wso2.ei.dashboard.core/src/main/java/org/wso2/ei/dashboard/micro/integrator/delegates/InboundEndpointDelegate.java
@@ -67,6 +67,10 @@ private boolean updateInboundEndpoint(String groupId, ArtifactUpdateRequest requ
String trace = request.isValue() ? "enable" : "disable";
payload.addProperty("trace", trace);
}
+ if (request.getType().equals("status")) {
+ String status = request.isValue() ? "active" : "inactive";
+ payload.addProperty("status", status);
+ }
return DelegatesUtil.updateArtifact(Constants.INBOUND_ENDPOINTS, groupId, request, payload);
}
diff --git a/monitoring-dashboard/components/org.wso2.micro.integrator.dashboard.web/web-app/src/commons/TableRowCreator.js b/monitoring-dashboard/components/org.wso2.micro.integrator.dashboard.web/web-app/src/commons/TableRowCreator.js
index ba24b9fb0..d523aa9be 100644
--- a/monitoring-dashboard/components/org.wso2.micro.integrator.dashboard.web/web-app/src/commons/TableRowCreator.js
+++ b/monitoring-dashboard/components/org.wso2.micro.integrator.dashboard.web/web-app/src/commons/TableRowCreator.js
@@ -103,7 +103,7 @@ export default function TableRowCreator(props) {
// Message Processors
case 'status':
return