Skip to content

Add Swagger UI to Internal Endpoints page #1347

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

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 7 additions & 44 deletions content/en/references/internal-endpoints.md
Original file line number Diff line number Diff line change
@@ -1,56 +1,19 @@
---
title: Internal Endpoints
weight: 50
type: swagger
tags:
- internal-endpoints
- localstack-endpoints
description: >
Overview of LocalStack and AWS specific internal endpoints for local development and testing
description: LocalStack REST API for internal and AWS-complementary features
---

LocalStack provides several internal endpoints for various local AWS services and LocalStack-specific features.
These endpoints are not part of the official AWS API and are available in the `/_localstack` and `/_aws` paths.
You can use [`cURL`](https://curl.se/) or your favourite HTTP REST client to access endpoints.

## LocalStack endpoints

The API path for the LocalStack internal resources is `/_localstack`.
The following endpoints are available:

| Endpoint | Description |
| ------------------------------------ | --------------------------------------------------------------------------- |
| `/_localstack/health` | To check the available and running AWS services in LocalStack. You can use the endpoint to restart the LocalStack services. |
| `/_localstack/plugins` | Shows the [Plux plugins](https://github.com/localstack/localstack/blob/master/docs/localstack-concepts/README.md#plugins) information in LocalStack. |
| `/_localstack/init` | Shows the initialization status after setting up [Init hooks](https://docs.localstack.cloud/references/init-hooks/). |
| `/_localstack/cloudformation/deploy` | Enables you to deploy CloudFormation templates locally through a web interface. |
| `/_localstack/diagnose` | Reports extensive and sensitive data from LocalStack instance, enabled via the `DEBUG=1` configuration variable. |
| `/_localstack/config` | Enables dynamic configuration updates at runtime, enabled via the `ENABLE_CONFIG_UPDATES` configuration variable. |
| `/_localstack/chaos` | [Chaos API]({{< ref "chaos-api" >}}) configuration endpoint |
| `/_localstack/state/<service>/save` | Get a snapshot of the given AWS service using the Persistence mechanism. |
| `/_localstack/state/<service>/load` | Load the most recent snapshot of the given service using the Persistence mechanism. |
| `/_localstack/state/reset` | Reset the state of the services using the Persistence mechanism. |
| `/_localstack/state/<service>/reset` | Reset the state of the given service using the Persistence mechanism. |
LocalStack provides a REST API for internal features such as init hooks, dynamic configuration, diagnostics, etc. and features that complement the AWS services.
These endpoints are available in the `/_localstack` and `/_aws` root paths respectively.

{{< callout "tip" >}}
You can use the `/_localstack/health` endpoint to restart or kill the services.
You can use `cURL` or your HTTP REST client to access the endpoint:
{{< command >}}
$ curl -v --request POST --header "Content-Type: application/json" --data '{"action":"restart"}' http://localhost:4566/_localstack/health
$ curl -v --request POST --header "Content-Type: application/json" --data '{"action":"kill"}' http://localhost:4566/_localstack/health
{{< /command >}}
You can use the Swagger UI below to interact with the API right from your browser.
This may require changing the LocalStack [security settings]({{< ref "configuration#security" >}}) to allow `https://docs.localstack.cloud` as CORS origin.
{{< /callout >}}

## AWS endpoints

The API path for the AWS internal resources is `/_aws`.
The following endpoints are available:

| Endpoint | Description |
|----------------------------------------|-----------------------------------------------------------|
| `/_aws/lambda/runtimes` | List Lambda runtimes. See [Lambda – Special Tools]({{< ref "user-guide/aws/lambda#special-tools" >}}) |
| `/_aws/sqs/messages` | Access all messages within a SQS queue |
| `/_aws/sns/platform-endpoint-messages` | Access and delete all the published SNS platform messages |
| `/_aws/ses` | Access and delete all the sent SES emails |
| `/_aws/cloudwatch/metrics/raw` | Access all the raw CloudWatch metrics |
| `/_aws/cognito-idp` | Access the local Cognito login form |
| `/_aws/dynamodb/expired` | Trigger the DynamoDB TTL worker at convenience |
{{< swaggerui src="/openapi.json" >}}
Loading