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

Fix list call for table gcp_compute_resource_policy closes #348 #352

Merged
merged 2 commits into from
Mar 25, 2022

Conversation

ParthaI
Copy link
Contributor

@ParthaI ParthaI commented Mar 23, 2022

Integration test logs

Logs
No env file present for the current environment:  staging 
 Falling back to .env config
No env file present for the current environment:  staging
customEnv TURBOT_TEST_EXPECTED_TIMEOUT undefined

SETUP: tests/gcp_compute_resource_policy []

PRETEST: tests/gcp_compute_resource_policy

TEST: tests/gcp_compute_resource_policy
Running terraform
data.google_client_config.current: Refreshing state...
data.null_data_source.resource: Refreshing state...
google_compute_resource_policy.named_test_resource: Creating...
google_compute_resource_policy.named_test_resource: Creation complete after 3s [id=projects/parker-aaa/regions/us-east1/resourcePolicies/turbottest86857]

Warning: Deprecated Resource

  on variables.tf line 33, in data "null_data_source" "resource":
  33: data "null_data_source" "resource" {

The null_data_source was historically used to construct intermediate values to
re-use elsewhere in configuration, the same can now be achieved using locals


Apply complete! Resources: 1 added, 0 changed, 0 destroyed.

Outputs:

project_id = parker-aaa
resource_aka = gcp://compute.googleapis.com/projects/parker-aaa/regions/us-east1/resourcePolicies/turbottest86857
resource_name = turbottest86857
self_link = https://www.googleapis.com/compute/v1/projects/parker-aaa/regions/us-east1/resourcePolicies/turbottest86857

Running SQL query: test-get-query.sql
[
  {
    "description": "Start and stop instances",
    "instance_schedule_policy": {
      "timeZone": "US/Central",
      "vmStartSchedule": {
        "schedule": "0 * * * *"
      },
      "vmStopSchedule": {
        "schedule": "15 * * * *"
      }
    },
    "kind": "compute#resourcePolicy",
    "name": "turbottest86857",
    "self_link": "https://www.googleapis.com/compute/v1/projects/parker-aaa/regions/us-east1/resourcePolicies/turbottest86857",
    "status": "READY"
  }
]
✔ PASSED

Running SQL query: test-invalid-name-query.sql
null
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "description": "Start and stop instances",
    "name": "turbottest86857"
  }
]
✔ PASSED

Running SQL query: test-not-found-query.sql
null
✔ PASSED

Running SQL query: test-turbot-query.sql
[
  {
    "akas": [
      "gcp://compute.googleapis.com/projects/parker-aaa/regions/us-east1/resourcePolicies/turbottest86857"
    ],
    "title": "turbottest86857"
  }
]
✔ PASSED

POSTTEST: tests/gcp_compute_resource_policy

TEARDOWN: tests/gcp_compute_resource_policy

SUMMARY:

1/1 passed.

Example query results

Results
> select name, status, location from gcp_compute_resource_policy;
+--------------------+--------+-------------+
| name               | status | location    |
+--------------------+--------+-------------+
| turbottest96258    | READY  | us-east1    |
| default-schedule-1 | READY  | us-central1 |
| schedule-1         | READY  | us-east1    |
+--------------------+--------+-------------+
> select name, status, location from gcp_compute_resource_policy where status = 'READY'
+--------------------+--------+-------------+
| name               | status | location    |
+--------------------+--------+-------------+
| turbottest96258    | READY  | us-east1    |
| schedule-1         | READY  | us-east1    |
| default-schedule-1 | READY  | us-central1 |
+--------------------+--------+-------------+

@ParthaI ParthaI self-assigned this Mar 23, 2022
@ParthaI ParthaI linked an issue Mar 23, 2022 that may be closed by this pull request
@bigdatasourav
Copy link
Contributor

@ParthaI Add one more example query with filter

Copy link
Contributor

@bigdatasourav bigdatasourav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@bigdatasourav bigdatasourav merged commit b0af5e0 into main Mar 25, 2022
@bigdatasourav bigdatasourav deleted the issue-348 branch March 25, 2022 05:50
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.

Fix list call for table gcp_compute_resource_policy
2 participants