site24x7

package
v1.0.81 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// APIBaseURL is the base url of the Site24x7 API.
	APIBaseURL = "https://www.site24x7.com/api"
)

Variables

View Source
var LocationProfileSchema = map[string]*schema.Schema{
	"profile_name": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Display name for the location profile.",
	},
	"primary_location": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Primary location for monitoring.",
	},
	"secondary_locations": {
		Type:     schema.TypeSet,
		Required: true,
		Elem: &schema.Schema{
			Type: schema.TypeString,
		},
		Description: "List of secondary locations for monitoring",
	},
	"restrict_alternate_location_polling": {
		Type:        schema.TypeBool,
		Optional:    true,
		Description: "Restricts polling of the resource from the selected locations alone in the Location Profile, overrides the alternate location poll logic.",
	},
	"outer_regions_location_consent": {
		Type:     schema.TypeBool,
		Optional: true,

		Description: "Consent is mandatory for monitoring from countries outside the European Economic Area (EEA) and the Adequate countries. To provide your consent, set outer_regions_location_consent as true.",
	},
}
View Source
var MonitorGroupSchema = map[string]*schema.Schema{
	"display_name": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Display Name for the Monitor Group.",
	},
	"description": {
		Type:        schema.TypeString,
		Optional:    true,
		Description: "Description for the Monitor Group.",
	},

	"health_threshold_count": {
		Type:        schema.TypeInt,
		Optional:    true,
		Default:     1,
		Description: "Number of monitors' health that decide the group status. ‘0’ implies that all the monitors are considered for determining the group status. Default value is 1.",
	},
	"dependency_resource_ids": {
		Type: schema.TypeSet,
		Elem: &schema.Schema{
			Type: schema.TypeString,
		},
		Optional:    true,
		Description: "List of dependent resource IDs. Suppress alert when dependent monitor(s) is down.",
	},
	"suppress_alert": {
		Type:        schema.TypeBool,
		Optional:    true,
		Default:     false,
		Description: "Boolean value indicating whether to suppress alert when the dependent monitor is down. Setting suppress_alert = true with an empty dependency_resource_id is meaningless.",
	},
}
View Source
var NotificationProfileSchema = map[string]*schema.Schema{
	"profile_name": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Display Name for the notification profile.",
	},
	"rca_needed": {
		Type:        schema.TypeBool,
		Optional:    true,
		Default:     true,
		Description: "Configuration to send root cause analysis when the monitor is down. Default is true.",
	},
	"notify_after_executing_actions": {
		Type:        schema.TypeBool,
		Optional:    true,
		Description: "Configuration to raise alerts for downtime only after executing the pre-configured monitor actions. Default is false.",
	},
	"template_id": {
		Type:        schema.TypeString,
		Optional:    true,
		Default:     0,
		Description: "Email template ID for notification.",
	},
	"suppress_automation": {
		Type:        schema.TypeBool,
		Optional:    true,
		Default:     true,
		Description: "Configuration to stop automation from being executed on the dependent monitors. Default is true.",
	},
	"alert_configuration": {
		Type:        schema.TypeSet,
		Optional:    true,
		Description: "Configuration to alert the user. All alerts will be sent through the notification mode of your preference. You can also configure the business hours and the status for which you would like to receive an alert. If you do not set any specific business hours or status preferences, you'll receive alerts for all the status changes throughout the day.",
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"status": {
					Type:         schema.TypeInt,
					Optional:     true,
					Default:      -1,
					ValidateFunc: validation.IntInSlice([]int{-1, 0, 1, 2, 3}),
					Description:  "Status for which alerts should be raised. '-1' denotes 'Any', '0' denotes 'Down', '1' denotes 'Up', '2' denotes 'Trouble' and '3' denotes 'Critical'.",
				},
				"business_hours_id": {
					Type:        schema.TypeString,
					Optional:    true,
					Default:     "-1",
					Description: "Alerting Period - Predefined business hours during which alerts should be sent. Default value is '-1' and it denotes 'All Hours'.",
				},
				"notification_medium": {
					Type:     schema.TypeList,
					Required: true,
					Elem: &schema.Schema{
						Type: schema.TypeInt,
					},
					Description: "Medium through which you’d wish to receive the notifications. Default value is 1. '1' denotes 'Email', '2' denotes 'SMS', '3' denotes 'Voice Call' and '6' denotes 'Mobile push notification'.",
				},
				"outside_business_hours": {
					Type:        schema.TypeString,
					Optional:    true,
					Default:     0,
					Description: "To specify whether the user would receive alerts within or beyond business hours. Default value is '0' and it denotes 'Time within the business_hours_id configured', '1' denotes 'Time outside the business_hours_id configured'.",
				},
			},
		},
	},
	"notification_delay_configuration": {
		Type:        schema.TypeSet,
		Optional:    true,
		Description: "You can choose to delay and receive Down, Trouble, or Critical notifications if the monitor remains in the same state for a specific number of polls. If you haven't configured any Notification Delay for a specific period, you'll receive alerts immediately.",
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"status": {
					Type:         schema.TypeInt,
					Optional:     true,
					Default:      0,
					ValidateFunc: validation.IntInSlice([]int{0, 2, 3}),
					Description:  "Status for which alerts should be raised. '0' denotes 'Down', '2' denotes 'Trouble' and '3' denotes 'Critical'.",
				},
				"business_hours_id": {
					Type:        schema.TypeString,
					Optional:    true,
					Default:     "-1",
					Description: "Alerting Period - Predefined business hours during which alerts should be sent. Default value is '-1' and it denotes 'All Hours'.",
				},
				"notification_delay": {
					Type:         schema.TypeInt,
					Optional:     true,
					Default:      1,
					ValidateFunc: validation.IntInSlice([]int{1, 2, 3, 4, 5}),
					Description:  "Notify based on the downtime delay constants define here - https://www.site24x7.com/help/api/#notification-profile-constants. Default value is '1' and it denotes 'Notify immediately after failure'.",
				},
				"outside_business_hours": {
					Type:        schema.TypeString,
					Optional:    true,
					Default:     0,
					Description: "To specify whether the user would receive alerts within or beyond business hours. Default value is '0' and it denotes 'Time within the business_hours_id configured', '1' denotes 'Time outside the business_hours_id configured'.",
				},
			},
		},
	},
	"persistent_alert_configuration": {
		Type:        schema.TypeSet,
		Optional:    true,
		Description: "Persistent alerts provide continuous notifications until you acknowledge the Down/Critical/Trouble alarm. You will be receiving alerts until you acknowledge the alarms, at the frequency you've configured in the Notify Every Field.",
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"notify_every": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntAtMost(60),
					Description:  "Denotes the number of times the error has to be ignored before sending a notification. Value ranges from 0-60.",
				},
				"notification_medium": {
					Type:     schema.TypeList,
					Required: true,
					Elem: &schema.Schema{
						Type: schema.TypeInt,
					},
					Description: "Medium through which you’d wish to receive the notifications. Default value is 1. '1' denotes 'Email', '2' denotes 'SMS', '3' denotes 'Voice Call' and '6' denotes 'Mobile push notification'.",
				},
				"third_party_services": {
					Type:     schema.TypeList,
					Optional: true,
					Elem: &schema.Schema{
						Type: schema.TypeString,
					},
					Description: "Third-party services through which you’d wish to receive the notification.",
				},
			},
		},
	},
	"escalation_levels": {
		Type:        schema.TypeSet,
		Optional:    true,
		Description: "Configuration to receive persistent notifications after a specific number of errors.",
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"user_group_id": {
					Type:        schema.TypeString,
					Required:    true,
					Description: "User group ID for downtime escalation.",
				},
				"escalation_wait_time": {
					Type:        schema.TypeInt,
					Required:    true,
					Description: "Mandatory, if any User Alert Group is added for escalation Downtime duration for escalation in mins.",
				},
				"notification_medium": {
					Type:     schema.TypeList,
					Required: true,
					Elem: &schema.Schema{
						Type: schema.TypeInt,
					},
					Description: "Medium through which you’d wish to receive the notifications. Default value is 1. '1' denotes 'Email', '2' denotes 'SMS', '3' denotes 'Voice Call' and '6' denotes 'Mobile push notification'.",
				},
				"third_party_services": {
					Type:     schema.TypeList,
					Optional: true,
					Elem: &schema.Schema{
						Type: schema.TypeString,
					},
					Description: "Third-party services through which you’d wish to receive the notification.",
				},
			},
		},
	},
	"escalation_automations": {
		Type:     schema.TypeSet,
		Optional: true,
		Elem: &schema.Schema{
			Type: schema.TypeString,
		},
		Description: "Execute configured IT automations during an escalation.",
	},
}
View Source
var SubgroupSchema = map[string]*schema.Schema{
	"display_name": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Display Name for the Subgroup.",
	},
	"parent_group_id": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Unique ID of the parent group under which subgroup has to be configured. It can be a subgroup or Monitor group. (In case of level 1 subgroup, top_group_id is monitor group id. In other cases it will be subgroup id. You can get the subgroup Ids configured for top_group_id by using business view API).",
	},
	"top_group_id": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Unique ID of the top monitor group for which business view has been configured.",
	},
	"description": {
		Type:        schema.TypeString,
		Optional:    true,
		Description: "Description for the Subgroup.",
	},
	"health_threshold_count": {
		Type:        schema.TypeInt,
		Optional:    true,
		Default:     1,
		Description: "Number of monitors' health that decide the group status. ‘0’ implies that all the monitors are considered for determining the group status. Default value is 1.",
	},
	"monitors": {
		Type: schema.TypeSet,
		Elem: &schema.Schema{
			Type: schema.TypeString,
		},
		Optional:    true,
		Description: "Monitors to be associated with the Subgroup.",
	},
	"group_type": {
		Type:        schema.TypeInt,
		Optional:    true,
		Default:     1,
		Description: "Denotes the type of monitors that can be associated. ‘1’ implies that all type of monitors can be associated with this subgroup. Default value is 1. '2' - Web, '3' - Port/Ping, '4' - Server, '5' - Database, '6' - Synthetic Transaction, '7' - Web API, '8' - APM Insight,'9' - Network Devices, '10' - RUM, '11' - AppLogs Monitor",
	},
}
View Source
var TagSchema = map[string]*schema.Schema{
	"tag_name": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Display Name for the Tag.",
	},
	"tag_value": {
		Type:        schema.TypeString,
		Optional:    true,
		Description: "Value for the Tag.",
	},
	"tag_color": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Color code for the Tag. Possible values are '#B7DA9E','#73C7A3','#B5DCDF','#D4ABBB','#4895A8','#DFE897','#FCEA8B','#FFC36D','#F79953','#F16B3C','#E55445','#F2E2B6','#DEC57B','#CBBD80','#AAB3D4','#7085BA','#F6BDAE','#EFAB6D','#CA765C','#999','#4A148C','#009688','#00ACC1','#0091EA','#8BC34A','#558B2F'",
	},
}
View Source
var ThresholdProfileSchema = map[string]*schema.Schema{
	"profile_name": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Display Name for the threshold profile",
	},
	"type": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Type of the monitor for which the threshold profile is being created.",
	},
	"profile_type": {
		Type:         schema.TypeInt,
		Optional:     true,
		Default:      1,
		ValidateFunc: validation.IntInSlice([]int{1, 2}),
		Description:  "Static Threshold(1) or AI-based Threshold(2)",
	},
	"profile_type_name": {
		Type:         schema.TypeInt,
		Optional:     true,
		Default:      1,
		ValidateFunc: validation.IntInSlice([]int{1, 2}),
		Description:  "Static Threshold(1) or AI-based Threshold(2)",
	},
	"down_location_threshold": {
		Type:         schema.TypeInt,
		Optional:     true,
		Default:      3,
		ValidateFunc: validation.IntInSlice([]int{0, 1, 2, 3, 4, 5, 6, 7, 8}),
		Description:  "Triggers alert when the monitor is down from configured number of locations. Default value is '3'",
	},
	"website_content_modified": {
		Type:        schema.TypeBool,
		Optional:    true,
		Description: "Triggers alert when the website content is modified.",
	},
	"read_time_out": {
		Type:     schema.TypeMap,
		Optional: true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"severity": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{0, 2, 3}),
				},
				"value": {
					Type:     schema.TypeBool,
					Required: true,
				},
			},
		},
		Description: "Triggers alert when not receiving the website entire HTTP response within 30 seconds.",
	},
	"website_content_changes": {
		Type:     schema.TypeList,
		Optional: true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"severity": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{0, 2, 3}),
				},
				"comparison_operator": {
					Type:         schema.TypeInt,
					Optional:     true,
					Default:      1,
					ValidateFunc: validation.IntInSlice([]int{1}),
				},
				"value": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntAtMost(100),
				},
			},
		},
		Description: "Triggers alert when the website content changes by configured percentage.",
	},
	"primary_response_time_trouble_threshold": {
		Type:     schema.TypeMap,
		Optional: true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"severity": {
					Type:     schema.TypeInt,
					Required: true,

					ValidateFunc: validation.IntInSlice([]int{2}),
				},
				"comparison_operator": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{1, 2, 3, 4, 5}),
				},
				"value": {
					Type:     schema.TypeInt,
					Required: true,
				},
				"strategy": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{1, 2, 3, 4}),
				},
				"polls_check": {
					Type:     schema.TypeInt,
					Required: true,
				},
			},
		},
		Description: "Response time trouble threshold for the primary monitoring location. Anomaly Enabled Attribute",
	},
	"primary_response_time_critical_threshold": {
		Type:     schema.TypeMap,
		Optional: true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"severity": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{3}),
				},
				"comparison_operator": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{1, 2, 3, 4, 5}),
				},
				"value": {
					Type:     schema.TypeInt,
					Required: true,
				},
				"strategy": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{1, 2, 3, 4}),
				},
				"polls_check": {
					Type:     schema.TypeInt,
					Required: true,
				},
			},
		},
		Description: "Response time critical threshold for the primary monitoring location. Anomaly Enabled Attribute",
	},
	"secondary_response_time_trouble_threshold": {
		Type:     schema.TypeMap,
		Optional: true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"severity": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{2}),
				},
				"comparison_operator": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{1, 2, 3, 4, 5}),
				},
				"value": {
					Type:     schema.TypeInt,
					Required: true,
				},
				"strategy": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{1, 2, 3, 4}),
				},
				"polls_check": {
					Type:     schema.TypeInt,
					Required: true,
				},
			},
		},
		Description: "Response time trouble threshold for the secondary monitoring location. Anomaly Enabled Attribute",
	},
	"secondary_response_time_critical_threshold": {
		Type:     schema.TypeMap,
		Optional: true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"severity": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{3}),
				},
				"comparison_operator": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{1, 2, 3, 4, 5}),
				},
				"value": {
					Type:     schema.TypeInt,
					Required: true,
				},
				"strategy": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{1, 2, 3, 4}),
				},
				"polls_check": {
					Type:     schema.TypeInt,
					Required: true,
				},
			},
		},
		Description: "Response time critical threshold for the secondary monitoring location. Anomaly Enabled Attribute",
	},

	"ssl_cert_fingerprint_modified": {
		Type:        schema.TypeBool,
		Optional:    true,
		Description: "Triggers alert when the ssl certificate is modified.",
	},
	"ssl_cert_days_until_expiry_trouble_threshold": {
		Type:     schema.TypeMap,
		Optional: true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"severity": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{2}),
				},
				"value": {
					Type:     schema.TypeInt,
					Required: true,
				},
			},
		},
		Description: "Triggers trouble alert before the SSL certificate expires within the configured number of days.",
	},
	"ssl_cert_days_until_expiry_critical_threshold": {
		Type:     schema.TypeMap,
		Optional: true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"severity": {
					Type:         schema.TypeInt,
					Required:     true,
					ValidateFunc: validation.IntInSlice([]int{2}),
				},
				"value": {
					Type:     schema.TypeInt,
					Required: true,
				},
			},
		},
		Description: "Triggers critical alert before the SSL certificate expires within the configured number of days.",
	},

	"trouble_if_not_pinged_more_than": {
		Type:        schema.TypeInt,
		Optional:    true,
		Description: "Generate Trouble Alert if not pinged for more than x mins.",
	},
	"down_if_not_pinged_more_than": {
		Type:        schema.TypeInt,
		Optional:    true,
		Description: "Generate Down Alert if not pinged for more than x mins.",
	},
	"trouble_if_pinged_within": {
		Type:        schema.TypeInt,
		Optional:    true,
		Description: "Generate Trouble Alert if pinged within x mins",
	},
}
View Source
var URLActionSchema = map[string]*schema.Schema{
	"name": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Display name for the Action.",
	},
	"url": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "URL to be invoked for action execution.",
	},
	"method": {
		Type:        schema.TypeString,
		Optional:    true,
		Default:     "G",
		Description: "HTTP Method to access the action url.",
	},
	"timeout": {
		Type:        schema.TypeInt,
		Optional:    true,
		Default:     10,
		Description: "Timeout for connecting to website. Default value is 10. Range 1 - 90.",
	},
	"send_custom_parameters": {
		Type:        schema.TypeBool,
		Optional:    true,
		Default:     false,
		Description: "Configuration to send custom parameters while executing the action.",
	},
	"custom_parameters": {
		Type:        schema.TypeString,
		Optional:    true,
		Description: "Mandatory, if send_custom_parameters is set as true. Custom parameters to be passed while accessing the action url.",
	},
	"send_in_json_format": {
		Type:        schema.TypeBool,
		Optional:    true,
		Default:     false,
		Description: "Optional, use only if HTTP Method chosen is GET. Configuration to enable json format for post parameters.",
	},
	"send_email": {
		Type:        schema.TypeBool,
		Optional:    true,
		Default:     false,
		Description: "Boolean indicating whether to send email or not.",
	},
	"send_incident_parameters": {
		Type:        schema.TypeBool,
		Optional:    true,
		Default:     false,
		Description: "Configuration to send incident parameters while executing the action.",
	},
	"auth_method": {
		Type:        schema.TypeString,
		Optional:    true,
		Default:     "B",
		Description: "Authentication method to access the action url.",
	},
	"user_agent": {
		Type:        schema.TypeString,
		Optional:    true,
		Description: "User Agent to be used while monitoring the website.",
	},
}
View Source
var UserGroupSchema = map[string]*schema.Schema{
	"display_name": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Display name for the user group.",
	},
	"attribute_group_id": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Attribute Alert Group to be associated with the User Alert group.",
	},
	"users": {
		Type:     schema.TypeSet,
		Required: true,
		Elem: &schema.Schema{
			Type: schema.TypeString,
		},
		Description: "User IDs of the users to be associated to the group.",
	},
	"product_id": {
		Type:         schema.TypeInt,
		Optional:     true,
		Default:      0,
		ValidateFunc: validation.IntInSlice([]int{0, 1, 2}),
		Description:  "Product for which the user group is being created. Default value is 0.",
	},
}
View Source
var UserSchema = map[string]*schema.Schema{
	"display_name": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Name of the User.",
	},
	"email_address": {
		Type:        schema.TypeString,
		Required:    true,
		Description: "Email address of the user. Email verification has to be done manually.",
	},
	"user_role": {
		Type:        schema.TypeInt,
		Required:    true,
		Description: "Role assigned to the user for accessing Site24x7. Role will be updated only after the user accepts the invitation. Refer https://www.site24x7.com/help/api/#site24x7_user_constants",
	},
	"statusiq_role": {
		Type:        schema.TypeInt,
		Optional:    true,
		Description: "Role assigned to the user for accessing StatusIQ.. Role will be updated only after the user accepts the invitation. Refer https://www.site24x7.com/help/api/#site24x7_user_constants",
	},
	"cloudspend_role": {
		Type:        schema.TypeInt,
		Optional:    true,
		Description: "Role assigned to the user for accessing CloudSpend. Role will be updated only after the user accepts the invitation. Refer https://www.site24x7.com/help/api/#site24x7_user_constants",
	},
	"job_title": {
		Type:        schema.TypeInt,
		Optional:    true,
		Description: "Provide your job title to be added in Site24x7. Refer https://www.site24x7.com/help/api/#job_title",
	},
	"selection_type": {
		Type:         schema.TypeInt,
		Optional:     true,
		Default:      0,
		ValidateFunc: validation.IntInSlice([]int{0, 1}),
		Description:  "Resource type associated to this user. Default value is '0'. Can take values 0|1. '0' denotes 'All Monitors', '1' denotes 'Monitor Group'. 'monitor_groups' attribute is mandatory when the 'selection_type' is '1'.",
	},
	"monitor_groups": {
		Type: schema.TypeSet,
		Elem: &schema.Schema{
			Type: schema.TypeString,
		},
		Optional:    true,
		Computed:    true,
		Description: "List of monitor groups to which the user has access to. 'monitor_groups' attribute is mandatory when the 'selection_type' is '1'",
	},
	"notification_medium": {
		Type:     schema.TypeSet,
		Required: true,
		Elem: &schema.Schema{
			Type: schema.TypeInt,
		},
		Description: "Medium through which you’d wish to receive the notifications. Default value is 1. '1' denotes 'Email', '2' denotes 'SMS', '3' denotes 'Voice Call'.",
	},
	"user_group_ids": {
		Type: schema.TypeSet,
		Elem: &schema.Schema{
			Type: schema.TypeString,
		},
		Optional:    true,
		Computed:    true,
		Description: "List of groups to be associated for the user for receiving alerts.",
	},
	"mobile_settings": {
		Type:     schema.TypeMap,
		Optional: true,
		Elem: &schema.Resource{
			Schema: map[string]*schema.Schema{
				"country_code": {
					Type:     schema.TypeInt,
					Required: true,
				},
				"mobile_number": {
					Type:     schema.TypeInt,
					Required: true,
				},
				"is_confirmed": {
					Type:     schema.TypeBool,
					Optional: true,
					Default:  false,
				},
				"call_provider_id": {
					Type:     schema.TypeInt,
					Optional: true,
					Default:  0,
				},
				"sms_provider_id": {
					Type:     schema.TypeInt,
					Optional: true,
					Default:  2,
				},
			},
		},
		Description: "Phone number configurations to receive alerts.",
	},

	"down_notification_medium": {
		Type:     schema.TypeSet,
		Required: true,
		Elem: &schema.Schema{
			Type: schema.TypeInt,
		},
		Description: "Medium through which you’d wish to receive the Down alerts. Default value is 1. '1' denotes 'Email', '2' denotes 'SMS', '3' denotes 'Voice Call'.",
	},
	"critical_notification_medium": {
		Type:     schema.TypeSet,
		Required: true,
		Elem: &schema.Schema{
			Type: schema.TypeInt,
		},
		Description: "Medium through which you’d wish to receive the Critical alerts. Default value is 1. '1' denotes 'Email', '2' denotes 'SMS', '3' denotes 'Voice Call'.",
	},
	"trouble_notification_medium": {
		Type:     schema.TypeSet,
		Required: true,
		Elem: &schema.Schema{
			Type: schema.TypeInt,
		},
		Description: "Medium through which you’d wish to receive the Trouble alerts. Default value is 1. '1' denotes 'Email', '2' denotes 'SMS', '3' denotes 'Voice Call'.",
	},
	"up_notification_medium": {
		Type:     schema.TypeSet,
		Required: true,
		Elem: &schema.Schema{
			Type: schema.TypeInt,
		},
		Description: "Medium through which you’d wish to receive the Up alerts. Default value is 1. '1' denotes 'Email', '2' denotes 'SMS', '3' denotes 'Voice Call'.",
	},
	"alerting_period_start_time": {
		Type:        schema.TypeString,
		Optional:    true,
		Default:     "00:00",
		Description: "Define a time window so you can receive Voice/SMS status alerts during this period alone. You can't define this window for email or IM based notifications.",
	},
	"alerting_period_end_time": {
		Type:        schema.TypeString,
		Optional:    true,
		Default:     "00:00",
		Description: "Define a time window so you can receive Voice/SMS status alerts during this period alone. You can't define this window for email or IM based notifications.",
	},
	"email_format": {
		Type:        schema.TypeInt,
		Optional:    true,
		Default:     1,
		Description: "Denotes the email format. '0' - Text, '1' - HTML",
	},
	"consent_for_non_eu_alerts": {
		Type:        schema.TypeBool,
		Optional:    true,
		Default:     false,
		Description: "The third-party providers we use to send SMS and voice alerts will process the data outside the EU region.",
	},
}

