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

Add table gcp_compute_autoscaler Closes #404 #412

Merged
merged 11 commits into from
Dec 2, 2022

Conversation

karanpopat
Copy link
Contributor

Integration test logs

Logs
Outputs:

project_id = "parker-aaa"
resource_aka = "gcp://compute.googleapis.com/projects/parker-aaa/zones/us-central1-f/autoscalers/turbottest34158"
resource_id = "projects/parker-aaa/zones/us-central1-f/autoscalers/turbottest34158"
resource_name = "turbottest34158"
self_link = "https://www.googleapis.com/compute/v1/projects/parker-aaa/zones/us-central1-f/autoscalers/turbottest34158"

Running SQL query: test-get-query.sql
[
  {
    "description": "turbottest34158",
    "kind": "compute#autoscaler",
    "location": "us-central1-f",
    "name": "turbottest34158",
    "project": "parker-aaa",
    "recommended_size": 0,
    "self_link": "https://www.googleapis.com/compute/v1/projects/parker-aaa/zones/us-central1-f/autoscalers/turbottest34158",
    "status": "ACTIVE"
  }
]
✔ PASSED

Running SQL query: test-list-query.sql
[
  {
    "description": "turbottest34158",
    "kind": "compute#autoscaler",
    "location": "us-central1-f",
    "name": "turbottest34158",
    "project": "parker-aaa",
    "recommended_size": 0,
    "self_link": "https://www.googleapis.com/compute/v1/projects/parker-aaa/zones/us-central1-f/autoscalers/turbottest34158",
    "status": "ACTIVE"
  }
]
✔ 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/zones/us-central1-f/autoscalers/turbottest34158"
    ],
    "title": "turbottest34158"
  }
]
✔ PASSED

POSTTEST: tests/gcp_compute_autoscaler

TEARDOWN: tests/gcp_compute_autoscaler

SUMMARY:

1/1 passed.

Example query results

Results
> select 
  name,
  description,
  self_link, 
  status,
  location, 
  akas,
  recommended_size
from 
  gcp_compute_autoscaler;
[
 {
  "akas": [
   "gcp://compute.googleapis.com/projects/parker-aaa/zones/us-central1-c/autoscalers/gke-cluster-1-default-pool-66ead33a-grp"
  ],
  "description": "",
  "location": "us-central1-c",
  "name": "gke-cluster-1-default-pool-66ead33a-grp",
  "recommended_size": 1,
  "self_link": "https://www.googleapis.com/compute/v1/projects/parker-aaa/zones/us-central1-c/autoscalers/gke-cluster-1-default-pool-66ead33a-grp",
  "status": "ACTIVE"
 }
]
> 
> select
  title,
  autoscaling_policy ->> 'mode' as mode,
  autoscaling_policy -> 'cpuUtilization' ->> 'predictiveMethod' as cpu_utilization_method,
  autoscaling_policy -> 'cpuUtilization' ->> 'utilizationTarget' as cpu_utilization_target,
  autoscaling_policy ->> 'maxNumReplicas' as max_replicas,
  autoscaling_policy ->> 'minNumReplicas' as min_replicas,
  autoscaling_policy ->> 'coolDownPeriodSec' as cool_down_period_sec
from
  gcp_compute_autoscaler;
[
 {
  "cool_down_period_sec": "60",
  "cpu_utilization_method": "NONE",
  "cpu_utilization_target": "0.6",
  "max_replicas": "1",
  "min_replicas": null,
  "mode": "ON",
  "title": "gke-cluster-1-default-pool-66ead33a-grp"
 }
]

@karanpopat karanpopat requested a review from misraved November 16, 2022 11:06
@karanpopat karanpopat self-assigned this Nov 16, 2022
@karanpopat karanpopat linked an issue Nov 16, 2022 that may be closed by this pull request
Copy link
Contributor

@misraved misraved left a comment

Choose a reason for hiding this comment

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

Please take a look at the review comments!! thanks

Hydrate: getComputeAutoscaler,
},
List: &plugin.ListConfig{
Hydrate: listComputeAutoscaler,
Copy link
Contributor

Choose a reason for hiding this comment

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

Please fix the indentation

Copy link
Contributor

@ParthaI ParthaI left a comment

Choose a reason for hiding this comment

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

LGTM

@misraved misraved merged commit 6424054 into main Dec 2, 2022
@misraved misraved deleted the 404-add-table-gcp_compute_autoscaler branch December 2, 2022 09:37
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.

Add table gcp_compute_autoscaler
3 participants