Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PowerScale User Datasource #5

Merged
merged 1 commit into from
Jul 29, 2023
Merged

PowerScale User Datasource #5

merged 1 commit into from
Jul 29, 2023

Conversation

taohe1012
Copy link
Collaborator

Description

Read User Datasource using an OpenAPI Client

ISSUE TYPE

  • Feature Pull Request
RESOURCE OR DATASOURCE NAME

User Datasource

OUTPUT
go test -count=1 -v

=== RUN   TestAccUserDataSourceFilter
    ~\terraform-provider-powerscale\powerscale\provider\provider_test.go:89:
                provider "powerscale" {
                    username      = "user"
                    password      = "pass"
                    endpoint      = "https://XXXX:8080"
                    insecure      = true
                    group        = "/ifs/data/xxx"
                    volume_path = "/ifs/terraform"
                    volume_path_permissions = "0777"
                    ignore_unresolvable_hosts = "false"
                    auth_type = "0"
                    verbose_logging = "0"
                }

config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc00060a210} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc000526030} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Ser
vers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc0005d76e0} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc00078aff0} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc00072a180} header map[Accept:application/json; charset
=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc00023f320} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]--- PASS: TestAccUserDataSourceFilter (26.36s)
=== RUN   TestAccUserDataSourceNames
    ~\terraform-provider-powerscale\powerscale\provider\provider_test.go:89:
                provider "powerscale" {
                    username      = "user"
                    password      = "pass"
                    endpoint      = "https://XXXX:8080"
                    insecure      = true
                    group        = "/ifs/data/xxx"
                    volume_path = "/ifs/terraform"
                    volume_path_permissions = "0777"
                    ignore_unresolvable_hosts = "false"
                    auth_type = "0"
                    verbose_logging = "0"
                }

config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc0002b8660} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc00072b350} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Ser
vers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc000526c00} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc0002b89f0} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc0002b92f0} header map[Accept:application/json; charset
=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc00054a150} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]--- PASS: TestAccUserDataSourceNames (26.25s)
=== RUN   TestAccUserDataSourceFilterNames
    ~\terraform-provider-powerscale\powerscale\provider\provider_test.go:89:
                provider "powerscale" {
                    username      = "user"
                    password      = "pass"
                    endpoint      = "https://XXXX:8080"
                    insecure      = true
                    group        = "/ifs/data/xxx"
                    volume_path = "/ifs/terraform"
                    volume_path_permissions = "0777"
                    ignore_unresolvable_hosts = "false"
                    auth_type = "0"
                    verbose_logging = "0"
                }

config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc000015140} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc0003dcc90} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Ser
vers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc00023f740} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc0006405a0} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc0001cc720} header map[Accept:application/json; charset
=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc000640030} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]--- PASS: TestAccUserDataSourceFilterNames (16.16s)
=== RUN   TestAccUserDataSourceInvalidFilter
    ~\terraform-provider-powerscale\powerscale\provider\provider_test.go:89:
                provider "powerscale" {
                    username      = "user"
                    password      = "pass"
                    endpoint      = "https://XXXX:8080"
                    insecure      = true
                    group        = "/ifs/data/xxx"
                    volume_path = "/ifs/terraform"
                    volume_path_permissions = "0777"
                    ignore_unresolvable_hosts = "false"
                    auth_type = "0"
                    verbose_logging = "0"
                }

config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc0003369f0} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]--- PASS: TestAccUserDataSourceInvalidFilter (3.03s)
=== RUN   TestAccUserDataSourceInvalidNames
    ~\terraform-provider-powerscale\powerscale\provider\provider_test.go:89:
                provider "powerscale" {
                    username      = "user"
                    password      = "pass"
                    endpoint      = "https://XXXX:8080"
                    insecure      = true
                    group        = "/ifs/data/xxx"
                    volume_path = "/ifs/terraform"
                    volume_path_permissions = "0777"
                    ignore_unresolvable_hosts = "false"
                    auth_type = "0"
                    verbose_logging = "0"
                }

config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc00058dda0} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]--- PASS: TestAccUserDataSourceInvalidNames (3.51s)
=== RUN   TestAccUserDataSourceAll
    ~\terraform-provider-powerscale\powerscale\provider\provider_test.go:89:
                provider "powerscale" {
                    username      = "user"
                    password      = "pass"
                    endpoint      = "https://XXXX:8080"
                    insecure      = true
                    group        = "/ifs/data/xxx"
                    volume_path = "/ifs/terraform"
                    volume_path_permissions = "0777"
                    ignore_unresolvable_hosts = "false"
                    auth_type = "0"
                    verbose_logging = "0"
                }

config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc00058c990} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc0002b9aa0} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Ser
vers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc000558360} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc0001cc360} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc000336f30} header map[Accept:application/json; charset
=utf-8 Content-Type:application/json; charset=utf-8]config {Host: Scheme: DefaultHeader:map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8] UserAgent:terraform-powermax-provider/1.0.0 Debug:false Servers:[{URL:https://10.225.108.6:8080 Description:https://10.225.108.6:8080 Variables:map[]}] OperationServers:map[] HTTPClient:0xc0005593e0} header map[Accept:application/json; charset=utf-8 Content-Type:application/json; charset=utf-8]--- PASS: TestAccUserDataSourceAll (26.61s)
PASS
ok      terraform-provider-powerscale/powerscale/provider   103.637s

Checklist:

  • I have performed a self-review of my own code to ensure there are no formatting, vetting, linting, or security issues
  • I have verified that new and existing unit tests pass locally with my changes
  • I have not allowed coverage numbers to degenerate
  • I have maintained at least 80% code coverage
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • I have maintained backward compatibility

How Has This Been Tested?

Please describe the tests that you ran to verify your changes. Please also list any relevant details for your test configuration

  • Unit tests
  • Acceptance tests

@taohe1012
Copy link
Collaborator Author

run e2e test

@taohe1012
Copy link
Collaborator Author

run e2e test

forrestxia
forrestxia previously approved these changes Jul 27, 2023
doriac11
doriac11 previously approved these changes Jul 27, 2023
nikitajoshi1
nikitajoshi1 previously approved these changes Jul 27, 2023
@NavisJ
Copy link
Contributor

NavisJ commented Jul 27, 2023

Please rebase the main branch and solve conflicts

NavisJ
NavisJ previously approved these changes Jul 27, 2023
@taohe1012
Copy link
Collaborator Author

run e2e test

@taohe1012 taohe1012 force-pushed the feature-user-datasource branch 2 times, most recently from 5a72b83 to a3d3e0f Compare July 28, 2023 16:12
@taohe1012
Copy link
Collaborator Author

run e2e test

@taohe1012 taohe1012 merged commit ff2e01a into main Jul 29, 2023
6 checks passed
@taohe1012 taohe1012 deleted the feature-user-datasource branch July 29, 2023 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants