-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[minor_change] Add nd_site and nd_version resource and data-sources (#6)
- Loading branch information
Showing
32 changed files
with
2,427 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
subcategory: "Sites" | ||
layout: "nd" | ||
page_title: "ND: nd_site" | ||
sidebar_current: "docs-nd-data-source-nd_site" | ||
description: |- | ||
Data source for Nexus Dashboard Sites | ||
--- | ||
|
||
# nd_site # | ||
|
||
Data source for Nexus Dashboard Sites | ||
|
||
## API Information ## | ||
|
||
* Site Management [API Information](https://developer.cisco.com/docs/nexus-dashboard/3-1-1/api-reference/) | ||
* API Endpoint: `nexus/api/sitemanagement/v4/sites` | ||
|
||
## GUI Information ## | ||
|
||
* Location: `Admin Console -> Manage -> Sites` | ||
|
||
## Example Usage ## | ||
|
||
```hcl | ||
data "nd_site" "example" { | ||
name = "example" | ||
} | ||
``` | ||
|
||
## Schema ## | ||
|
||
### Required ### | ||
|
||
* `name` (name) - (String) The name of the site. | ||
|
||
### Read-Only ### | ||
* `id` (id) - (String) The ID of the site. | ||
* `url` (host) - (String) The URL of the site. | ||
* `username` (userName) - (String) The username of the site. | ||
* `password` (password) - (String) The password of the site. | ||
* `type` (siteType) - (String) The type of the site. | ||
* `login_domain` (loginDomain) - (String) The login domain of the site. | ||
* `inband_epg` (inband_epg) - (String) The In-Band Endpoint Group (EPG) used to connect ND to the site. | ||
* `latitude` (latitude) - (String) The latitude location of the site. | ||
* `longitude` (longitude) - (String) The longitude location of the site. | ||
* `use_proxy` (useProxy) - (Bool) The use proxy of the site, used to route network traffic through a proxy server. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
subcategory: "Version" | ||
layout: "nd" | ||
page_title: "ND: nd_version" | ||
sidebar_current: "docs-nd-data-source-nd_version" | ||
description: |- | ||
Data source for Nexus Dashboard Version | ||
--- | ||
|
||
# nd_site # | ||
|
||
Data source for Nexus Dashboard Version | ||
|
||
## API Information ## | ||
|
||
* Site Management [API Information](https://developer.cisco.com/docs/nexus-dashboard/3-1-1/api-reference/) | ||
* API Endpoint: `version.json` | ||
|
||
## GUI Information ## | ||
|
||
* Location: `Help -> Welcome Screen` | ||
|
||
## Example Usage ## | ||
|
||
```hcl | ||
data "nd_version" "example" { | ||
} | ||
``` | ||
|
||
## Schema ## | ||
|
||
### Read-Only ### | ||
|
||
* `build_host` (build_host) - (String) The build host of the ND Platform Version. | ||
* `build_time` (build_time) - (String) The build time of the ND Platform Version. | ||
* `commit_id` (commit_id) - (String) The commit id of the ND Platform Version. | ||
* `maintenance` (maintenance) - (Number) The maintenance version number of the ND Platform Version. | ||
* `major` (major) - (Number) The major version number of the ND Platform Version. | ||
* `minor` (minor) - (Number) The minor version number of the ND Platform Version. | ||
* `patch` (patch) - (String) The patch version letter of the ND Platform Version. | ||
* `product_id` (product_id) - (String) The product id of the ND Platform Version. | ||
* `product_name` (product_name) - (String) The product name of the ND Platform Version. | ||
* `release` (release) - (Boolean) The release status of the ND Platform Version. | ||
* `user` (user) - (String) The build user name of the ND Platform Version. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
--- | ||
layout: "nd" | ||
page_title: "Provider: ND" | ||
sidebar_current: "docs-nd-index" | ||
description: |- | ||
The Cisco ND provider is used to interact with the resources provided by Cisco Nexus Dashboard. | ||
The provider needs to be configured with the proper credentials before it can be used. | ||
--- | ||
|
||
# Nexus Dashboard (ND) | ||
|
||
Cisco Nexus Dashboard is a central management console for multiple data center sites and a common analytics solution for Cisco data center operations. Nexus Dashboard allows users to manage multiple data center sites and provide real time analytics, visibility, assurance for network policies and operations, as well as policy orchestration for the data center fabrics, such as Cisco ACI or Cisco NDFC or standalone Nexus 9000 switches. | ||
|
||
# Cisco ND Provider | ||
|
||
The Cisco ND terraform provider is used to interact with resources provided by Cisco Nexus Dashboard. The provider needs to be configured with proper credentials to authenticate with Cisco Nexus Dashboard. | ||
|
||
## Authentication | ||
|
||
Authentication with username and password. | ||
|
||
Example: | ||
|
||
```hcl | ||
provider "nd" { | ||
username = "admin" | ||
password = "password" | ||
url = "https://my-cisco-nd.com" | ||
login_domain = "DefaultAuth" | ||
} | ||
``` | ||
|
||
## Example Usage | ||
|
||
```hcl | ||
terraform { | ||
required_providers { | ||
nd = { | ||
source = "ciscodevnet/nd" | ||
} | ||
} | ||
} | ||
provider "nd" { | ||
username = "admin" | ||
password = "password" | ||
url = "https://my-cisco-nd.com" | ||
insecure = false | ||
} | ||
resource "nd_site" "example" { | ||
name = "example" | ||
username = "admin" | ||
password = "password" | ||
url = "10.195.219.154" | ||
type = "aci" | ||
inband_epg = "test_epg" | ||
latitude = "19.36475238603211" | ||
longitude = "-155.28865502961474" | ||
login_domain = "local" | ||
} | ||
``` | ||
|
||
## Schema | ||
|
||
## Required | ||
|
||
- `username` (String) Username for the Nexus Dashboard Account. | ||
- Environment variable: `ND_USERNAME` | ||
- `password` (String) Password for the Nexus Dashboard Account. | ||
- Environment variable: `ND_PASSWORD` | ||
- `url` (String) URL of the Cisco Nexus Dashboard web interface. | ||
- Environment variable: `ND_URL` | ||
|
||
## Optional | ||
|
||
- `login_domain` (String) Login domain for the Nexus Dashboard Account. | ||
- Default: `DefaultAuth` | ||
- Environment variable: `ND_LOGIN_DOMAIN` | ||
- `insecure` (Boolean) Allow insecure HTTPS client. | ||
- Default: `false` | ||
- Environment variable: `ND_INSECURE` | ||
- `proxy_creds` (String) Proxy server credentials in the form of `username:password`. | ||
- Environment variable: `ND_PROXY_CREDS` | ||
- `proxy_url` (String) Proxy Server URL with port number. | ||
- Environment variable: `ND_PROXY_URL` | ||
- `retries` (Number) Number of retries for REST API calls. | ||
- Default: `2` | ||
- Environment variable: `ND_RETRIES` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
--- | ||
subcategory: "Sites" | ||
layout: "nd" | ||
page_title: "ND: nd_site" | ||
sidebar_current: "docs-nd-resource-nd_site" | ||
description: |- | ||
Manages Sites for Nexus Dashboard | ||
--- | ||
|
||
# nd_site # | ||
|
||
Manages Sites for Nexus Dashboard | ||
|
||
## API Information ## | ||
|
||
* Site Management [API Information](https://developer.cisco.com/docs/nexus-dashboard/3-1-1/api-reference/) | ||
* API Endpoint: `nexus/api/sitemanagement/v4/sites` | ||
|
||
## GUI Information ## | ||
|
||
* Location: `Admin Console -> Manage -> Sites` | ||
* [Guide](https://www.cisco.com/c/en/us/td/docs/dcn/nd/3x/articles-311/nexus-dashboard-sites-311.html#_adding_aci_sites) | ||
|
||
## Example Usage ## | ||
|
||
The configuration snippet below shows all possible attributes of the ND Site. | ||
|
||
!> This example might not be valid configuration and is only used to show all possible attributes. | ||
|
||
```hcl | ||
resource "nd_site" "example" { | ||
name = "example" | ||
url = "10.195.219.154" | ||
username = "admin" | ||
password = "password" | ||
type = "aci" | ||
inband_epg = "epg" | ||
login_domain = "local" | ||
latitude = "19.36475238603211" | ||
longitude = "-155.28865502961474" | ||
use_proxy = false | ||
} | ||
``` | ||
|
||
All examples for the Site resource can be found in the [examples](https://github.com/CiscoDevNet/terraform-provider-nd/tree/master/examples/resources/nd_site) folder. | ||
|
||
## Schema ## | ||
|
||
### Required ### | ||
|
||
* `name` (name) - (String) The name of the site. | ||
* `url` (host) - (String) The URL of the site. | ||
* `username` (userName) - (String) The username of the site. | ||
* `password` (password) - (String) The password of the site. | ||
* `type` (siteType) - (String) The type of the site. | ||
* Valid Values: `aci`, `dcnm`, `third_party`, `cloud_aci`, `dcnm_ng`, `ndfc`. | ||
|
||
### Optional ### | ||
|
||
* `login_domain` (loginDomain) - (String) The login domain of the site. | ||
* `inband_epg` (inband_epg) - (String) The In-Band Endpoint Group (EPG) used to connect ND to the site. | ||
* `latitude` (latitude) - (String) The latitude location of the site. | ||
* `longitude` (longitude) - (String) The longitude location of the site. | ||
* `use_proxy` (useProxy) - (Bool) The use proxy of the site, used to route network traffic through a proxy server. | ||
* Default: false | ||
|
||
### Read-Only ### | ||
|
||
* `id` (id) - (String) The ID of the site. | ||
|
||
## Importing | ||
|
||
An existing Site can be [imported](https://www.terraform.io/docs/import/index.html) into this resource with its name (name), via the following command: | ||
|
||
``` | ||
terraform import nd_site.example {name} | ||
``` | ||
|
||
Starting in Terraform version 1.5, an existing Site can be imported using [import blocks](https://developer.hashicorp.com/terraform/language/import) via the following configuration: | ||
|
||
``` | ||
import { | ||
name = "{name}" | ||
to = nd_site.example | ||
} | ||
``` | ||
|
||
~> The values for `username`, `password`, and `login_domain` attributes will not be imported when the `nd_site` resource imports an already registered site from Nexus Dashboard. Modifying the `username`, `password`, and `login_domain` will not update the imported site configuration on Nexus Dashboard. Use the `-replace` option to force the site recreation and use the new provided `username`, `password`, and `login_domain` attributes for the imported site. | ||
|
||
``` | ||
terraform apply -replace="nd_site.example" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
data "nd_site" "example" { | ||
name = "example" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
terraform { | ||
required_providers { | ||
nd = { | ||
source = "ciscodevnet/nd" | ||
} | ||
} | ||
} | ||
|
||
provider "nd" { | ||
username = "" | ||
password = "" | ||
url = "" | ||
insecure = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
data "nd_version" "example" { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
terraform { | ||
required_providers { | ||
nd = { | ||
source = "ciscodevnet/nd" | ||
} | ||
} | ||
} | ||
|
||
provider "nd" { | ||
username = "" | ||
password = "" | ||
url = "" | ||
insecure = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
terraform { | ||
required_providers { | ||
nd = { | ||
source = "ciscodevnet/nd" | ||
} | ||
} | ||
} | ||
|
||
provider "nd" { | ||
username = "" | ||
password = "" | ||
url = "" | ||
insecure = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
resource "nd_site" "example" { | ||
name = "example" | ||
username = "admin" | ||
password = "password" | ||
url = "10.195.219.154" | ||
type = "aci" | ||
inband_epg = "test_epg" | ||
latitude = "19.36475238603211" | ||
longitude = "-155.28865502961474" | ||
login_domain = "local" | ||
use_proxy = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
terraform { | ||
required_providers { | ||
nd = { | ||
source = "ciscodevnet/nd" | ||
} | ||
} | ||
} | ||
|
||
provider "nd" { | ||
username = "" | ||
password = "" | ||
url = "" | ||
insecure = true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.