Functions

func DataSourceSite24x7ITAutomation added in v1.0.42

func DataSourceSite24x7ITAutomation() *schema.Resource

func DataSourceSite24x7LocationProfile added in v1.0.31

func DataSourceSite24x7LocationProfile() *schema.Resource

func DataSourceSite24x7MSP added in v1.0.41

func DataSourceSite24x7MSP() *schema.Resource

func DataSourceSite24x7MonitorGroup added in v1.0.25

func DataSourceSite24x7MonitorGroup() *schema.Resource

func DataSourceSite24x7NotificationProfile added in v1.0.34

func DataSourceSite24x7NotificationProfile() *schema.Resource

func DataSourceSite24x7Subgroup added in v1.0.49

func DataSourceSite24x7Subgroup() *schema.Resource

func DataSourceSite24x7Tag added in v1.0.24

func DataSourceSite24x7Tag() *schema.Resource

func DataSourceSite24x7ThresholdProfile added in v1.0.37

func DataSourceSite24x7ThresholdProfile() *schema.Resource

func DataSourceSite24x7UserGroup added in v1.0.38

func DataSourceSite24x7UserGroup() *schema.Resource

func DefaultLocationProfile

func DefaultLocationProfile(client Client, profileNameToMatch string) (*api.LocationProfile, error)

