Table: oci_autoscaling_auto_scaling_policy - Query OCI Autoscaling Auto Scaling Policies using SQL
An OCI Autoscaling Auto Scaling Policy is a feature of Oracle Cloud Infrastructure that automatically adjusts the number of instances in an instance pool based on performance metrics. It allows you to maintain the performance of your applications and manage costs by adjusting the number of instances in response to changes in workload patterns. OCI Autoscaling Auto Scaling Policy helps you ensure that you have the appropriate number of Oracle Cloud Infrastructure Compute instances available to handle the load for your application.
Table Usage Guide
The oci_autoscaling_auto_scaling_policy
table provides insights into auto scaling policies within Oracle Cloud Infrastructure Autoscaling. As a Cloud Administrator, explore policy-specific details through this table, including the capacity, policy type, and associated metadata. Utilize it to uncover information about policies, such as their current status, the adjustments made in response to workload changes, and the verification of policy configurations.
Examples
Basic info
Assess the elements within your autoscaling policies to understand their current status. This can help in identifying if they are enabled and their capacity, which is useful for managing resource allocation and scaling operations.
select capacity, id, display_name, is_enabled, policy_typefrom oci_autoscaling_auto_scaling_policy;
select capacity, id, display_name, is_enabled, policy_typefrom oci_autoscaling_auto_scaling_policy;
List enabled policies
Explore which autoscaling policies are currently active. This can be useful for assessing system performance and identifying areas for optimization.
select display_name, id, policy_type, time_created, is_enabledfrom oci_autoscaling_auto_scaling_policywhere is_enabled;
select display_name, id, policy_type, time_created, is_enabledfrom oci_autoscaling_auto_scaling_policywhere is_enabled;
List threshold policies
Explore which auto-scaling policies in your OCI environment are of the 'threshold' type. This can help you manage and optimize your resource allocation, by understanding which policies are actively scaling resources based on defined thresholds.
select display_name, id, policy_type, time_created, is_enabledfrom oci_autoscaling_auto_scaling_policywhere policy_type = 'threshold';
select display_name, id, policy_type, time_created, is_enabledfrom oci_autoscaling_auto_scaling_policywhere policy_type = 'threshold';
List policies older than 30 days
Explore which autoscaling policies have been active for more than 30 days. This can help in assessing the efficiency and relevance of these policies in the current context.
select display_name, id, policy_type, time_created, is_enabledfrom oci_autoscaling_auto_scaling_policywhere time_created <= now() - interval '30' day;
select display_name, id, policy_type, time_created, is_enabledfrom oci_autoscaling_auto_scaling_policywhere time_created <= datetime('now', '-30 day');
Get capacity details of each policy
Explore the capacity details of each policy to understand the initial, maximum, and minimum capacity settings. This information can be useful for managing and optimizing the performance of your auto-scaling policies.
select display_name, id, capacity ->> 'initial' as initial_capacity, capacity ->> 'max' as maximum_capacity, capacity ->> 'min' as minimum_capacityfrom oci_autoscaling_auto_scaling_policy;
select display_name, id, json_extract(capacity, '$.initial') as initial_capacity, json_extract(capacity, '$.max') as maximum_capacity, json_extract(capacity, '$.min') as minimum_capacityfrom oci_autoscaling_auto_scaling_policy;
Get autoscaling configuration details of each policy
Discover the autoscaling configuration details of each policy to better understand your resource management and to assess if your current settings are optimized for your needs. This will help in managing resources efficiently and effectively, ensuring optimal performance.
select p.display_name, p.id, p.auto_scaling_configuration_id, c.cool_down_in_seconds, c.max_resource_count, c.min_resource_countfrom oci_autoscaling_auto_scaling_policy as p, oci_autoscaling_auto_scaling_configuration as cwhere p.auto_scaling_configuration_id = c.id;
select p.display_name, p.id, p.auto_scaling_configuration_id, c.cool_down_in_seconds, c.max_resource_count, c.min_resource_countfrom oci_autoscaling_auto_scaling_policy as p, oci_autoscaling_auto_scaling_configuration as cwhere p.auto_scaling_configuration_id = c.id;
Schema for oci_autoscaling_auto_scaling_policy
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
auto_scaling_configuration_id | text | = | The OCID of the autoscaling configuration. |
capacity | jsonb | The capacity requirements of the autoscaling policy. | |
compartment_id | text | The OCID of the compartment in Tenant in which the resource is located. | |
display_name | text | = | A user-friendly name. Does not have to be unique, and it's changeable. |
id | text | = | The ID of the autoscaling policy that is assigned after creation. |
is_enabled | boolean | Whether the autoscaling policy is enabled. | |
policy_type | text | The type of autoscaling policy. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
tenant_id | text | =, !=, ~~, ~~*, !~~, !~~* | The OCID of the Tenant in which the resource is located. |
time_created | timestamp with time zone | Time that autoscaling policy was created. | |
title | text | Title of the resource. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- oci
You can pass the configuration to the command with the --config
argument:
steampipe_export_oci --config '<your_config>' oci_autoscaling_auto_scaling_policy