Skip to content

Commit

Permalink
Merge pull request #225 from sujithramagesh/EUM_TERRAFORM_PROVIDER_BR…
Browse files Browse the repository at this point in the history
…ANCH

Changes for Web Transaction Browser, ISP and FTP Transfer Monitors.
  • Loading branch information
jim-billy-zoho authored Dec 28, 2023
2 parents 4cae34b + 78ad17a commit 50e1089
Show file tree
Hide file tree
Showing 26 changed files with 552 additions and 418 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ A terraform provider for managing the following resources in Site24x7:
- SSL Certificate Monitor - [site24x7_ssl_monitor](examples/ssl_monitor_us.tf) ([Site24x7 SSL Certificate Monitor API doc](https://www.site24x7.com/help/api/#ssl-certificate))
- Rest API Monitor - [site24x7_rest_api_monitor](examples/rest_api_monitor_us.tf) ([Site24x7 Rest API Monitor API doc](https://www.site24x7.com/help/api/#rest-api))
- Rest API Transaction Monitor - [site24x7_rest_api_transaction_monitor](examples/rest_api_transaction_monitor_us.tf) ([Site24x7 Rest API Transaction Monitor API doc](https://www.site24x7.com/help/api/#rest-api-transaction))
- Domain Expiry Monitor - [site24x7_domain_expiry_monitor](examples/domain_expiry_monitor_us.tf)([Site24x7 domain expiry monitor API doc]())
- Domain Expiry Monitor - [site24x7_domain_expiry_monitor](examples/domain_expiry_monitor_us.tf)([Site24x7 domain expiry monitor API doc](https://www.site24x7.com/help/api/#domain-expiry))
- Web Transaction Browser Monitor - [site24x7_web_transaction_browser_monitor](examples/web_transaction_browser_monitor_us.tf)([Site24x7 web transaction browser monitor API doc](https://www.site24x7.com/help/api/#web-transaction-(browser)))
- FTP Transfer Monitor - [site24x7_FTP_Transfer_monitor](examples/FTP_Transfer_monitor_us.tf)([Site24x7 ftp transfer monitor API doc](https://www.site24x7.com/help/api/#ftp-transfer))
- ISP Monitor - [site24x7_ISP_monitor](examples/ISP_monitor_us.tf)([Site24x7 isp monitor API doc](https://registry.terraform.io/providers/site24x7/site24x7/latest/docs/resources/isp_monitor))
- Server Monitor - [site24x7_server_monitor](examples/server_monitor_us.tf) ([Terraform Server Monitor doc](https://registry.terraform.io/providers/site24x7/site24x7/latest/docs/resources/server_monitor))
- Heartbeat Monitor - [site24x7_heartbeat_monitor](examples/heartbeat_monitor_us.tf) ([Site24x7 Heartbeat Monitor API doc](https://www.site24x7.com/help/api/#heartbeat))
- URL IT Automation - [site24x7_url_action](examples/it_automation_us.tf) ([Site24x7 IT Automation API doc](https://www.site24x7.com/help/api/#it-automation))
Expand Down
8 changes: 5 additions & 3 deletions api/endpoints/monitors/domain_expiry_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func TestDomainExpiryMonitors(t *testing.T) {
Fn: func(t *testing.T, c rest.Client) {
domainExpiryMonitor := &api.DomainExpiryMonitor{
DisplayName: "Domain Expiry Monitor",
Type: "DOMAINEXPIRY",
HostName: "www.example.com",
DomainName: "www.example.com",
Port: 443,
Expand Down Expand Up @@ -141,16 +142,17 @@ func TestDomainExpiryMonitors(t *testing.T) {
domainExpiryMonitor := &api.DomainExpiryMonitor{
MonitorID: "897654345678",
DisplayName: "Domain Expiry Monitor",
Type: "DOMAINEXPIRY",
HostName: "www.example.com",
DomainName: "www.example.com",
Port: 443,
UseIPV6: true,
Timeout: 10,
ExpireDays: 30,
LocationProfileID: "456",
NotificationProfileID: "789",
OnCallScheduleID: "234",
IgnoreRegistryDate: false,
LocationProfileID: "456",
NotificationProfileID: "789",
MonitorGroups: []string{"234", "567"},
UserGroupIDs: []string{"123", "456"},
TagIDs: []string{"123"},
Expand All @@ -168,7 +170,7 @@ func TestDomainExpiryMonitors(t *testing.T) {
ExpectedPath: "/monitors/897654345678",
StatusCode: 200,
Fn: func(t *testing.T, c rest.Client) {
require.NoError(t, NewDomainExpiryMonitors(c).Delete("123"))
require.NoError(t, NewDomainExpiryMonitors(c).Delete("897654345678"))
},
},
})
Expand Down
77 changes: 39 additions & 38 deletions api/endpoints/monitors/ftp_transfer_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,21 +26,21 @@ func TestFTPTransferMonitors(t *testing.T) {
Protocol: "FTP",
Type: "FTP",
Port: 443,
CheckFrequency: "5",
CheckFrequency: "15",
Timeout: 30,
CheckUpload: true,
CheckDownload: true,
Username: "sas",
Password: "sas",
Destination: "/Home/sas/",
PerformAutomation: true,
CredentialProfileID: "2345536536",
OnCallScheduleID: "8687567555",
LocationProfileID: "456",
NotificationProfileID: "789",
ThresholdProfileID: "012",
CredentialProfileID: "435456565656546",
OnCallScheduleID: "23524543545245",
LocationProfileID: "123412341234123412",
NotificationProfileID: "123412341234123412",
ThresholdProfileID: "123412341234123414",
MonitorGroups: []string{"234", "567"},
DependencyResourceIDs: []string{"234", "567"},
DependencyResourceIDs: []string{"123", "456"},
UserGroupIDs: []string{"123", "456"},
TagIDs: []string{"123"},
}
Expand All @@ -60,6 +60,7 @@ func TestFTPTransferMonitors(t *testing.T) {
require.NoError(t, err)

expected := &api.FTPTransferMonitor{
MonitorID: "897654345678",
DisplayName: "FTP Transfer Monitor",
HostName: "www.example.com",
Protocol: "FTP",
Expand All @@ -73,13 +74,13 @@ func TestFTPTransferMonitors(t *testing.T) {
Password: "sas",
Destination: "/Home/sas/",
PerformAutomation: true,
CredentialProfileID: "2345536536",
OnCallScheduleID: "8687567555",
LocationProfileID: "456",
NotificationProfileID: "789",
ThresholdProfileID: "012",
CredentialProfileID: "435456565656546",
OnCallScheduleID: "23524543545245",
LocationProfileID: "123412341234123412",
NotificationProfileID: "123412341234123412",
ThresholdProfileID: "123412341234123414",
MonitorGroups: []string{"234", "567"},
DependencyResourceIDs: []string{"234", "567"},
DependencyResourceIDs: []string{"123", "456"},
UserGroupIDs: []string{"123", "456"},
TagIDs: []string{"123"},
}
Expand All @@ -99,8 +100,8 @@ func TestFTPTransferMonitors(t *testing.T) {

expected := []*api.FTPTransferMonitor{
{
MonitorID: "897654345678",
DisplayName: "FTP Transfer Monitor",
MonitorID: "9856443688997645",
DisplayName: "FTP Monitor",
HostName: "www.example.com",
Protocol: "FTP",
Type: "FTP",
Expand All @@ -113,18 +114,18 @@ func TestFTPTransferMonitors(t *testing.T) {
Password: "sas",
Destination: "/Home/sas/",
PerformAutomation: true,
CredentialProfileID: "2345536536",
OnCallScheduleID: "8687567555",
LocationProfileID: "456",
NotificationProfileID: "789",
ThresholdProfileID: "012",
CredentialProfileID: "435456565656546",
OnCallScheduleID: "23524543545245",
LocationProfileID: "123412341234123412",
NotificationProfileID: "123412341234123412",
ThresholdProfileID: "123412341234123414",
MonitorGroups: []string{"234", "567"},
DependencyResourceIDs: []string{"234", "567"},
DependencyResourceIDs: []string{"123", "456"},
UserGroupIDs: []string{"123", "456"},
TagIDs: []string{"123"},
},
{
MonitorID: "933654345678",
MonitorID: "897654345678",
DisplayName: "FTP Transfer Monitor",
HostName: "www.example.com",
Protocol: "FTP",
Expand All @@ -138,13 +139,13 @@ func TestFTPTransferMonitors(t *testing.T) {
Password: "sas",
Destination: "/Home/sas/",
PerformAutomation: true,
CredentialProfileID: "2345536536",
OnCallScheduleID: "8687567555",
LocationProfileID: "456",
NotificationProfileID: "789",
ThresholdProfileID: "012",
CredentialProfileID: "435456565656546",
OnCallScheduleID: "23524543545245",
LocationProfileID: "123412341234123412",
NotificationProfileID: "123412341234123412",
ThresholdProfileID: "123412341234123414",
MonitorGroups: []string{"234", "567"},
DependencyResourceIDs: []string{"234", "567"},
DependencyResourceIDs: []string{"123", "456"},
UserGroupIDs: []string{"123", "456"},
TagIDs: []string{"123"},
},
Expand All @@ -156,13 +157,13 @@ func TestFTPTransferMonitors(t *testing.T) {
{
Name: "update ftp transfer monitor",
ExpectedVerb: "PUT",
ExpectedPath: "/monitors/123",
ExpectedPath: "/monitors/897654345678",
ExpectedBody: validation.Fixture(t, "requests/update_ftp_transfer_monitor.json"),
StatusCode: 200,
ResponseBody: validation.JsonAPIResponseBody(t, nil),
Fn: func(t *testing.T, c rest.Client) {
ftpTransferMonitor := &api.FTPTransferMonitor{
MonitorID: "123",
MonitorID: "897654345678",
DisplayName: "FTP Transfer Monitor",
HostName: "www.example.com",
Protocol: "FTP",
Expand All @@ -176,13 +177,13 @@ func TestFTPTransferMonitors(t *testing.T) {
Password: "sas",
Destination: "/Home/sas/",
PerformAutomation: true,
CredentialProfileID: "2345536536",
OnCallScheduleID: "8687567555",
LocationProfileID: "456",
NotificationProfileID: "789",
ThresholdProfileID: "012",
CredentialProfileID: "435456565656546",
OnCallScheduleID: "23524543545245",
LocationProfileID: "123412341234123412",
NotificationProfileID: "123412341234123412",
ThresholdProfileID: "123412341234123414",
MonitorGroups: []string{"234", "567"},
DependencyResourceIDs: []string{"234", "567"},
DependencyResourceIDs: []string{"123", "456"},
UserGroupIDs: []string{"123", "456"},
TagIDs: []string{"123"},
}
Expand All @@ -194,10 +195,10 @@ func TestFTPTransferMonitors(t *testing.T) {
{
Name: "delete ftp transfer monitor",
ExpectedVerb: "DELETE",
ExpectedPath: "/monitors/123",
ExpectedPath: "/monitors/897654345678",
StatusCode: 200,
Fn: func(t *testing.T, c rest.Client) {
require.NoError(t, NewFTPTransferMonitors(c).Delete("123"))
require.NoError(t, NewFTPTransferMonitors(c).Delete("897654345678"))
},
},
})
Expand Down
49 changes: 25 additions & 24 deletions api/endpoints/monitors/isp_impl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ func TestISPMonitors(t *testing.T) {
Protocol: "1",
Port: 443,
CheckFrequency: "5",
LocationProfileID: "456",
NotificationProfileID: "789",
ThresholdProfileID: "012",
LocationProfileID: "123412341234123412",
NotificationProfileID: "123412341234123412",
ThresholdProfileID: "123412341234123414",
MonitorGroups: []string{"234", "567"},
DependencyResourceIDs: []string{"234", "567"},
DependencyResourceIDs: []string{"123", "456"},
UserGroupIDs: []string{"123", "456"},
TagIDs: []string{"123"},
}
Expand All @@ -53,6 +53,7 @@ func TestISPMonitors(t *testing.T) {
require.NoError(t, err)

expected := &api.ISPMonitor{
MonitorID: "897654345678",
DisplayName: "ISP Monitor",
Hostname: "www.example.com",
UseIPV6: true,
Expand All @@ -61,11 +62,11 @@ func TestISPMonitors(t *testing.T) {
Protocol: "1",
Port: 443,
CheckFrequency: "5",
LocationProfileID: "456",
NotificationProfileID: "789",
ThresholdProfileID: "012",
LocationProfileID: "123412341234123412",
NotificationProfileID: "123412341234123412",
ThresholdProfileID: "123412341234123414",
MonitorGroups: []string{"234", "567"},
DependencyResourceIDs: []string{"234", "567"},
DependencyResourceIDs: []string{"123", "456"},
UserGroupIDs: []string{"123", "456"},
TagIDs: []string{"123"},
}
Expand Down Expand Up @@ -94,11 +95,11 @@ func TestISPMonitors(t *testing.T) {
Protocol: "1",
Port: 443,
CheckFrequency: "5",
LocationProfileID: "456",
NotificationProfileID: "789",
ThresholdProfileID: "012",
LocationProfileID: "123412341234123412",
NotificationProfileID: "123412341234123412",
ThresholdProfileID: "123412341234123414",
MonitorGroups: []string{"234", "567"},
DependencyResourceIDs: []string{"234", "567"},
DependencyResourceIDs: []string{"123", "456"},
UserGroupIDs: []string{"123", "456"},
TagIDs: []string{"123"},
},
Expand All @@ -112,11 +113,11 @@ func TestISPMonitors(t *testing.T) {
Protocol: "1",
Port: 443,
CheckFrequency: "5",
LocationProfileID: "456",
NotificationProfileID: "789",
ThresholdProfileID: "012",
LocationProfileID: "123412341234123412",
NotificationProfileID: "123412341234123412",
ThresholdProfileID: "123412341234123414",
MonitorGroups: []string{"234", "567"},
DependencyResourceIDs: []string{"234", "567"},
DependencyResourceIDs: []string{"123", "456"},
UserGroupIDs: []string{"123", "456"},
TagIDs: []string{"123"},
},
Expand All @@ -128,13 +129,13 @@ func TestISPMonitors(t *testing.T) {
{
Name: "update isp monitor",
ExpectedVerb: "PUT",
ExpectedPath: "/monitors/123",
ExpectedPath: "/monitors/897654345678",
ExpectedBody: validation.Fixture(t, "requests/update_isp_monitor.json"),
StatusCode: 200,
ResponseBody: validation.JsonAPIResponseBody(t, nil),
Fn: func(t *testing.T, c rest.Client) {
ispMonitor := &api.ISPMonitor{
MonitorID: "123",
MonitorID: "897654345678",
DisplayName: "ISP Monitor",
Hostname: "www.example.com",
UseIPV6: true,
Expand All @@ -143,11 +144,11 @@ func TestISPMonitors(t *testing.T) {
Protocol: "1",
Port: 443,
CheckFrequency: "5",
LocationProfileID: "456",
NotificationProfileID: "789",
ThresholdProfileID: "012",
LocationProfileID: "123412341234123412",
NotificationProfileID: "123412341234123412",
ThresholdProfileID: "123412341234123414",
MonitorGroups: []string{"234", "567"},
DependencyResourceIDs: []string{"234", "567"},
DependencyResourceIDs: []string{"123", "456"},
UserGroupIDs: []string{"123", "456"},
TagIDs: []string{"123"},
}
Expand All @@ -159,10 +160,10 @@ func TestISPMonitors(t *testing.T) {
{
Name: "delete isp monitor",
ExpectedVerb: "DELETE",
ExpectedPath: "/monitors/123",
ExpectedPath: "/monitors/897654345678",
StatusCode: 200,
Fn: func(t *testing.T, c rest.Client) {
require.NoError(t, NewISPMonitors(c).Delete("123"))
require.NoError(t, NewISPMonitors(c).Delete("897654345678"))
},
},
})
Expand Down
Loading

0 comments on commit 50e1089

Please sign in to comment.