### Install App-AutoScaler CLI Plug-in from Source Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Installs the AutoScaler plug-in by cloning the source code and running the make install command. ```shell git clone https://github.com/cloudfoundry/app-autoscaler-cli-plugin.git cd app-autoscaler-cli-plugin make install ``` -------------------------------- ### Install App-AutoScaler CLI Plug-in from CF-Community Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Installs the AutoScaler plug-in from the CF-Community repository. ```shell cf install-plugin -r CF-Community app-autoscaler-plugin ``` -------------------------------- ### Install AutoScaler Plugin from Repository Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Use the CF-Community repository to install and verify the plugin. ```bash # Install the plugin directly from the CF-Community repository cf install-plugin -r CF-Community app-autoscaler-plugin # Verify installation cf plugins | grep AutoScaler ``` -------------------------------- ### Install AutoScaler Plugin from Source Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Clone the repository and build the plugin locally using the provided Makefile. ```bash # Clone the repository git clone https://github.com/cloudfoundry/app-autoscaler-cli-plugin.git cd app-autoscaler-cli-plugin # Build and install locally make install # Verify installation cf plugins ``` -------------------------------- ### GET /autoscaling-metrics Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Retrieves aggregated metric data for an application. ```APIDOC ## GET /autoscaling-metrics ### Description Retrieves aggregated metric data for an application. Supported metrics include memoryused, memoryutil, responsetime, throughput, cpu, and custom metrics. ### Endpoint cf autoscaling-metrics (alias: asm) [app_name] [metric_name] ### Parameters #### Path Parameters - **app_name** (string) - Required - The name of the application. - **metric_name** (string) - Required - The name of the metric to retrieve. #### Query Parameters - **--start** (string) - Optional - Start time in ISO 8601 format. - **--end** (string) - Optional - End time in ISO 8601 format. - **--asc** (flag) - Optional - Sort results in ascending order. - **--output** (string) - Optional - File path to save the metrics. ``` -------------------------------- ### GET /autoscaling-history Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Retrieves the scaling event history for an application. ```APIDOC ## GET /autoscaling-history ### Description Retrieves the scaling event history for an application, showing when and why scaling actions occurred. ### Endpoint cf autoscaling-history (alias: ash) [app_name] ### Parameters #### Path Parameters - **app_name** (string) - Required - The name of the application. #### Query Parameters - **--start** (string) - Optional - Start time in ISO 8601 format. - **--end** (string) - Optional - End time in ISO 8601 format. - **--asc** (flag) - Optional - Sort results in ascending order. ``` -------------------------------- ### GET /autoscaling-policy Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Retrieves the current scaling policy for a specified application, including instance limits and scaling rules. ```APIDOC ## GET /autoscaling-policy ### Description Retrieves the current scaling policy for an application. The policy is returned in JSON format and includes instance limits, scaling rules, and schedules. ### Method GET ### Endpoint cf autoscaling-policy [app_name] ### Parameters #### Path Parameters - **app_name** (string) - Required - The name of the application to retrieve the policy for. #### Query Parameters - **--output** (string) - Optional - Path to a file to save the policy JSON. ### Response #### Success Response (200) - **instance_min_count** (integer) - Minimum number of instances. - **instance_max_count** (integer) - Maximum number of instances. - **scaling_rules** (array) - List of defined scaling rules. #### Response Example { "instance_min_count": 1, "instance_max_count": 5, "scaling_rules": [ { "metric_type": "memoryused", "breach_duration_secs": 120, "threshold": 15, "operator": ">=", "cool_down_secs": 120, "adjustment": "+1" } ] } ``` -------------------------------- ### GET /v1/apps/{appId}/scaling_histories Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Retrieves the scaling history for a specific application. ```APIDOC ## GET /v1/apps/{appId}/scaling_histories ### Description Retrieves the scaling history for a specific application. ### Method GET ### Endpoint /v1/apps/{appId}/scaling_histories ### Parameters #### Path Parameters - **appId** (string) - Required - The unique identifier of the application. #### Query Parameters - **start-time** (integer) - Optional - Unix timestamp in nanoseconds. - **end-time** (integer) - Optional - Unix timestamp in nanoseconds. - **order** (string) - Optional - Sort order: "asc" or "desc". - **page** (integer) - Optional - Page number for pagination. ``` -------------------------------- ### GET /health Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Checks the health status of the AutoScaler service. ```APIDOC ## GET /health ### Description Checks the health status of the AutoScaler service. ### Method GET ### Endpoint /health ``` -------------------------------- ### GET /v1/apps/{appId}/aggregated_metric_histories/{metric_type} Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Retrieves aggregated metric history for a specific metric type. ```APIDOC ## GET /v1/apps/{appId}/aggregated_metric_histories/{metric_type} ### Description Retrieves aggregated metric history for a specific metric type. ### Method GET ### Endpoint /v1/apps/{appId}/aggregated_metric_histories/{metric_type} ### Parameters #### Path Parameters - **appId** (string) - Required - The unique identifier of the application. - **metric_type** (string) - Required - The type of metric to retrieve. #### Query Parameters - **start-time** (integer) - Optional - Unix timestamp in nanoseconds. - **end-time** (integer) - Optional - Unix timestamp in nanoseconds. - **order** (string) - Optional - Sort order: "asc" or "desc". - **page** (integer) - Optional - Page number for pagination. ``` -------------------------------- ### Attach Scaling Policy Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Create a JSON policy file and apply it to an application. ```bash # Create a policy file (policy.json) with dynamic scaling rules cat > policy.json << 'EOF' { "instance_min_count": 1, "instance_max_count": 10, "scaling_rules": [ { "metric_type": "memoryused", "breach_duration_secs": 120, "threshold": 100, "operator": ">=", "cool_down_secs": 120, "adjustment": "+2" }, { "metric_type": "memoryused", "breach_duration_secs": 120, "threshold": 50, "operator": "<", "cool_down_secs": 120, "adjustment": "-1" }, { "metric_type": "throughput", "breach_duration_secs": 60, "threshold": 100, "operator": ">=", "cool_down_secs": 60, "adjustment": "+1" }, { "metric_type": "responsetime", "breach_duration_secs": 120, "threshold": 500, "operator": ">", "cool_down_secs": 120, "adjustment": "+1" } ] } EOF # Attach the policy to the application cf attach-autoscaling-policy my-app policy.json # Output: # Attaching policy for app my-app... # OK ``` -------------------------------- ### Retrieve Application Scaling Policy Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Fetches and displays the scaling policy for a given application in JSON format. The policy can also be dumped to a file using the `--output` option. ```shell cf autoscaling-policy APP_NAME [--output PATH_TO_FILE] ``` ```shell $ cf autoscaling-policy APP_NAME Showing policy for app APP_NAME... { "instance_min_count": 1, "instance_max_count": 5, "scaling_rules": [ { "metric_type": "memoryused", "breach_duration_secs": 120, "threshold": 15, "operator": ">=", "cool_down_secs": 120, "adjustment": "+1" }, { "metric_type": "memoryused", "breach_duration_secs": 120, "threshold": 10, "operator": "<", "cool_down_secs": 120, "adjustment": "-1" } ] } ``` ```shell $ cf asp APP_NAME --output PATH_TO_FILE Saving policy for app APP_NAME to PATH_TO_FILE... OK ``` -------------------------------- ### Export scaling history to file Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Saves the scaling history of a specific application to a local text file. ```bash cf ash my-app --output scaling-history.txt ``` -------------------------------- ### Retrieve Scaling Policy Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Fetch the current scaling policy for an application and optionally save it to a file. ```bash # View the scaling policy for an application cf autoscaling-policy my-app # Output: # Showing policy for app my-app... # { # "instance_min_count": 1, # "instance_max_count": 5, # "scaling_rules": [ # { # "metric_type": "memoryused", # "breach_duration_secs": 120, # "threshold": 15, # "operator": ">=", # "cool_down_secs": 120, # "adjustment": "+1" # }, # { # "metric_type": "memoryused", # "breach_duration_secs": 120, # "threshold": 10, # "operator": "<", # "cool_down_secs": 120, # "adjustment": "-1" # } # ] # } # Save the policy to a file cf asp my-app --output policy.json # Output: # Saving policy for app my-app to policy.json... # OK ``` -------------------------------- ### Create a Scheduled Scaling Policy Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Define a JSON file to configure scheduled scaling rules for an application. This includes setting minimum and maximum instance counts, breach durations, thresholds, and cool-down periods for scaling rules, as well as defining recurring schedules and specific date-time schedules. ```json { "instance_min_count": 2, "instance_max_count": 20, "scaling_rules": [ { "metric_type": "cpu", "breach_duration_secs": 60, "threshold": 80, "operator": ">=", "cool_down_secs": 120, "adjustment": "+2" } ], "schedules": { "timezone": "America/New_York", "recurring_schedule": [ { "start_time": "09:00", "end_time": "18:00", "days_of_week": [1, 2, 3, 4, 5], "instance_min_count": 5, "instance_max_count": 20, "initial_min_instance_count": 5 } ], "specific_date": [ { "start_date_time": "2024-12-25T00:00", "end_date_time": "2024-12-26T00:00", "instance_min_count": 10, "instance_max_count": 30, "initial_min_instance_count": 10 } ] } } ``` -------------------------------- ### POST /attach-autoscaling-policy Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Attaches a scaling policy to an application using a JSON configuration file. ```APIDOC ## POST /attach-autoscaling-policy ### Description Attaches a scaling policy to an application. The policy is defined in a JSON file. ### Endpoint cf attach-autoscaling-policy (alias: aasp) [app_name] [policy_file] ### Parameters #### Path Parameters - **app_name** (string) - Required - The name of the application. - **policy_file** (string) - Required - Path to the JSON file containing the scaling policy. ### Request Example cf aasp my-app scheduled-policy.json ``` -------------------------------- ### Retrieve Application Metrics Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Fetches aggregated metrics for an application. Allows specifying time ranges, display order (ascending/descending), and output to a file. ```shell cf autoscaling-metrics APP_NAME METRIC_NAME [--start START_TIME] [--end END_TIME] [--asc] [--output PATH_TO_FILE] ``` -------------------------------- ### Attach Scaling Policy to Application Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Attaches a specified JSON policy file to an application. Ensure the policy file adheres to the defined format. ```shell cf attach-autoscaling-policy APP_NAME PATH_TO_POLICY_FILE ``` ```shell $ cf attach-autoscaling-policy APP_NAME PATH_TO_POLICY_FILE Attaching policy for app APP_NAME... OK ``` -------------------------------- ### Retrieve Application Metrics Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Use this command to fetch aggregated metrics for a specific application. You can filter by metric name, time range, and sort order. Metrics are displayed with their values and timestamps. ```bash $ cf autoscaling-metrics APP_NAME memoryused --start 2018-12-27T11:49:00+08:00 --end 2018-12-27T11:52:20+08:00 --asc Retriving aggregated metrics for app APP_NAME... Metrics Name Value Timestamp memoryused 62MB 2018-12-27T11:49:00+08:00 memoryused 62MB 2018-12-27T11:49:40+08:00 memoryused 61MB 2018-12-27T11:50:20+08:00 memoryused 62MB 2018-12-27T11:51:00+08:00 memoryused 62MB 2018-12-27T11:51:40+08:00 ``` -------------------------------- ### POST /attach-autoscaling-policy Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Attaches a new scaling policy to an application from a provided JSON file. ```APIDOC ## POST /attach-autoscaling-policy ### Description Attaches a scaling policy to an application from a JSON file. The policy defines instance count limits, dynamic scaling rules based on metrics, and optional time-based schedules. ### Method POST ### Endpoint cf attach-autoscaling-policy [app_name] [policy_file] ### Parameters #### Path Parameters - **app_name** (string) - Required - The name of the application. - **policy_file** (string) - Required - Path to the JSON file containing the policy definition. ### Request Example { "instance_min_count": 1, "instance_max_count": 10, "scaling_rules": [ { "metric_type": "memoryused", "breach_duration_secs": 120, "threshold": 100, "operator": ">=", "cool_down_secs": 120, "adjustment": "+2" } ] } ### Response #### Success Response (200) - **status** (string) - Confirmation message indicating the policy was attached successfully. ``` -------------------------------- ### Configure AutoScaler API Endpoint Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Manage the AutoScaler service API endpoint, including setting, viewing, and unsetting the configuration. ```bash # Set the AutoScaler API endpoint cf autoscaling-api https://autoscaler.example.com # Output: # Setting AutoScaler api endpoint to https://autoscaler.example.com # OK # Set endpoint and skip SSL validation (not recommended for production) cf autoscaling-api https://autoscaler.example.com --skip-ssl-validation # Output: # Setting AutoScaler api endpoint to https://autoscaler.example.com # OK # View the current API endpoint cf autoscaling-api # Output: # Autoscaler api endpoint: https://autoscaler.example.com # Unset the API endpoint cf autoscaling-api --unset # Output: # Unsetting AutoScaler api endpoint. # OK # Verify endpoint is unset cf autoscaling-api # Output: # No api endpoint set. Use 'cf autoscaling-api' to set an endpoint. ``` -------------------------------- ### Attach a Scheduled Policy to an App Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Use the `cf aasp` command to attach a previously defined scaling policy (in JSON format) to a specific application. Ensure the policy JSON file is correctly formatted. ```bash cat > scheduled-policy.json << 'EOF' \ { "instance_min_count": 2, "instance_max_count": 20, "scaling_rules": [ { "metric_type": "cpu", "breach_duration_secs": 60, "threshold": 80, "operator": ">=", "cool_down_secs": 120, "adjustment": "+2" } ], "schedules": { "timezone": "America/New_York", "recurring_schedule": [ { "start_time": "09:00", "end_time": "18:00", "days_of_week": [1, 2, 3, 4, 5], "instance_min_count": 5, "instance_max_count": 20, "initial_min_instance_count": 5 } ], "specific_date": [ { "start_date_time": "2024-12-25T00:00", "end_date_time": "2024-12-26T00:00", "instance_min_count": 10, "instance_max_count": 30, "initial_min_instance_count": 10 } ] } } EOF # Attach the scheduled policy cf aasp my-app scheduled-policy.json ``` -------------------------------- ### Retrieve Application Scaling History Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md This command retrieves the scaling event history for an application. You can specify a time range and display order. The history includes scaling type, status, instance changes, and action details. ```bash cf autoscaling-history APP_NAME [--start START_TIME] [--end END_TIME] [--asc] [--output PATH_TO_FILE] ``` ```bash $ cf autoscaling-history APP_NAME --start 2018-08-16T17:58:53+08:00 --end 2018-08-16T18:01:00+08:00 --asc Showing history for app APP_NAME... Scaling Type Status Instance Changes Time Action Error dynamic failed 2->-1 2018-08-16T17:58:53+08:00 -1 instance(s) because throughput < 10rps for 120 seconds app does not have policy set dynamic succeeded 2->3 2018-08-16T17:59:33+08:00 +1 instance(s) because memoryused >= 15MB for 120 seconds scheduled succeeded 3->6 2018-08-16T18:00:00+08:00 3 instance(s) because limited by min instances 6 ``` -------------------------------- ### cf attach-autoscaling-policy Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Attaches a scaling policy to an application from a JSON file. ```APIDOC ## cf attach-autoscaling-policy ### Description Attach a scaling policy to an application. The policy file must be a valid JSON file. ### Method CLI Command ### Parameters #### Arguments - **APP_NAME** (string) - Required - The name of the application. - **PATH_TO_POLICY_FILE** (string) - Required - Path to the JSON policy file. ``` -------------------------------- ### Scaling policy configuration schema Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Defines the structure for application scaling rules, recurring schedules, and custom metric configurations. ```json { "instance_min_count": 2, "instance_max_count": 10, "scaling_rules": [ { "metric_type": "memoryused", "stat_window_secs": 60, "breach_duration_secs": 120, "threshold": 100, "operator": ">=", "cool_down_secs": 120, "adjustment": "+1" }, { "metric_type": "memoryutil", "breach_duration_secs": 120, "threshold": 80, "operator": ">=", "cool_down_secs": 120, "adjustment": "+2" }, { "metric_type": "cpu", "breach_duration_secs": 60, "threshold": 70, "operator": ">", "cool_down_secs": 60, "adjustment": "+1" }, { "metric_type": "responsetime", "breach_duration_secs": 120, "threshold": 500, "operator": ">", "cool_down_secs": 120, "adjustment": "+1" }, { "metric_type": "throughput", "breach_duration_secs": 60, "threshold": 10, "operator": "<", "cool_down_secs": 300, "adjustment": "-1" } ], "schedules": { "timezone": "America/Los_Angeles", "recurring_schedule": [ { "start_time": "08:00", "end_time": "20:00", "days_of_week": [1, 2, 3, 4, 5], "instance_min_count": 5, "instance_max_count": 15, "initial_min_instance_count": 5 }, { "start_time": "10:00", "end_time": "16:00", "days_of_week": [6, 7], "instance_min_count": 3, "instance_max_count": 8, "initial_min_instance_count": 3 } ], "specific_date": [ { "start_date_time": "2024-11-29T00:00", "end_date_time": "2024-12-02T23:59", "instance_min_count": 10, "instance_max_count": 50, "initial_min_instance_count": 20 } ] }, "configuration": { "custom_metrics": { "metric_submission_strategy": { "allow_from": "bound_app" } } } } ``` -------------------------------- ### Retrieve Aggregated Metrics for an App Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Fetch aggregated metric data for an application using `autoscaling-metrics` or its alias `asm`. Supports various metrics like `memoryused`, `cpu`, `responsetime`, `throughput`, and custom metrics. Options include specifying time ranges and sorting order. ```bash # Retrieve memory usage metrics (defaults to descending order, recent first) cf autoscaling-metrics my-app memoryused ``` ```bash # Retrieve metrics with a specific time range in ascending order cf asm my-app memoryused \ --start 2024-01-15T10:00:00+00:00 \ --end 2024-01-15T12:00:00+00:00 \ --asc ``` ```bash # Retrieve CPU metrics cf autoscaling-metrics my-app cpu ``` ```bash # Retrieve response time metrics cf autoscaling-metrics my-app responsetime ``` ```bash # Retrieve throughput metrics cf autoscaling-metrics my-app throughput ``` ```bash # Save metrics to a file cf asm my-app memoryused --output metrics.txt ``` ```bash # Retrieve custom metrics (user-defined metric names) cf autoscaling-metrics my-app custom_queue_depth ``` -------------------------------- ### Retrieve Application Metrics Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Fetches aggregated metrics for a specified application. You can filter by metric name, time range, and sort order, and output to a file. ```APIDOC ## GET /cloudfoundry/app-autoscaler-cli-plugin/metrics ### Description Retrieves aggregated metrics for a specified application. Supports filtering by metric name, time range, and sort order, with an option to output to a file. ### Method GET ### Endpoint `cf autoscaling-metrics APP_NAME METRIC_NAME` ### Parameters #### Path Parameters - **APP_NAME** (string) - Required - The name of the application. - **METRIC_NAME** (string) - Required - The name of the metric to retrieve (e.g., memoryused, memoryutil, responsetime, throughput, cpu) or a customized metric name. #### Query Parameters - **--start** (string) - Optional - The start time for metrics collection in `yyyy-MM-ddTHH:mm:ss+/-HH:mm` or `yyyy-MM-ddTHH:mm:ssZ` format. Defaults to the beginning of available data. - **--end** (string) - Optional - The end time for metrics collection in `yyyy-MM-ddTHH:mm:ss+/-HH:mm` or `yyyy-MM-ddTHH:mm:ssZ` format. Defaults to the current time. - **--asc** (boolean) - Optional - If present, displays metrics in ascending order. Defaults to descending order. - **--output** (string) - Optional - The path to a file where the metrics should be dumped. ### Request Example ```bash $ cf autoscaling-metrics APP_NAME memoryused --start 2018-12-27T11:49:00+08:00 --end 2018-12-27T11:52:20+08:00 --asc ``` ### Response #### Success Response (200) - **Metrics Name** (string) - The name of the metric. - **Value** (string) - The value of the metric with its unit. - **Timestamp** (string) - The timestamp when the metric was collected. #### Response Example ```json Retriving aggregated metrics for app APP_NAME... Metrics Name Value Timestamp memoryused 62MB 2018-12-27T11:49:00+08:00 memoryused 62MB 2018-12-27T11:49:40+08:00 memoryused 61MB 2018-12-27T11:50:20+08:00 memoryused 62MB 2018-12-27T11:51:00+08:00 memoryused 62MB 2018-12-27T11:51:40+08:00 ``` ``` -------------------------------- ### AutoScaler REST API endpoints Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Lists the available REST endpoints for interacting with the AutoScaler service. ```bash # Health check endpoint GET /health # Policy management endpoints GET /v1/apps/{appId}/policy # Retrieve scaling policy PUT /v1/apps/{appId}/policy # Create/Update scaling policy DELETE /v1/apps/{appId}/policy # Delete scaling policy # Credentials endpoint GET /v1/apps/{appId}/credential # Metrics endpoint GET /v1/apps/{appId}/aggregated_metric_histories/{metric_type} # Query parameters: # - start-time: Unix timestamp in nanoseconds # - end-time: Unix timestamp in nanoseconds # - order: "asc" or "desc" # - page: Page number for pagination # Scaling history endpoint GET /v1/apps/{appId}/scaling_histories # Query parameters: # - start-time: Unix timestamp in nanoseconds # - end-time: Unix timestamp in nanoseconds # - order: "asc" or "desc" # - page: Page number for pagination ``` -------------------------------- ### Retrieve Scaling History for an App Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt View the scaling event history for an application using `autoscaling-history` or its alias `ash`. This command shows when and why scaling actions occurred, including successes and failures. Supports filtering by time range and sorting. ```bash # View scaling history (defaults to descending order, recent first) cf autoscaling-history my-app ``` ```bash # View scaling history with time range in ascending order cf ash my-app \ --start 2024-01-15T08:00:00+00:00 \ --end 2024-01-15T18:00:00+00:00 \ --asc ``` -------------------------------- ### Set or View AutoScaler Service API Endpoint Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Configures or displays the AutoScaler service API endpoint. Use `--unset` to remove the configured endpoint. SSL validation can be skipped with `--skip-ssl-validation`, though this is not recommended. ```shell cf autoscaling-api [URL] [--unset] [--skip-ssl-validation] ``` ```shell $ cf autoscaling-api https://autoscaler. Setting AutoScaler api endpoint to https://autoscaler. OK ``` ```shell $ cf autoscaling-api Autoscaler api endpoint: https://autoscaler. ``` ```shell $ cf autoscaling-api --unset Unsetting AutoScaler api endpoint. OK $ cf autoscaling-api No api endpoint set. Use 'cf autoscaling-api' to set an endpoint. $ cf autoscaling-policy APP_NAME FAILED Error: No api endpoint set. Use 'cf autoscaling-api' to set an endpoint. ``` -------------------------------- ### cf autoscaling-metrics Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Retrieves aggregated metrics for an application. ```APIDOC ## cf autoscaling-metrics ### Description Retrieve the aggregated metrics of an application. Metrics are displayed in a table. ### Method CLI Command ### Parameters #### Arguments - **APP_NAME** (string) - Required - The name of the application. - **METRIC_NAME** (string) - Required - The name of the metric to retrieve. #### Options - **--start** (string) - Optional - Start time for the query. - **--end** (string) - Optional - End time for the query. - **--asc** (flag) - Optional - Display in ascending order. - **--output** (string) - Optional - Path to a file to save the metrics. ``` -------------------------------- ### cf autoscaling-policy Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Retrieves the scaling policy of an application in JSON format. ```APIDOC ## cf autoscaling-policy ### Description Retrieve the scaling policy of an application. The policy is displayed in JSON format. ### Method CLI Command ### Parameters #### Arguments - **APP_NAME** (string) - Required - The name of the application. #### Options - **--output** (string) - Optional - Path to a file to dump the policy in JSON format. ``` -------------------------------- ### Uninstall App-AutoScaler CLI Plug-in Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Uninstalls the AutoScaler plug-in from the Cloud Foundry CLI. ```shell cf uninstall-plugin AutoScaler ``` -------------------------------- ### cf autoscaling-api Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Sets or views the AutoScaler service API endpoint. ```APIDOC ## cf autoscaling-api ### Description Set or view the AutoScaler service API endpoint. If not set, other commands will fail. ### Method CLI Command ### Parameters #### Arguments - **URL** (string) - Optional - The URL of the AutoScaler service API. #### Options - **--unset** (flag) - Optional - Unset the current API endpoint. - **--skip-ssl-validation** (flag) - Optional - Skip verification of the API endpoint. ``` -------------------------------- ### Policy Management Endpoints Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Endpoints for retrieving, creating, updating, and deleting scaling policies for a specific application. ```APIDOC ## GET /v1/apps/{appId}/policy ### Description Retrieve the current scaling policy for the specified application. ### Method GET ### Endpoint /v1/apps/{appId}/policy ### Parameters #### Path Parameters - **appId** (string) - Required - The unique identifier of the application. ## PUT /v1/apps/{appId}/policy ### Description Create or update the scaling policy for the specified application. ### Method PUT ### Endpoint /v1/apps/{appId}/policy ### Parameters #### Path Parameters - **appId** (string) - Required - The unique identifier of the application. ## DELETE /v1/apps/{appId}/policy ### Description Delete the scaling policy for the specified application. ### Method DELETE ### Endpoint /v1/apps/{appId}/policy ### Parameters #### Path Parameters - **appId** (string) - Required - The unique identifier of the application. ``` -------------------------------- ### Retrieve Scaling Event History Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Retrieves the scaling event history for an application. Allows filtering by time range and sorting order, with an option to output to a file. ```APIDOC ## GET /cloudfoundry/app-autoscaler-cli-plugin/history ### Description Retrieves the scaling event history of an application. You can specify the start and end times for the query results and the display order (ascending or descending). The history is presented in a table format. ### Method GET ### Endpoint `cf autoscaling-history APP_NAME [--start START_TIME] [--end END_TIME] [--asc] [--output PATH_TO_FILE]` ### Parameters #### Path Parameters - **APP_NAME** (string) - Required - The name of the application. #### Query Parameters - **--start** (string) - Optional - The start time for the scaling history in `yyyy-MM-ddTHH:mm:ss+/-HH:mm` or `yyyy-MM-ddTHH:mm:ssZ` format. Defaults to the beginning of available history. - **--end** (string) - Optional - The end time for the scaling history in `yyyy-MM-ddTHH:mm:ss+/-HH:mm` or `yyyy-MM-ddTHH:mm:ssZ` format. Defaults to the current time. - **--asc** (boolean) - Optional - If present, displays history in ascending order. Defaults to descending order. - **--output** (string) - Optional - The path to a file where the scaling history should be dumped. ### Request Example ```bash $ cf autoscaling-history APP_NAME --start 2018-08-16T17:58:53+08:00 --end 2018-08-16T18:01:00+08:00 --asc ``` ### Response #### Success Response (200) - **Scaling Type** (string) - The trigger type of the scaling action (`dynamic` or `scheduled`). - **Status** (string) - The result of the scaling action (`succeeded` or `failed`). - **Instance Changes** (string) - Describes the change in the number of instances (e.g., `2->3`). - **Time** (string) - The finish time of the scaling action. - **Action** (string) - Details about why and how the application scaled. - **Error** (string) - The reason for scaling failure, if applicable. #### Response Example ```json Showing history for app APP_NAME... Scaling Type Status Instance Changes Time Action Error dynamic failed 2->-1 2018-08-16T17:58:53+08:00 -1 instance(s) because throughput < 10rps for 120 seconds app does not have policy set dynamic succeeded 2->3 2018-08-16T17:59:33+08:00 +1 instance(s) because memoryused >= 15MB for 120 seconds scheduled succeeded 3->6 2018-08-16T18:00:00+08:00 3 instance(s) because limited by min instances 6 ``` ``` -------------------------------- ### Uninstall AutoScaler Plugin Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Remove the plugin from the CF CLI. ```bash # Remove the plugin cf uninstall-plugin AutoScaler ``` -------------------------------- ### Detach Scaling Policy from an Application Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Use the `detach-autoscaling-policy` command or its alias `dasp` to remove the scaling policy from an application. This action stops automatic scaling for the application. ```bash # Detach the scaling policy from an application cf detach-autoscaling-policy my-app ``` ```bash # Using the alias cf dasp my-app ``` -------------------------------- ### DELETE /detach-autoscaling-policy Source: https://context7.com/cloudfoundry/app-autoscaler-cli-plugin/llms.txt Removes and deletes the scaling policy from an application. ```APIDOC ## DELETE /detach-autoscaling-policy ### Description Removes and deletes the scaling policy from an application. After detachment, the application will no longer be automatically scaled. ### Endpoint cf detach-autoscaling-policy (alias: dasp) [app_name] ### Parameters #### Path Parameters - **app_name** (string) - Required - The name of the application. ``` -------------------------------- ### Detach Scaling Policy from Application Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Removes the scaling policy from an application. Note that detaching the policy also deletes it. ```shell cf detach-autoscaling-policy APP_NAME ``` ```shell $ cf detach-autoscaling-policy APP_NAME Detaching policy for app APP_NAME... OK ``` -------------------------------- ### cf detach-autoscaling-policy Source: https://github.com/cloudfoundry/app-autoscaler-cli-plugin/blob/main/README.md Detaches and deletes the scaling policy from an application. ```APIDOC ## cf detach-autoscaling-policy ### Description Detach the scaling policy from an application. The policy will be deleted when detached. ### Method CLI Command ### Parameters #### Arguments - **APP_NAME** (string) - Required - The name of the application. ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.