DefaultLocationProfile fetches all location profiles from the server and tries to find a match for the input profile name. If no match is found the first location profile from the list is returned. If no location profiles are configured, DefaultLocationProfile will return an error.

func DefaultNotificationProfile

func DefaultNotificationProfile(client Client) (*api.NotificationProfile, error)

DefaultNotificationProfile fetches the first notification profile returned by the client. If no notification profiles are configured, DefaultNotificationProfile will return an error.

func DefaultThresholdProfile

func DefaultThresholdProfile(client Client, monitorType api.MonitorType) (*api.ThresholdProfile, error)

DefaultThresholdProfile fetches all threshold profiles from the server and tries to match threshold profile type and the given monitor type. If no match is found the first threshold profile from the list is returned. If no threshold profiles are configured, DefaultThresholdProfile will return an error.

func DefaultUserGroup

func DefaultUserGroup(client Client) (*api.UserGroup, error)

DefaultUserGroup fetches the first user group returned by the client. If no user groups are configured, DefaultUserGroup will return an error.

func ResourceSite24x7LocationProfile

func ResourceSite24x7LocationProfile() *schema.Resource

func ResourceSite24x7MonitorGroup

func ResourceSite24x7MonitorGroup() *schema.Resource

func ResourceSite24x7NotificationProfile

