Skip to content

Commit

Permalink
Update to latest API schema
Browse files Browse the repository at this point in the history
  • Loading branch information
alexmingoia committed Nov 5, 2024
1 parent 1b95fcb commit 4acb7a2
Show file tree
Hide file tree
Showing 25 changed files with 2,503 additions and 265 deletions.
2 changes: 1 addition & 1 deletion client/custom_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func (c *Client) CreateCustomField(d *CustomField) (*CustomField, error) {
}

func (c *Client) GetCustomField(id string) (*CustomField, error) {
req, err := rootlygo.NewGetCustomFieldRequest(c.Rootly.Server, id)
req, err := rootlygo.NewGetCustomFieldRequest(c.Rootly.Server, id, nil)
if err != nil {
return nil, errors.Errorf("Error building request: %s", err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion client/dashboards.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (c *Client) CreateDashboard(dashboard *Dashboard) (*Dashboard, error) {
}

func (c *Client) GetDashboard(id string) (*Dashboard, error) {
req, err := rootlygo.NewGetDashboardRequest(c.Rootly.Server, id)
req, err := rootlygo.NewGetDashboardRequest(c.Rootly.Server, id, nil)
if err != nil {
return nil, errors.Errorf("Error building request: %s", err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion client/escalation_paths.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (c *Client) CreateEscalationPath(d *EscalationPath) (*EscalationPath, error
}

func (c *Client) GetEscalationPath(id string) (*EscalationPath, error) {
req, err := rootlygo.NewGetEscalationPathRequest(c.Rootly.Server, id)
req, err := rootlygo.NewGetEscalationPathRequest(c.Rootly.Server, id, nil)
if err != nil {
return nil, errors.Errorf("Error building request: %s", err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion client/escalation_policies.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (c *Client) CreateEscalationPolicy(d *EscalationPolicy) (*EscalationPolicy,
}

func (c *Client) GetEscalationPolicy(id string) (*EscalationPolicy, error) {
req, err := rootlygo.NewGetEscalationPolicyRequest(c.Rootly.Server, id)
req, err := rootlygo.NewGetEscalationPolicyRequest(c.Rootly.Server, id, nil)
if err != nil {
return nil, errors.Errorf("Error building request: %s", err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion client/form_fields.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func (c *Client) CreateFormField(d *FormField) (*FormField, error) {
}

func (c *Client) GetFormField(id string) (*FormField, error) {
req, err := rootlygo.NewGetFormFieldRequest(c.Rootly.Server, id)
req, err := rootlygo.NewGetFormFieldRequest(c.Rootly.Server, id, nil)
if err != nil {
return nil, errors.Errorf("Error building request: %s", err.Error())
}
Expand Down
6 changes: 6 additions & 0 deletions client/functionalities.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ type Functionality struct {
PublicDescription string `jsonapi:"attr,public_description,omitempty"`
NotifyEmails []interface{} `jsonapi:"attr,notify_emails,omitempty"`
Color string `jsonapi:"attr,color,omitempty"`
BackstageId string `jsonapi:"attr,backstage_id,omitempty"`
PagerdutyId string `jsonapi:"attr,pagerduty_id,omitempty"`
OpsgenieId string `jsonapi:"attr,opsgenie_id,omitempty"`
OpsgenieTeamId string `jsonapi:"attr,opsgenie_team_id,omitempty"`
CortexId string `jsonapi:"attr,cortex_id,omitempty"`
ServiceNowCiSysId string `jsonapi:"attr,service_now_ci_sys_id,omitempty"`
Position int `jsonapi:"attr,position,omitempty"`
EnvironmentIds []interface{} `jsonapi:"attr,environment_ids,omitempty"`
ServiceIds []interface{} `jsonapi:"attr,service_ids,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion client/incident_sub_statuses.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ func (c *Client) CreateIncidentSubStatus(d *IncidentSubStatus) (*IncidentSubStat
}

func (c *Client) GetIncidentSubStatus(id string) (*IncidentSubStatus, error) {
req, err := rootlygo.NewGetIncidentSubStatusRequest(c.Rootly.Server, id)
req, err := rootlygo.NewGetIncidentSubStatusRequest(c.Rootly.Server, id, nil)
if err != nil {
return nil, errors.Errorf("Error building request: %s", err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion client/playbooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (c *Client) CreatePlaybook(d *Playbook) (*Playbook, error) {
}

func (c *Client) GetPlaybook(id string) (*Playbook, error) {
req, err := rootlygo.NewGetPlaybookRequest(c.Rootly.Server, id)
req, err := rootlygo.NewGetPlaybookRequest(c.Rootly.Server, id, nil)
if err != nil {
return nil, errors.Errorf("Error building request: %s", err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion client/retrospective_configurations.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (c *Client) ListRetrospectiveConfigurations(params *rootlygo.ListRetrospect
}

func (c *Client) GetRetrospectiveConfiguration(id string) (*RetrospectiveConfiguration, error) {
req, err := rootlygo.NewGetRetrospectiveConfigurationRequest(c.Rootly.Server, id)
req, err := rootlygo.NewGetRetrospectiveConfigurationRequest(c.Rootly.Server, id, nil)
if err != nil {
return nil, errors.Errorf("Error building request: %s", err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion client/retrospective_process_groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ func (c *Client) CreateRetrospectiveProcessGroup(d *RetrospectiveProcessGroup) (
}

func (c *Client) GetRetrospectiveProcessGroup(id string) (*RetrospectiveProcessGroup, error) {
req, err := rootlygo.NewGetRetrospectiveProcessGroupRequest(c.Rootly.Server, id)
req, err := rootlygo.NewGetRetrospectiveProcessGroupRequest(c.Rootly.Server, id, nil)
if err != nil {
return nil, errors.Errorf("Error building request: %s", err.Error())
}
Expand Down
2 changes: 1 addition & 1 deletion client/retrospective_processes.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func (c *Client) CreateRetrospectiveProcess(d *RetrospectiveProcess) (*Retrospec
}

func (c *Client) GetRetrospectiveProcess(id string) (*RetrospectiveProcess, error) {
req, err := rootlygo.NewGetRetrospectiveProcessRequest(c.Rootly.Server, id)
req, err := rootlygo.NewGetRetrospectiveProcessRequest(c.Rootly.Server, id, nil)
if err != nil {
return nil, errors.Errorf("Error building request: %s", err.Error())
}
Expand Down
2 changes: 2 additions & 0 deletions client/schedules.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ type Schedule struct {
ID string `jsonapi:"primary,schedules"`
Name string `jsonapi:"attr,name,omitempty"`
Description string `jsonapi:"attr,description,omitempty"`
AllTimeCoverage *bool `jsonapi:"attr,all_time_coverage,omitempty"`
SlackUserGroup string `jsonapi:"attr,slack_user_group,omitempty"`
}

func (c *Client) ListSchedules(params *rootlygo.ListSchedulesParams) ([]interface{}, error) {
Expand Down
2 changes: 1 addition & 1 deletion client/workflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (c *Client) CreateWorkflow(d *Workflow) (*Workflow, error) {
}

func (c *Client) GetWorkflow(id string) (*Workflow, error) {
req, err := rootlygo.NewGetWorkflowRequest(c.Rootly.Server, id)
req, err := rootlygo.NewGetWorkflowRequest(c.Rootly.Server, id, nil)
if err != nil {
return nil, errors.Errorf("Error building request: %s", err.Error())
}
Expand Down
1 change: 1 addition & 0 deletions docs/data-sources/functionality.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ data "rootly_functionality" "my-functionality" {

### Optional

- `backstage_id` (String)
- `created_at` (Map of String) Filter by date range using 'lt' and 'gt'.
- `name` (String)
- `slug` (String)
Expand Down
6 changes: 6 additions & 0 deletions docs/resources/functionality.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,21 @@ resource "rootly_functionality" "logging_in" {

### Optional

- `backstage_id` (String) The Backstage entity id associated to this functionality. eg: :namespace/:kind/:entity_name
- `color` (String) The hex color of the functionality
- `cortex_id` (String) The Cortex group id associated to this functionality
- `description` (String) The description of the functionality
- `environment_ids` (List of String) Environments associated with this functionality
- `notify_emails` (List of String) Emails attached to the functionality
- `opsgenie_id` (String) The Opsgenie service id associated to this functionality
- `opsgenie_team_id` (String) The Opsgenie team id associated to this functionality
- `owners_group_ids` (List of String) Owner Teams associated with this functionality
- `owners_user_ids` (List of Number) Owner Users associated with this functionality
- `pagerduty_id` (String) The PagerDuty service id associated to this functionality
- `position` (Number) Position of the functionality
- `public_description` (String) The public description of the functionality
- `service_ids` (List of String) Services associated with this functionality
- `service_now_ci_sys_id` (String) The Service Now CI sys id associated to this functionality
- `slack_aliases` (Block List) Slack Aliases associated with this functionality (see [below for nested schema](#nestedblock--slack_aliases))
- `slack_channels` (Block List) Slack Channels associated with this functionality (see [below for nested schema](#nestedblock--slack_channels))
- `slug` (String) The slug of the functionality
Expand Down
2 changes: 2 additions & 0 deletions docs/resources/schedule.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ description: |-

### Optional

- `all_time_coverage` (Boolean) 24/7 coverage of the schedule. Value must be one of true or false
- `description` (String) The description of the schedule
- `slack_user_group` (String) Synced slack group of the schedule

### Read-Only

Expand Down
42 changes: 42 additions & 0 deletions docs/resources/workflow_task_send_microsoft_teams_blocks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
---
page_title: "Resource rootly_workflow_task_send_microsoft_teams_blocks - terraform-provider-rootly"
subcategory: Workflow Tasks
description: |-
Manages workflow send_microsoft_teams_blocks task.
---

# Resource (rootly_workflow_task_send_microsoft_teams_blocks)

Manages workflow send_microsoft_teams_blocks task.



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `task_params` (Block List, Min: 1, Max: 1) The parameters for this workflow task. (see [below for nested schema](#nestedblock--task_params))
- `workflow_id` (String) The ID of the parent workflow

### Optional

- `enabled` (Boolean) Enable/disable this workflow task
- `name` (String) Name of the workflow task
- `position` (Number) The position of the workflow task (1 being top of list)
- `skip_on_failure` (Boolean) Skip workflow task if any failures

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--task_params"></a>
### Nested Schema for `task_params`

Required:

- `attachments` (String) Support liquid markup. Needs to be a valid JSON string after liquid is parsed

Optional:

- `task_type` (String)
51 changes: 51 additions & 0 deletions docs/resources/workflow_task_send_microsoft_teams_message.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
page_title: "Resource rootly_workflow_task_send_microsoft_teams_message - terraform-provider-rootly"
subcategory: Workflow Tasks
description: |-
Manages workflow send_microsoft_teams_message task.
---

# Resource (rootly_workflow_task_send_microsoft_teams_message)

Manages workflow send_microsoft_teams_message task.



<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `task_params` (Block List, Min: 1, Max: 1) The parameters for this workflow task. (see [below for nested schema](#nestedblock--task_params))
- `workflow_id` (String) The ID of the parent workflow

### Optional

- `enabled` (Boolean) Enable/disable this workflow task
- `name` (String) Name of the workflow task
- `position` (Number) The position of the workflow task (1 being top of list)
- `skip_on_failure` (Boolean) Skip workflow task if any failures

### Read-Only

- `id` (String) The ID of this resource.

<a id="nestedblock--task_params"></a>
### Nested Schema for `task_params`

Required:

- `text` (String) The message text

Optional:

- `channels` (Block List) (see [below for nested schema](#nestedblock--task_params--channels))
- `task_type` (String)

<a id="nestedblock--task_params--channels"></a>
### Nested Schema for `task_params.channels`

Required:

- `id` (String)
- `name` (String)
11 changes: 11 additions & 0 deletions provider/data_source_functionality.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ func dataSourceFunctionality() *schema.Resource {
Optional: true,
},

"backstage_id": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Optional: true,
},

"created_at": &schema.Schema{
Type: schema.TypeMap,
Description: "Filter by date range using 'lt' and 'gt'.",
Expand All @@ -53,6 +59,11 @@ func dataSourceFunctionalityRead(ctx context.Context, d *schema.ResourceData, me
params.FilterName = &name
}

if value, ok := d.GetOkExists("backstage_id"); ok {
backstage_id := value.(string)
params.FilterBackstageId = &backstage_id
}

if value, ok := d.GetOkExists("slug"); ok {
slug := value.(string)
params.FilterSlug = &slug
Expand Down
2 changes: 2 additions & 0 deletions provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ func New(version string) func() *schema.Provider {
"rootly_workflow_task_rename_microsoft_teams_channel": resourceWorkflowTaskRenameMicrosoftTeamsChannel(),
"rootly_workflow_task_invite_to_microsoft_teams_channel": resourceWorkflowTaskInviteToMicrosoftTeamsChannel(),
"rootly_workflow_task_create_notion_page": resourceWorkflowTaskCreateNotionPage(),
"rootly_workflow_task_send_microsoft_teams_message": resourceWorkflowTaskSendMicrosoftTeamsMessage(),
"rootly_workflow_task_send_microsoft_teams_blocks": resourceWorkflowTaskSendMicrosoftTeamsBlocks(),
"rootly_workflow_task_update_notion_page": resourceWorkflowTaskUpdateNotionPage(),
"rootly_workflow_task_create_service_now_incident": resourceWorkflowTaskCreateServiceNowIncident(),
"rootly_workflow_task_create_shortcut_story": resourceWorkflowTaskCreateShortcutStory(),
Expand Down
Loading

0 comments on commit 4acb7a2

Please sign in to comment.