Skip to content

Commit

Permalink
Merge pull request #247 from jim-billy/TERRAFORM_PROVIDER_SITE24X7_MA…
Browse files Browse the repository at this point in the history
…IN_BRANCH

Bug fix - Removed default tag association.
  • Loading branch information
jim-0212 authored Mar 26, 2024
2 parents 7e4080f + fc81d24 commit cf395eb
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 22 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2023 Zoho Corporation Private Limited
Copyright (c) 2024 Zoho Corporation Private Limited

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ Contributions are what make the open source community such an amazing place to l

## License

Copyright (c) 2023 Zoho Corporation Private Limited
Copyright (c) 2024 Zoho Corporation Private Limited

This project is licensed under the MIT License - see [LICENSE](https://github.com/site24x7/terraform-provider-site24x7/blob/main/LICENSE) file for details.

Expand Down
5 changes: 2 additions & 3 deletions docs/resources/rest_api_monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,9 +161,8 @@ resource "site24x7_rest_api_monitor" "rest_api_monitor_us" {
// ================ GRAPHQL ATTRIBUTES
// (Optional) Provide content type for request params.
request_content_type = "G "
// (Optional) Provide the GraphQL query to get specific response from GraphQL based API service. request_content_type = "G"
// (Optional) Provide the GraphQL variables to get specific response from GraphQL based API service. request_content_type = "G"
// request_content_type = "G"
// (Optional) Provide the GraphQL query to get specific response from GraphQL based API service.
graphql={
query = "query GetFlimForId($FilmId:ID!){\n film(id:$FilmId){\n id\n title\n director\n producers\n }\n}"
variables = "{\n \"FilmId\":\"ZmlsbXM6NQ==\"\n}"
Expand Down
2 changes: 1 addition & 1 deletion docs/resources/website_monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ resource "site24x7_website_monitor" "website_monitor" {
* `check_frequency` (String) Interval at which your website has to be monitored. Default value is 1 minute.
* `timeout` (Number) Timeout for connecting to website. Default value is 10. Range 1 - 45.
* `use_ipv6`[Deprecated] (Boolean) Monitoring is performed over IPv6 from supported locations. IPv6 locations do not fall back to IPv4 on failure.
* `ip_type` (Number) Monitoring is performed over the selected internet protocol
* `ip_type` (Number) Monitoring is performed over the selected internet protocol. Default value is 0.
0|Monitoring is performed over IPv4 from supported locations
1|Monitoring is performed over IPv6 from supported locations
2|IPv4 or IPv6 option will help in flexibly switching to the protocol that is supported in a particular location if one protocol fails.
Expand Down
22 changes: 16 additions & 6 deletions examples/website_monitor_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,24 @@ resource "site24x7_website_monitor" "website_monitor" {
// (Optional) Monitoring is performed over IPv6 from supported locations. IPv6 locations do not fall back to IPv4 on failure.
use_ipv6 = false

//(Optional)Ip type of the monitor
// (Optional) Monitoring is performed over the selected internet protocol
// 0|Monitoring is performed over IPv4 from supported locations
// 1|Monitoring is performed over IPv6 from supported locations
// 2|IPv4 or IPv6 option will help in flexibly switching to the protocol that is supported in a particular location if one protocol fails.
// 3|IPv4 and IPv6 will create two connections for each protocol.
ip_type = 3

//Primary internet protocol for the resource
primary_protocol=_1

//secondary resource configuration
secondary_protocol_severity=2
// (Optional) Choose the primary internet protocol for the resources. Select only if you're choosing the option, Both IPv4 and IPv6 monitoring.
// Options :
// 0|IPv4
// 1|IPv6
primary_protocol =_1

// (Optional) Configure the change for the secondary resource for which you'd like to get notifications. Select only if you're choosing the option,Both IPv4 and IPv6 monitoring.​
// Options :
// 2|Trouble
// 3|Critical
secondary_protocol_severity = 2

// (Optional) Timeout for connecting to website. Range 1 - 45. Default: 10
timeout = 10
Expand Down
9 changes: 1 addition & 8 deletions site24x7/monitor_defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -237,15 +237,8 @@ func SetTags(client Client, d *schema.ResourceData, monitor api.Site24x7Monitor)
return nil, errors.New("Unable to find tag matching the List : \"" + strings.Join(tagNamesInConf, ", ") + "\" in Site24x7. Please configure a valid value for the argument \"tag_names\"")
}
monitor.SetTagIDs(tagIDs)

d.Set("tag_ids", tagIDs)
} else if len(monitor.GetTagIDs()) == 0 { // This will be true when tag_ids in the configuration file is empty during resource addition.
if len(tagsList) == 0 {
// Tags are not mandatory for successful monitor addition.
return tagIDs, nil
}
tag := tagsList[0]
monitor.SetTagIDs([]string{tag.TagID})
d.Set("tag_ids", []string{tag.TagID})
}
return tagIDs, nil
}
5 changes: 3 additions & 2 deletions site24x7/monitors/website.go
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,9 @@ var websiteMonitorSchema = map[string]*schema.Schema{
},
"ip_type": {
Type: schema.TypeInt,
Required: true,
Description: "Monitoring is performed over IPv6 from supported locations. IPv6 locations do not fall back to IPv4 on failure.",
Optional: true,
Default: 0,
Description: "Monitoring is performed over the selected internet protocol. 0 - Monitoring is performed over IPv4 from supported locations. 1 - Monitoring is performed over IPv6 from supported locations. 2 - IPv4 or IPv6 option will help in flexibly switching to the protocol that is supported in a particular location if one protocol fails. 3 - IPv4 and IPv6 will create two connections for each protocol. Default value is 0.",
},
"primary_protocol": {
Type: schema.TypeInt,
Expand Down

0 comments on commit cf395eb

Please sign in to comment.