sbecker59 / terraform-provider-statuspage

Terraform Statuspage provider
https://registry.terraform.io/providers/sbecker59/statuspage/
Mozilla Public License 2.0
8 stars 5 forks source link

Adding page access group and page access user #66

Closed grierj closed 3 years ago

grierj commented 3 years ago

We need these for audience manipulation. Trying to follow the standard patterns established here. Updated to the latest client version to pick up all the page access user endpoints and api fixes

Full acceptance tests appear to be working

$ go test -v -run TestAccStatuspagePageAccessUser_Basic ./statuspage
=== RUN   TestAccStatuspagePageAccessUser_Basic
2021/09/15 10:26:41 [DEBUG] POST https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:26:43 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:26:49 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:26:55 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:27:00 [DEBUG] DELETE https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users/464plwpsc06c
2021/09/15 10:27:00 [DEBUG] POST https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:27:00 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:27:05 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:27:20 [DEBUG] DELETE https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users/vk7dqyyrvm74
2021/09/15 10:27:20 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users/vk7dqyyrvm74
--- PASS: TestAccStatuspagePageAccessUser_Basic (49.15s)
PASS
ok      github.com/sbecker59/terraform-provider-statuspage/statuspage   50.163s

$ go test -v -run TestAccStatuspagePageAccessGroup_Basic ./statuspage
=== RUN   TestAccStatuspagePageAccessGroup_Basic
2021/09/15 10:45:13 [DEBUG] POST https://api.statuspage.io/v1/pages/3szhmzxmsgd4/components
2021/09/15 10:45:13 [DEBUG] POST https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:45:15 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:45:20 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/components/sbdh4734hzvm
2021/09/15 10:45:20 [DEBUG] POST https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_groups
2021/09/15 10:45:20 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_groups/sqzknzr8ysk0
2021/09/15 10:45:26 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:45:26 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/components/sbdh4734hzvm
2021/09/15 10:45:26 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_groups/sqzknzr8ysk0
2021/09/15 10:45:34 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:45:34 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/components/sbdh4734hzvm
2021/09/15 10:45:34 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_groups/sqzknzr8ysk0
2021/09/15 10:45:38 [DEBUG] POST https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:45:38 [DEBUG] POST https://api.statuspage.io/v1/pages/3szhmzxmsgd4/components
2021/09/15 10:45:39 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:45:42 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/components/g8vbb5rlym1v
2021/09/15 10:45:42 [DEBUG] PATCH https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_groups/sqzknzr8ysk0
2021/09/15 10:45:42 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_groups/sqzknzr8ysk0
2021/09/15 10:45:48 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:45:48 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users
2021/09/15 10:45:48 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/components/g8vbb5rlym1v
2021/09/15 10:45:48 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/components/sbdh4734hzvm
2021/09/15 10:45:49 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_groups/sqzknzr8ysk0
2021/09/15 10:45:56 [DEBUG] DELETE https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_groups/sqzknzr8ysk0
2021/09/15 10:45:56 [DEBUG] DELETE https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users/4yk5kdxm491d
2021/09/15 10:45:56 [DEBUG] DELETE https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_users/m9t0f543n1h5
2021/09/15 10:45:56 [DEBUG] DELETE https://api.statuspage.io/v1/pages/3szhmzxmsgd4/components/g8vbb5rlym1v
2021/09/15 10:45:56 [DEBUG] DELETE https://api.statuspage.io/v1/pages/3szhmzxmsgd4/components/sbdh4734hzvm
2021/09/15 10:45:57 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_groups/4yk5kdxm491d
2021/09/15 10:45:58 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_groups/m9t0f543n1h5
2021/09/15 10:45:58 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_groups/sbdh4734hzvm
2021/09/15 10:45:58 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_groups/g8vbb5rlym1v
2021/09/15 10:45:58 [DEBUG] GET https://api.statuspage.io/v1/pages/3szhmzxmsgd4/page_access_groups/sqzknzr8ysk0
--- PASS: TestAccStatuspagePageAccessGroup_Basic (56.00s)
PASS
ok      github.com/sbecker59/terraform-provider-statuspage/statuspage   57.259s

I occasionally got 404 on deletes for users, but running it again deletes them successfully. I think there's some sort of lag inbetween systems on big deletes.

Sorry about the whitespace changes, my IDE decided to go fmt them I think.

grierj commented 3 years ago

Can you create two examples in examples/resources for the resources you added please?

Absolutely. I'll do that today. Sorry I missed that part.

grierj commented 3 years ago

@sbecker59 ok, examples added and docs generated. Thanks for being so responsive!

sbecker59 commented 3 years ago

Hi @grierj , I made a mistake while merging. Which means that you will not appear as a contributor to the project 😕 . Could you please merge your 3 commits into 1, then redo a pull request. Sorry for the inconvenience 😕

grierj commented 3 years ago

Hi @grierj , I made a mistake while merging. Which means that you will not appear as a contributor to the project 😕 . Could you please merge your 3 commits into 1, then redo a pull request. Sorry for the inconvenience 😕

No problem! I'll squash those commits and recreate the pull request.

grierj commented 3 years ago

created https://github.com/sbecker59/terraform-provider-statuspage/pull/68 to replace this one.