func ResourceSite24x7NotificationProfile() *schema.Resource

func ResourceSite24x7Subgroup added in v1.0.25

func ResourceSite24x7Subgroup() *schema.Resource

func ResourceSite24x7Tag

func ResourceSite24x7Tag() *schema.Resource

func ResourceSite24x7ThresholdProfile

func ResourceSite24x7ThresholdProfile() *schema.Resource

func ResourceSite24x7URLAction

func ResourceSite24x7URLAction() *schema.Resource

func ResourceSite24x7User added in v1.0.49

func ResourceSite24x7User() *schema.Resource

func ResourceSite24x7UserGroup

func ResourceSite24x7UserGroup() *schema.Resource

func SetLocationProfile added in v1.0.44

func SetLocationProfile(client Client, d *schema.ResourceData, monitor api.Site24x7Monitor) (*api.LocationProfile, error)

func SetNotificationProfile

func SetNotificationProfile(client Client, d *schema.ResourceData, monitor api.Site24x7Monitor) (*api.NotificationProfile, error)

func SetTags

func SetTags(client Client, d *schema.ResourceData, monitor api.Site24x7Monitor) ([]string, error)

func SetUserGroup

func SetUserGroup(client Client, d *schema.ResourceData, monitor api.Site24x7Monitor) ([]string, error)

