Skip to content

Commit

Permalink
updating gateway cluster documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
tmunzer committed Aug 22, 2024
1 parent b791fd0 commit 591346e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 8 deletions.
21 changes: 16 additions & 5 deletions docs/resources/device_gateway_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,28 @@
page_title: "mist_device_gateway_cluster Resource - terraform-provider-mist"
subcategory: "Devices"
description: |-
This resource manages the Gateway Clusters.It can be used to form or unset a cluster with two Gateways assigned to the same site.Please check the Juniper Documentation first to validate the cabling between the Gateways
This resource can be used to form or delete a Gateway Clusters. It can be used with two Gateways assigned to the same site.
Once the Cluster is formed, it can be create just like a Gateway with the mist_device_gateway resource:
Claim the gateways and assign them to a site with the mist_org_inventory resourceForm the Cluster with the mist_device_gateway_cluster resource by providing the site_id and the two nodes MAC Addresses (the first in the list will be the node0)Configure the Cluster with the mist_device_gateway resource
Please check the Juniper Documentation first to validate the cabling between the Gateways
---

# mist_device_gateway_cluster (Resource)

This resource manages the Gateway Clusters.It can be used to form or unset a cluster with two Gateways assigned to the same site.Please check the Juniper Documentation first to validate the cabling between the Gateways
This resource can be used to form or delete a Gateway Clusters. It can be used with two Gateways assigned to the same site.
Once the Cluster is formed, it can be create just like a Gateway with the `mist_device_gateway` resource:
1. Claim the gateways and assign them to a site with the `mist_org_inventory` resource
2. Form the Cluster with the `mist_device_gateway_cluster` resource by providing the `site_id` and the two nodes MAC Addresses (the first in the list will be the node0)
3. Configure the Cluster with the `mist_device_gateway` resource

Please check the Juniper Documentation first to validate the cabling between the Gateways


## Example Usage

```terraform
resource "mist_device_gateway_cluster" "cluster_one" {
site_id = mist_site.terraform_site2.id
device_id = "00000000-0000-0000-1000-4c96143de700"
nodes = [
{ mac = "4c961000000" },
{ mac = "4c961000001" }
Expand All @@ -28,15 +36,18 @@ resource "mist_device_gateway_cluster" "cluster_one" {

### Required

- `device_id` (String)
- `nodes` (Attributes List) (see [below for nested schema](#nestedatt--nodes))
- `site_id` (String)

### Read-Only

- `device_id` (String)

<a id="nestedatt--nodes"></a>
### Nested Schema for `nodes`

Required:

- `mac` (String) when replacing a noce, either mac has to remain the same as existing cluster
- `mac` (String) when replacing a node, either mac has to remain the same as existing cluster


1 change: 0 additions & 1 deletion examples/resources/mist_device_gateway_cluster/resource.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
resource "mist_device_gateway_cluster" "cluster_one" {
site_id = mist_site.terraform_site2.id
device_id = "00000000-0000-0000-1000-4c96143de700"
nodes = [
{ mac = "4c961000000" },
{ mac = "4c961000001" }
Expand Down
9 changes: 7 additions & 2 deletions internal/provider/device_gateway_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,13 @@ func (r *deviceGatewayClusterResource) Metadata(ctx context.Context, req resourc

func (r *deviceGatewayClusterResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = schema.Schema{
MarkdownDescription: docCategoryDevices + "This resource manages the Gateway Clusters." +
"It can be used to form or unset a cluster with two Gateways assigned to the same site." +
MarkdownDescription: docCategoryDevices + "This resource can be used to form or delete a Gateway" +
" Clusters. It can be used with two Gateways assigned to the same site.\n" +
"Once the Cluster is formed, it can be create just like a Gateway with the `mist_device_gateway` resource:\n" +
"1. Claim the gateways and assign them to a site with the `mist_org_inventory` resource\n" +
"2. Form the Cluster with the `mist_device_gateway_cluster` resource by providing the `site_id` and the two nodes " +
"MAC Addresses (the first in the list will be the node0)\n" +
"3. Configure the Cluster with the `mist_device_gateway` resource\n\n" +
"Please check the Juniper Documentation first to validate the cabling between the Gateways",
Attributes: resource_device_gateway_cluster.DeviceGatewayClusterResourceSchema(ctx).Attributes,
}
Expand Down

0 comments on commit 591346e

Please sign in to comment.