Skip to content

Commit 8c532de

Browse files
andrestasconpvkrishnachaitanya
authored andcommitted
Added - Support for Java Management Service 9.1
1 parent 9d31b21 commit 8c532de

26 files changed

+1584
-3
lines changed

examples/jms/fleet_error.tf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "fleet_error_compartment_id_in_subtree" {
5+
default = false
6+
}
7+
8+
variable "fleet_error_time_first_seen_greater_than_or_equal_to" {}
9+
10+
variable "fleet_error_time_first_seen_less_than_or_equal_to" {}
11+
12+
variable "fleet_error_time_last_seen_greater_than_or_equal_to" {}
13+
14+
variable "fleet_error_time_last_seen_less_than_or_equal_to" {}
15+
16+
17+
data "oci_jms_fleet_errors" "test_fleet_errors" {
18+
19+
#Optional
20+
compartment_id = var.compartment_id
21+
compartment_id_in_subtree = var.fleet_error_compartment_id_in_subtree
22+
fleet_id = var.fleet_ocid
23+
time_first_seen_greater_than_or_equal_to = var.fleet_error_time_first_seen_greater_than_or_equal_to
24+
time_first_seen_less_than_or_equal_to = var.fleet_error_time_first_seen_less_than_or_equal_to
25+
time_last_seen_greater_than_or_equal_to = var.fleet_error_time_last_seen_greater_than_or_equal_to
26+
time_last_seen_less_than_or_equal_to = var.fleet_error_time_last_seen_less_than_or_equal_to
27+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "fleet_error_analytic_compartment_id_in_subtree" {
5+
default = false
6+
}
7+
8+
data "oci_jms_fleet_error_analytics" "test_fleet_error_analytics" {
9+
10+
#Optional
11+
compartment_id = var.compartment_id
12+
compartment_id_in_subtree = var.fleet_error_analytic_compartment_id_in_subtree
13+
}

examples/jms/fleet_performance_tuning_analysis_result.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ data "oci_jms_fleet_performance_tuning_analysis_results" "test_jms_fleet_perform
1010
fleet_id = var.fleet_ocid
1111

1212
#Optional
13-
application_id = var.application_id
13+
application_id = var.application_id
14+
application_name = var.application.name
1415
managed_instance_id = var.managed_instance_ocid
1516
host_name = var.host_name
1617
time_start = var.time_start

examples/jms/jms_plugin.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@
33

44
# You need actual OCID value of compute instance or managed instance to create this resource.
55
# variable "agent_id" {}
6+
# variable "jms_plugin_agent_type" {
7+
# default = "OMA"
8+
# }
69
# resource "oci_jms_jms_plugin" "example_jms_plugin" {
710
# #Required
811
# agent_id = var.agent_id
12+
# agent_type = var.jms_plugin_agent_type
913
# compartment_id = var.compartment_ocid
1014

1115
# #Optional

examples/jms/plugin_error.tf

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
2+
// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
3+
// Licensed under the Mozilla Public License v2.0
4+
5+
variable "plugin_error_compartment_id_in_subtree" {
6+
default = false
7+
}
8+
9+
variable "plugin_error_time_first_seen_greater_than_or_equal_to" {}
10+
11+
variable "plugin_error_time_first_seen_less_than_or_equal_to" {}
12+
13+
variable "plugin_error_time_last_seen_greater_than_or_equal_to" {}
14+
15+
variable "plugin_error_time_last_seen_less_than_or_equal_to" {}
16+
17+
data "oci_jms_plugin_errors" "test_plugin_errors" {
18+
19+
#Optional
20+
compartment_id = var.compartment_id
21+
compartment_id_in_subtree = var.plugin_error_compartment_id_in_subtree
22+
managed_instance_id = var.managed_instance_ocid
23+
time_first_seen_greater_than_or_equal_to = var.plugin_error_time_first_seen_greater_than_or_equal_to
24+
time_first_seen_less_than_or_equal_to = var.plugin_error_time_first_seen_less_than_or_equal_to
25+
time_last_seen_greater_than_or_equal_to = var.plugin_error_time_last_seen_greater_than_or_equal_to
26+
time_last_seen_less_than_or_equal_to = var.plugin_error_time_last_seen_less_than_or_equal_to
27+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
variable "plugin_error_analytic_compartment_id_in_subtree" {
5+
default = false
6+
}
7+
8+
data "oci_jms_plugin_error_analytics" "test_plugin_error_analytics" {
9+
10+
#Optional
11+
compartment_id = var.compartment_id
12+
compartment_id_in_subtree = var.plugin_error_analytic_compartment_id_in_subtree
13+
}
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
package integrationtest
5+
6+
import (
7+
"testing"
8+
9+
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
10+
11+
"github.com/oracle/terraform-provider-oci/httpreplay"
12+
"github.com/oracle/terraform-provider-oci/internal/acctest"
13+
14+
"github.com/oracle/terraform-provider-oci/internal/utils"
15+
)
16+
17+
var (
18+
JmsFleetErrorAnalyticCompartmentId = utils.GetEnvSettingWithBlankDefault("compartment_ocid")
19+
JmsFleetErrorAnalyticDataSourceRepresentation = map[string]interface{}{
20+
"compartment_id": acctest.Representation{RepType: acctest.Optional, Create: JmsFleetErrorAnalyticCompartmentId},
21+
"compartment_id_in_subtree": acctest.Representation{RepType: acctest.Optional, Create: `false`},
22+
}
23+
)
24+
25+
// issue-routing-tag: jms/default
26+
func TestJmsFleetErrorAnalyticResource_basic(t *testing.T) {
27+
httpreplay.SetScenario("TestJmsFleetErrorAnalyticResource_basic")
28+
defer httpreplay.SaveScenario()
29+
30+
config := acctest.ProviderTestConfig()
31+
32+
datasourceName := "data.oci_jms_fleet_error_analytics.test_fleet_error_analytics"
33+
34+
acctest.ResourceTest(t, nil, []resource.TestStep{
35+
// verify datasource
36+
{
37+
Config: config +
38+
acctest.GenerateDataSourceFromRepresentationMap(
39+
"oci_jms_fleet_error_analytics",
40+
"test_fleet_error_analytics",
41+
acctest.Optional,
42+
acctest.Create,
43+
JmsFleetErrorAnalyticDataSourceRepresentation),
44+
Check: acctest.ComposeAggregateTestCheckFuncWrapper(
45+
resource.TestCheckResourceAttr(datasourceName, "compartment_id", JmsFleetErrorAnalyticCompartmentId),
46+
resource.TestCheckResourceAttr(datasourceName, "compartment_id_in_subtree", "false"),
47+
48+
resource.TestCheckResourceAttrSet(datasourceName, "fleet_error_aggregation_collection.#"),
49+
// we can only verify that response contain zero items because we are using dummy test data values
50+
// we cannot use actual values because it requires create API.
51+
resource.TestCheckResourceAttr(datasourceName, "fleet_error_aggregation_collection.0.items.#", "0"),
52+
),
53+
},
54+
// verify singular datasource
55+
// note: we cannot write test to verify singular data source because
56+
// crypto analysis processing requires create API.
57+
})
58+
}
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
package integrationtest
5+
6+
import (
7+
"testing"
8+
9+
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
10+
11+
"github.com/oracle/terraform-provider-oci/httpreplay"
12+
"github.com/oracle/terraform-provider-oci/internal/acctest"
13+
14+
"github.com/oracle/terraform-provider-oci/internal/utils"
15+
)
16+
17+
var (
18+
JmsFleetErrorCompartmentId = utils.GetEnvSettingWithBlankDefault("compartment_ocid")
19+
JmsFleetErrorFleetId = utils.GetEnvSettingWithBlankDefault("fleet_advanced_feature_ocid")
20+
JmsFleetErrorDataSourceRepresentation = map[string]interface{}{
21+
"compartment_id": acctest.Representation{RepType: acctest.Optional, Create: JmsFleetErrorCompartmentId},
22+
"compartment_id_in_subtree": acctest.Representation{RepType: acctest.Optional, Create: `false`},
23+
"fleet_id": acctest.Representation{RepType: acctest.Optional, Create: JmsFleetErrorFleetId},
24+
}
25+
26+
JmsFleetErrorResourceConfig = acctest.GenerateResourceFromRepresentationMap("oci_jms_fleet", "test_fleet", acctest.Required, acctest.Create, JmsFleetRepresentation)
27+
)
28+
29+
// issue-routing-tag: jms/default
30+
func TestJmsFleetErrorResource_basic(t *testing.T) {
31+
httpreplay.SetScenario("TestJmsFleetErrorResource_basic")
32+
defer httpreplay.SaveScenario()
33+
34+
config := acctest.ProviderTestConfig()
35+
36+
datasourceName := "data.oci_jms_fleet_errors.test_fleet_errors"
37+
38+
acctest.ResourceTest(t, nil, []resource.TestStep{
39+
// verify create
40+
// note: we cannot write test for this case because
41+
// we don't have create API.
42+
43+
// verify update
44+
// note: we cannot write test for this case because
45+
// we don't have update API.
46+
47+
// verify datasource
48+
{
49+
Config: config +
50+
acctest.GenerateDataSourceFromRepresentationMap(
51+
"oci_jms_fleet_errors",
52+
"test_fleet_errors",
53+
acctest.Optional,
54+
acctest.Create,
55+
JmsFleetErrorDataSourceRepresentation) +
56+
JmsFleetErrorResourceConfig,
57+
Check: acctest.ComposeAggregateTestCheckFuncWrapper(
58+
resource.TestCheckResourceAttr(datasourceName, "compartment_id", JmsFleetErrorCompartmentId),
59+
resource.TestCheckResourceAttr(datasourceName, "compartment_id_in_subtree", "false"),
60+
resource.TestCheckResourceAttr(datasourceName, "fleet_id", JmsFleetErrorFleetId),
61+
62+
resource.TestCheckResourceAttrSet(datasourceName, "fleet_error_collection.#"),
63+
// we can only verify that response contain zero items because we are using dummy test data values
64+
// we cannot use actual values because it requires create API.
65+
resource.TestCheckResourceAttr(datasourceName, "fleet_error_collection.0.items.#", "0"),
66+
),
67+
},
68+
// verify singular datasource
69+
// note: we cannot write test to verify singular data source because
70+
// crypto analysis processing requires create API.
71+
})
72+
}

internal/integrationtest/jms_fleet_performance_tuning_analysis_result_test.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ var (
6060
JmsFleetPerformanceTuningAnalysisResultDataSourceRepresentation = map[string]interface{}{
6161
"fleet_id": acctest.Representation{RepType: acctest.Required, Create: `${oci_jms_fleet.test_fleet.id}`},
6262
"application_id": acctest.Representation{RepType: acctest.Optional, Create: `dummy-application-id`},
63+
"application_name": acctest.Representation{RepType: acctest.Optional, Create: `dummy-application-name`},
6364
"host_name": acctest.Representation{RepType: acctest.Optional, Create: `dummy-host-name`},
6465
"managed_instance_id": acctest.Representation{RepType: acctest.Optional, Create: JmsFleetPerformanceTuningAnalysisResultDummyManagedInstanceId},
6566
"time_start": acctest.Representation{RepType: acctest.Optional, Create: `2024-01-20T15:15:15.000Z`},
@@ -96,8 +97,8 @@ func TestJmsFleetPerformanceTuningAnalysisResultResource_basic(t *testing.T) {
9697
),
9798
Check: acctest.ComposeAggregateTestCheckFuncWrapper(
9899
resource.TestCheckResourceAttrSet(datasourceName, "fleet_id"),
99-
resource.TestCheckResourceAttr(datasourceName, "application_id", `dummy-application-id`),
100-
resource.TestCheckResourceAttr(datasourceName, "host_name", `dummy-host-name`),
100+
resource.TestCheckResourceAttr(datasourceName, "application_id", `dummy-application-id`), resource.TestCheckResourceAttrSet(datasourceName, "application_name"),
101+
resource.TestCheckResourceAttr(datasourceName, "application_name", `dummy-application-name`), resource.TestCheckResourceAttr(datasourceName, "host_name", `dummy-host-name`),
101102
resource.TestCheckResourceAttr(datasourceName, "managed_instance_id", JmsFleetPerformanceTuningAnalysisResultDummyManagedInstanceId),
102103
resource.TestCheckResourceAttr(datasourceName, "time_start", `2024-01-20T15:15:15.000Z`),
103104
resource.TestCheckResourceAttr(datasourceName, "time_end", `2024-01-20T16:16:16.000Z`),
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved.
2+
// Licensed under the Mozilla Public License v2.0
3+
4+
package integrationtest
5+
6+
import (
7+
"testing"
8+
9+
"github.com/hashicorp/terraform-plugin-testing/helper/resource"
10+
11+
"github.com/oracle/terraform-provider-oci/httpreplay"
12+
"github.com/oracle/terraform-provider-oci/internal/acctest"
13+
14+
"github.com/oracle/terraform-provider-oci/internal/utils"
15+
)
16+
17+
var (
18+
JmsPluginErrorAnalyticCompartmentId = utils.GetEnvSettingWithBlankDefault("compartment_ocid")
19+
JmsPluginErrorAnalyticDataSourceRepresentation = map[string]interface{}{
20+
"compartment_id": acctest.Representation{RepType: acctest.Optional, Create: JmsPluginErrorAnalyticCompartmentId},
21+
"compartment_id_in_subtree": acctest.Representation{RepType: acctest.Optional, Create: `false`},
22+
}
23+
24+
JmsPluginErrorAnalyticResourceConfig = ""
25+
)
26+
27+
// issue-routing-tag: jms/default
28+
func TestJmsPluginErrorAnalyticResource_basic(t *testing.T) {
29+
httpreplay.SetScenario("TestJmsPluginErrorAnalyticResource_basic")
30+
defer httpreplay.SaveScenario()
31+
32+
config := acctest.ProviderTestConfig()
33+
34+
datasourceName := "data.oci_jms_plugin_error_analytics.test_plugin_error_analytics"
35+
36+
acctest.ResourceTest(t, nil, []resource.TestStep{
37+
// verify create
38+
// note: we cannot write test for this case because
39+
// we don't have create API.
40+
41+
// verify update
42+
// note: we cannot write test for this case because
43+
// we don't have update API.
44+
45+
// verify datasource
46+
{
47+
Config: config +
48+
acctest.GenerateDataSourceFromRepresentationMap(
49+
"oci_jms_plugin_error_analytics",
50+
"test_plugin_error_analytics",
51+
acctest.Optional,
52+
acctest.Create,
53+
JmsPluginErrorAnalyticDataSourceRepresentation),
54+
Check: acctest.ComposeAggregateTestCheckFuncWrapper(
55+
resource.TestCheckResourceAttr(datasourceName, "compartment_id", JmsPluginErrorAnalyticCompartmentId),
56+
resource.TestCheckResourceAttr(datasourceName, "compartment_id_in_subtree", "false"),
57+
58+
resource.TestCheckResourceAttrSet(datasourceName, "plugin_error_aggregation_collection.#"),
59+
// we can only verify that response contain zero items because we are using dummy test data values
60+
// we cannot use actual values because it requires create API.
61+
resource.TestCheckResourceAttr(datasourceName, "plugin_error_aggregation_collection.0.items.#", "0"),
62+
),
63+
},
64+
// verify singular datasource
65+
// note: we cannot write test to verify singular data source because
66+
// crypto analysis processing requires create API.
67+
})
68+
}

0 commit comments

Comments
 (0)