diff --git a/website/docs/registry/api.html.md b/website/docs/registry/api.html.md new file mode 100644 index 0000000000..dd516a50f1 --- /dev/null +++ b/website/docs/registry/api.html.md @@ -0,0 +1,186 @@ +--- +layout: "registry" +page_title: "Terraform Registry - HTTP API" +sidebar_current: "docs-registry-api" +description: |- + The /acl endpoints create, update, destroy, and query ACL tokens in Consul. +--- + +# HTTP API + +The [Terraform Registry](https://registry.terraform.io) has an HTTP API for +reading and downloading registry modules. + +Terraform interacts with the registry only as read-only. Therefore, the +documented API is only read-only. +Any endpoints that aren't documented on this +page can and will likely change over time. This allows differing methods +for getting modules into a registry while keeping a consistent API for +reading modules in a registry. + +## List Latest Version of Module for All Providers + +This endpoint returns the latest version of each provider for a module. + +| Method | Path | Produces | +| ------ | ---------------------------- | -------------------------- | +| `GET` | `/v1/modules/:namespace/:name` | `application/json` | + +### Parameters + +- `namespace` `(string: )` - The user the module is owned by. + This is required and is specified as part of the URL path. + +- `name` `(string: )` - The name of the module. + This is required and is specified as part of the URL path. + +### Sample Request + +```text +$ curl \ + https://registry.terraform.io/v1/modules/hashicorp/consul +``` + +### Sample Response + +```json +TODO +``` + +## Latest Module for a Single Provider + +This endpoint returns the latest version of a module for a single provider. + +| Method | Path | Produces | +| ------ | ---------------------------- | -------------------------- | +| `GET` | `/v1/modules/:namespace/:name/:provider` | `application/json` | + +### Parameters + +- `namespace` `(string: )` - The user the module is owned by. + This is required and is specified as part of the URL path. + +- `name` `(string: )` - The name of the module. + This is required and is specified as part of the URL path. + +- `provider` `(string: )` - The name of the provider. + This is required and is specified as part of the URL path. + +### Sample Request + +```text +$ curl \ + https://registry.terraform.io/v1/modules/hashicorp/consul/aws +``` + +### Sample Response + +```json +TODO +``` + +## Get a Specific Module + +This endpoint returns the specified version of a module for a single provider. + +| Method | Path | Produces | +| ------ | ---------------------------- | -------------------------- | +| `GET` | `/v1/modules/:namespace/:name/:provider/:version` | `application/json` | + +### Parameters + +- `namespace` `(string: )` - The user the module is owned by. + This is required and is specified as part of the URL path. + +- `name` `(string: )` - The name of the module. + This is required and is specified as part of the URL path. + +- `provider` `(string: )` - The name of the provider. + This is required and is specified as part of the URL path. + +- `version` `(string: )` - The version of the module. + This is required and is specified as part of the URL path. + +### Sample Request + +```text +$ curl \ + https://registry.terraform.io/v1/modules/hashicorp/consul/aws/1.0.0 +``` + +### Sample Response + +```json +TODO +``` + +## Download a Specific Module + +This endpoint downloads the specified version of a module for a single provider. + +| Method | Path | Produces | +| ------ | ---------------------------- | -------------------------- | +| `GET` | `/v1/modules/:namespace/:name/:provider/:version/download` | `application/json` | + +### Parameters + +- `namespace` `(string: )` - The user the module is owned by. + This is required and is specified as part of the URL path. + +- `name` `(string: )` - The name of the module. + This is required and is specified as part of the URL path. + +- `provider` `(string: )` - The name of the provider. + This is required and is specified as part of the URL path. + +- `version` `(string: )` - The version of the module. + This is required and is specified as part of the URL path. + +### Sample Request + +```text +$ curl \ + https://registry.terraform.io/v1/modules/hashicorp/consul/aws/1.0.0/download +``` + +### Sample Response + +```json +TODO +``` + +## Download the Latest Version of a Module + +This endpoint downloads the latest version of a module for a single provider. + +| Method | Path | Produces | +| ------ | ---------------------------- | -------------------------- | +| `GET` | `/v1/modules/:namespace/:name/:provider/download` | `application/json` | + +### Parameters + +- `namespace` `(string: )` - The user the module is owned by. + This is required and is specified as part of the URL path. + +- `name` `(string: )` - The name of the module. + This is required and is specified as part of the URL path. + +- `provider` `(string: )` - The name of the provider. + This is required and is specified as part of the URL path. + +- `version` `(string: )` - The version of the module. + This is required and is specified as part of the URL path. + +### Sample Request + +```text +$ curl \ + https://registry.terraform.io/v1/modules/hashicorp/consul/aws/download +``` + +### Sample Response + +```json +TODO +``` + diff --git a/website/docs/registry/modules/use.html.md b/website/docs/registry/modules/use.html.md index 4e690f0e17..836adf5332 100644 --- a/website/docs/registry/modules/use.html.md +++ b/website/docs/registry/modules/use.html.md @@ -3,7 +3,7 @@ layout: "registry" page_title: "Finding and Using Modules from the Terraform Registry" sidebar_current: "docs-registry-use" description: |- - The Terraform Registry is a repository of modules written by the Terraform community. + The Terraform Registry makes it simple to find and use modules. --- # Finding and Using Modules