Types

type Client

type Client interface {
	CurrentStatus() endpoints.CurrentStatus
	LocationProfiles() endpoints.LocationProfiles
	LocationTemplate() endpoints.LocationTemplate
	MonitorGroups() endpoints.MonitorGroups
	Subgroups() endpoints.Subgroups
	Tags() endpoints.Tags
	ScheduleMaintenance() common.ScheduleMaintenance
	WebsiteMonitors() monitors.WebsiteMonitors
	DNSServerMonitors() monitors.DNSServerMonitors
	WebPageSpeedMonitors() monitors.WebPageSpeedMonitors
	SSLMonitors() monitors.SSLMonitors
	HeartbeatMonitors() monitors.HeartbeatMonitors
	ServerMonitors() monitors.ServerMonitors
	DomainExpiryMonitors() monitors.DomainExpiryMonitors
	WebTransactionBrowserMonitors() monitors.WebTransactionBrowserMonitors
	FTPTransferMonitors() monitors.FTPTransferMonitors
	ISPMonitors() monitors.ISPMonitors
	PortMonitors() monitors.PortMonitors
	PINGMonitors() monitors.PINGMonitors
	RestApiMonitors() monitors.RestApiMonitors
	RestApiTransactionMonitors() monitors.RestApiTransactionMonitors
	AmazonMonitors() monitors.AmazonMonitors
	NotificationProfiles() endpoints.NotificationProfiles
	ThresholdProfiles() endpoints.ThresholdProfiles
	Users() endpoints.Users
	UserGroups() endpoints.UserGroups
	URLActions() endpoints.URLActions
	ThirdPartyIntegrations() integration.ThirdpartyIntegrations
	OpsgenieIntegration() integration.OpsgenieIntegration
	SlackIntegration() integration.SlackIntegration
	WebhookIntegration() integration.WebhookIntegration
	PagerDutyIntegration() integration.PagerDutyIntegration
	ServiceNowIntegration() integration.ServiceNowIntegration
	ConnectwiseIntegration() integration.ConnectwiseIntegration
	TelegramIntegration() integration.TelegramIntegration
	MSP() endpoints.MSP
	AWSExternalID() aws.AWSExternalID
	DeviceKey() common.DeviceKey
	CredentialProfile() common.CredentialProfile
}

