Skip to content

Commit

Permalink
Merge pull request #42 from catchpoint/develop
Browse files Browse the repository at this point in the history
1.1 Version update
  • Loading branch information
mjkozicki authored May 24, 2024
2 parents f4b3338 + bace0f8 commit 444e833
Show file tree
Hide file tree
Showing 21 changed files with 368 additions and 238 deletions.
40 changes: 26 additions & 14 deletions catchpoint/resource_api_test_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func resourceApiTestType() *schema.Resource {
"folder_id": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
Description: "Optional. The Folder under which the Test will be created",
},
"test_name": {
Expand Down Expand Up @@ -68,7 +69,8 @@ func resourceApiTestType() *schema.Resource {
"gateway_address_or_host": {
Type: schema.TypeString,
Optional: true,
Description: "Host/IP to use for network troubleshooting and monitoring",
Computed: true,
Description: "Optional. Host/IP to use for network troubleshooting and monitoring",
},
"enable_test_data_webhook": {
Type: schema.TypeBool,
Expand All @@ -84,7 +86,8 @@ func resourceApiTestType() *schema.Resource {
},
"start_time": {
Type: schema.TypeString,
Required: true,
Optional: true,
Computed: true,
Description: "Start time for the Test in ISO format like 2024-12-30T04:59:00Z",
},
"end_time": {
Expand All @@ -93,13 +96,16 @@ func resourceApiTestType() *schema.Resource {
Description: "End time for the Test in ISO format like 2024-12-30T04:59:00Z",
},
"status": {
Type: schema.TypeString,
Optional: true,
Description: "Optional. Test status: active or inactive",
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Optional. Test status: active or inactive",
ValidateFunc: validation.StringInSlice([]string{"active", "inactive"}, false),
},
"label": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
Description: "Optional. Label with key, values pair",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand All @@ -120,6 +126,7 @@ func resourceApiTestType() *schema.Resource {
"thresholds": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
Description: "Optional. Test thresholds for test time and availability percentage",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand All @@ -145,6 +152,7 @@ func resourceApiTestType() *schema.Resource {
"request_settings": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
MaxItems: 1,
Description: "Optional. Used for overriding authentication and HTTP request headers",
Elem: &schema.Resource{
Expand Down Expand Up @@ -458,6 +466,7 @@ func resourceApiTestType() *schema.Resource {
"insights": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
MaxItems: 1,
Description: "Optional. Used for overriding the insights section",
Elem: &schema.Resource{
Expand All @@ -484,19 +493,20 @@ func resourceApiTestType() *schema.Resource {
"schedule_settings": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
MaxItems: 1,
Description: "Optional. Used for overriding the schedule section",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"run_schedule_id": {
Type: schema.TypeInt,
Optional: true,
Description: "The run schedule id to utilize for the test",
Description: "Optional. The run schedule id to utilize for the test",
},
"maintenance_schedule_id": {
Type: schema.TypeInt,
Optional: true,
Description: "The maintenance schedule id to utilize for the test",
Description: "Optional. The maintenance schedule id to utilize for the test",
},
"frequency": {
Type: schema.TypeString,
Expand All @@ -513,7 +523,7 @@ func resourceApiTestType() *schema.Resource {
"node_ids": {
Type: schema.TypeList,
Optional: true,
Description: "Optional if node_group_ids is used. Node ids in a list",
Description: "Optional. if node_group_ids is used. Node ids in a list",
Elem: &schema.Schema{
Type: schema.TypeInt,
},
Expand All @@ -529,14 +539,15 @@ func resourceApiTestType() *schema.Resource {
"no_of_subset_nodes": {
Type: schema.TypeInt,
Optional: true,
Description: "Number of subset nodes",
Description: "Optional. Number of subset nodes",
},
},
},
},
"alert_settings": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
MaxItems: 1,
Description: "Optional. Used for overriding the alert section",
Elem: &schema.Resource{
Expand Down Expand Up @@ -675,8 +686,8 @@ func resourceApiTestType() *schema.Resource {
"notification_group": {
Type: schema.TypeSet,
Required: true,
MaxItems: 1,
Description: "Notification group for configuring alert notifications, including recipients' email addresses and alert settings. To ensure either recipient_email_ids or contact_groups is provided",
MaxItems: 5,
Description: "List of Notification groups for configuring alert notifications, including recipients' email addresses and alert settings. To ensure either recipient_email_ids or contact_groups is provided",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"notify_on_warning": {
Expand Down Expand Up @@ -705,15 +716,15 @@ func resourceApiTestType() *schema.Resource {
"recipient_email_ids": {
Type: schema.TypeList,
Optional: true,
Description: "List of email addresses to receive alert notifications. To ensure either recipient_email_ids or contact_groups is provided",
Description: "Optional. List of email addresses to receive alert notifications. To ensure either recipient_email_ids or contact_groups is provided",
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"contact_groups": {
Type: schema.TypeList,
Optional: true,
Description: "List of contact groups to receive alert notifications. To ensure either recipient_email_ids or contact_groups is provided",
Description: "Optional. List of contact groups to receive alert notifications. To ensure either recipient_email_ids or contact_groups is provided",
Elem: &schema.Schema{
Type: schema.TypeString,
},
Expand Down Expand Up @@ -755,7 +766,7 @@ func resourceApiTestType() *schema.Resource {
"contact_groups": {
Type: schema.TypeList,
Optional: true,
Description: "List of contact groups to receive alert notifications. To ensure either recipient_email_ids or contact_groups is provided",
Description: "Optional. List of contact groups to receive alert notifications. To ensure either recipient_email_ids or contact_groups is provided",
Elem: &schema.Schema{
Type: schema.TypeString,
},
Expand All @@ -769,6 +780,7 @@ func resourceApiTestType() *schema.Resource {
"advanced_settings": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
Description: "Optional. Used for overriding the advanced settings",
MaxItems: 1,
Elem: &schema.Resource{
Expand Down
24 changes: 15 additions & 9 deletions catchpoint/resource_bgp_test_type.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ func resourceBgpTestType() *schema.Resource {
"folder_id": {
Type: schema.TypeInt,
Optional: true,
Computed: true,
Description: "Optional. The Folder under which the Test will be created",
},
"test_name": {
Expand Down Expand Up @@ -73,7 +74,8 @@ func resourceBgpTestType() *schema.Resource {
},
"start_time": {
Type: schema.TypeString,
Required: true,
Optional: true,
Computed: true,
Description: "Start time for the Test in ISO format like 2024-12-30T04:59:00Z",
},
"end_time": {
Expand All @@ -82,13 +84,16 @@ func resourceBgpTestType() *schema.Resource {
Description: "End time for the Test in ISO format like 2024-12-30T04:59:00Z",
},
"status": {
Type: schema.TypeString,
Optional: true,
Description: "Optional. Test status: active or inactive",
Type: schema.TypeString,
Optional: true,
Computed: true,
Description: "Optional. Test status: active or inactive",
ValidateFunc: validation.StringInSlice([]string{"active", "inactive"}, false),
},
"label": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
Description: "Optional. Label with key, values pair",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
Expand All @@ -109,6 +114,7 @@ func resourceBgpTestType() *schema.Resource {
"alert_settings": {
Type: schema.TypeSet,
Optional: true,
Computed: true,
MaxItems: 1,
Description: "Optional. Used for overriding the alert section",
Elem: &schema.Resource{
Expand Down Expand Up @@ -247,8 +253,8 @@ func resourceBgpTestType() *schema.Resource {
"notification_group": {
Type: schema.TypeSet,
Required: true,
MaxItems: 1,
Description: "Notification group for configuring alert notifications, including recipients' email addresses and alert settings. To ensure either recipient_email_ids or contact_groups is provided",
MaxItems: 5,
Description: "List of Notification groups for configuring alert notifications, including recipients' email addresses and alert settings. To ensure either recipient_email_ids or contact_groups is provided",
Elem: &schema.Resource{
Schema: map[string]*schema.Schema{
"notify_on_warning": {
Expand Down Expand Up @@ -277,15 +283,15 @@ func resourceBgpTestType() *schema.Resource {
"recipient_email_ids": {
Type: schema.TypeList,
Optional: true,
Description: "List of email addresses to receive alert notifications. To ensure either recipient_email_ids or contact_groups is provided",
Description: "Optional. List of email addresses to receive alert notifications. To ensure either recipient_email_ids or contact_groups is provided",
Elem: &schema.Schema{
Type: schema.TypeString,
},
},
"contact_groups": {
Type: schema.TypeList,
Optional: true,
Description: "List of contact groups to receive alert notifications. To ensure either recipient_email_ids or contact_groups is provided",
Description: "Optional. List of contact groups to receive alert notifications. To ensure either recipient_email_ids or contact_groups is provided",
Elem: &schema.Schema{
Type: schema.TypeString,
},
Expand Down Expand Up @@ -327,7 +333,7 @@ func resourceBgpTestType() *schema.Resource {
"contact_groups": {
Type: schema.TypeList,
Optional: true,
Description: "List of contact groups to receive alert notifications. To ensure either recipient_email_ids or contact_groups is provided",
Description: "Optional. List of contact groups to receive alert notifications. To ensure either recipient_email_ids or contact_groups is provided",
Elem: &schema.Schema{
Type: schema.TypeString,
},
Expand Down
Loading

0 comments on commit 444e833

Please sign in to comment.