Client is the Site24x7 API Client interface. It provides methods to get clients for resource endpoints.

func New

func New(c Config) Client

New creates a new Site24x7 API Client with Config c.

func NewClient

func NewClient(httpClient HTTPClient, c Config) Client

NewClient creates a new Site24x7 API Client from httpClient with default API base URL. This can be used to provide a custom http client for use with the API. The custom http client has to transparently handle the Site24x7 OAuth flow.

type Config

type Config struct {
	// ClientID is the OAuth client ID needed to obtain an access token for API
	// usage.
	ClientID string

	// ClientSecret is the OAuth client secret needed to obtain an access token
	// for API usage.
	ClientSecret string

	// RefreshToken is a token that's used by the application
	// (as opposed to the user) to refresh the access token
	// if it expires.
	RefreshToken string

	// AccessToken is a token that's used by the application for identifying the user
	// and retrieve the data related to him.
	AccessToken string

	// AccessToken expiry in seconds
	Expiry string

	// Application Account ID of the customer.
	ZAAID string

	// APIBaseURL allows overriding the default API base URL (https://www.site24x7.com/api).
	// See https://www.site24x7.com/help/api/index.html#introduction for options of data centers for top level domain.
	APIBaseURL string

	// TokenURL allows overriding the default token URL (https://accounts.zoho.com/oauth/v2/token).
	// See https://www.site24x7.com/help/api/index.html#authentication for options of data centers for top level domain.
	TokenURL string

	// RetryConfig contains the configuration of the backoff-retry behavior. If
	// nil, backoff.DefaultRetryConfig will be used.
	RetryConfig *backoff.RetryConfig
}

Config is the configuration for the Site24x7 API Client.

func (*Config) OAuthClient

func (c *Config) OAuthClient(ctx context.Context) *http.Client

OAuthClient creates a new *http.Client from c that transparently obtains and attaches OAuth access tokens to every request.

type DataCenter

type DataCenter struct {
	// contains filtered or unexported fields
}

func GetDataCenter

func GetDataCenter(dataCenterCode string) DataCenter

func (*DataCenter) GetAPIBaseURL

func (dc *DataCenter) GetAPIBaseURL() string

func (*DataCenter) GetTokenURL

func (dc *DataCenter) GetTokenURL() string

type HTTPClient

type HTTPClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HTTPClient is the interface of an http client that is compatible with *http.Client.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL