Skip to content

Commit

Permalink
update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sczlog committed Sep 18, 2023
1 parent 0dd32d5 commit bf38e8b
Show file tree
Hide file tree
Showing 17 changed files with 1,234 additions and 17 deletions.
32 changes: 32 additions & 0 deletions docs/data-sources/cloudtower_cluster.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,36 @@ Read-Only:
- `id` (String)
- `name` (String)

## Usage

All arguments are optional, and if multiple arguments are provided, they are ANDed together.

### Use name to get a specific cluster

use name will search a cluster by its name directly. Return of the data source will be a list, even if there is only one cluster found, use index 0 to get the cluster.

```hcl
data "cloudtower_cluster" "sample_cluster" {
name = "sample_cluster"
}
```

### Use name_contains to fuzzy search clusters

use name_contains will search clusters by its name contains a certain string. Return a list of clusters, use index to get the cluster.

```hcl
data "cloudtower_cluster" "sample_cluster" {
name_contains = "sample"
}
```

### Use name_in to search clusters in name array

use name_in will search clusters by its name in a certain array. Return a list of clusters, use index to get the cluster.

```hcl
data "cloudtower_cluster" "sample_cluster" {
name_in = ["sample_cluster", "sample_cluster2"]
}
```
50 changes: 49 additions & 1 deletion docs/data-sources/cloudtower_content_library_vm_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ CloudTower content library vm template data source.

### Optional

- `cluster_in` (List of String) the cluster id which template has already distributed to.
- `cluster_id_in` (List of String) the cluster id which template has already distributed to.
- `name` (String) content library vm template's name
- `name_contains` (String) filter content_library vm template by its name contains characters
- `name_in` (String) content library vm template's name as an array
Expand Down Expand Up @@ -72,3 +72,51 @@ Read-Only:
- `vlan_id` (String)


### Usage

All arguments are optional, and if multiple arguments are provided, they are ANDed together.

### Use name to get a specific content library vm template

use name will search a content library vm template by its name directly. Return of the data source will be a list, even if there is only one content library vm template found, use index 0 to get the content library vm template.

```hcl
data "cloudtower_content_library_vm_template" "sample_content_library_vm_template" {
name = "sample_content_library_vm_template"
}
```

### Use name_contains to fuzzy search content library vm templates

use name_contains will search content library vm templates by its name contains a certain string. Return a list of content library vm templates, use index to get the content library vm template.

```hcl
data "cloudtower_content_library_vm_template" "sample_content_library_vm_template" {
name_contains = "sample"
}
```

### Use name_in to search content library vm templates in name array

use name_in will search content library vm templates by its name in a certain array. Return a list of content library vm templates, use index to get the content library vm template.

```hcl
data "cloudtower_content_library_vm_template" "sample_content_library_vm_template" {
name_in = ["sample1", "sample2"]
}
```

### Use cluster_id_in to restrict the content library vm template already distributed to certain clusters

if need to search content library vm template already been distributed to certain clusters, use cluster_in to restrict the search. Recommand to use with other filters.

```hcl
data "cloudtower_cluster" "sample_cluster" {
name = "sample_cluster"
}
data "cloudtower_content_library_vm_template" "sample_content_library_vm_template" {
name_contains = "sample"
cluster_id_in = [data.cloudtower_cluster.sample_cluster.clusters[0].clusters[0].id]
}
```
33 changes: 33 additions & 0 deletions docs/data-sources/cloudtower_datacenter.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,37 @@ Read-Only:
- `id` (String)
- `name` (String)

## Usage

All arguments are optional, and if multiple arguments are provided, they are ANDed together.

### Use name to get a specific datacenter

use name will search a datacenter by its name directly. Return of the data source will be a list, even if there is only one datacenter found, use index 0 to get the datacenter.

```hcl
data "cloudtower_datacenter" "sample_datacenter" {
name = "sample_datacenter"
}
```

### Use name_contains to fuzzy search datacenters

use name_contains will search datacenters by its name contains a certain string. Return a list of datacenters, use index to get the datacenter.

```hcl
data "cloudtower_datacenter" "sample_datacenter" {
name_contains = "sample"
}
```

### Use name_in to search datacenters in name array

use name_in will search datacenters by its name in a certain array. Return a list of datacenters, use index to get the datacenter.

```hcl
data "cloudtower_datacenter" "sample_datacenter" {
name_in = ["sample1", "sample2"]
}
```

124 changes: 124 additions & 0 deletions docs/data-sources/cloudtower_host.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,127 @@ Read-Only:
- `name` (String)


## Usage

All arguments are optional, and if multiple arguments are provided, they are ANDed together.

### Use name to get a specific host

use name will search a host by its name directly. Return of the data source will be a list, even if there is only one host found, use index 0 to get the host.

```hcl
data "cloudtower_host" "sample_host" {
name = "sample_host"
}
```

### Use name_contains to fuzzy search hosts

use name_contains will search hosts by its name contains a certain string. Return a list of hosts, use index to get the host.

```hcl
data "cloudtower_host" "sample_host" {
name_contains = "sample"
}
```

### Use name_in to search hosts in name array

use name_in will search hosts by its name in a certain array. Return a list of hosts, use index to get the host.

```hcl
data "cloudtower_host" "sample_host" {
name_in = ["sample1", "sample2"]
}
```

### Use management_ip to get a specific host

use management_ip will search a host by its management_ip directly. Return of the data source will be a list, even if there is only one host found, use index 0 to get the host.

```hcl
data "cloudtower_host" "sample_host" {
management_ip = "192.168.1.1"
}
```

### Use management_ip_contains to fuzzy search hosts

use management_ip_contains will search hosts by its management_ip contains a certain string. Return a list of hosts, use index to get the host.

```hcl
data "cloudtower_host" "sample_host" {
management_ip_contains = "31.16"
}
```

### Use management_ip_in to search hosts in management_ip array

use management_ip_in will search hosts by its management_ip in a certain array. Return a list of hosts, use index to get the host.

```hcl
data "cloudtower_host" "sample_host" {
management_ip_in = ["192.168.1.1", "192.168.1.2"]
}
```

### Use data_ip to get a specific host

use data_ip will search a host by its data_ip directly. Return of the data source will be a list, even if there is only one host found, use index 0 to get the host.

```hcl
data "cloudtower_host" "sample_host" {
data_ip = "10.0.1.1"
}
```

### Use data_ip_contains to fuzzy search hosts

use data_ip_contains will search hosts by its data_ip contains a certain string. Return a list of hosts, use index to get the host.

```hcl
data "cloudtower_host" "sample_host" {
data_ip_contains = "255.255"
}
```

### Use data_ip_in to search hosts in data_ip array

use data_ip_in will search hosts by its data_ip in a certain array. Return a list of hosts, use index to get the host.

```hcl
data "cloudtower_host" "sample_host" {
data_ip_in = ["10.0.1.1", "10.0.255.255"]
}
```

### Use cluster_id to get host in a specific cluster

use cluster_id will search hosts in a specific cluster. Return a list of hosts, use index to get the host.

```hcl
data "cloudtower_cluster" "sample_cluster" {
name = "sample_cluster"
}
data "cloudtower_host" "sample_host" {
cluster_id = data.cloudtower_cluster.sample_cluster.clusters[0].clusters[0].id
}
```

### Use cluster_id_in to get hosts in a one of clusters

```hcl
data "cloudtower_cluster" "sample_cluster" {
name = "sample_cluster"
}
data "cloudtower_host" "sample_host" {
cluster_id_in = [data.cloudtower_cluster.sample_cluster.clusters[0].clusters[0].id]
}
```




64 changes: 64 additions & 0 deletions docs/data-sources/cloudtower_iso.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,67 @@ Read-Only:
- `name` (String)


## Usage

All arguments are optional, and if multiple arguments are provided, they are ANDed together.

### Use name to get a specific image

use name will search a image by its name directly. Return of the data source will be a list, even if there is only one image found, use index 0 to get the image.

```hcl
data "cloudtower_iso" "sample_iso" {
name = "sample_iso"
}
```

### Use name_contains to fuzzy search images

use name_contains will search images by its name contains a certain string. Return a list of images, use index to get the image.

```hcl
data "cloudtower_iso" "sample_iso" {
name_contains = "sample"
}
```

### Use name_in to search images in name array

use name_in will search images by its name in a certain array. Return a list of images, use index to get the image.

```hcl
data "cloudtower_iso" "sample_iso" {
name_in = ["sample_iso", "sample_iso2"]
}
```

### Use cluster_id to get a specific image stored in a cluster

use cluster_id will search a image by its cluster id directly. Return of the data source will be a list, even if there is only one image found, use index 0 to get the image.

```hcl
data "cloudtower_cluster" "sample_cluster" {
name = "sample_cluster"
}
data "cloudtower_iso" "sample_iso" {
cluster_id = data.cloudtower_cluster.sample_cluster.clusters[0].id
}
```

### Use cluster_id_in to search images stored in clusters

use cluster_id_in will search images by its cluster id in a certain array. Return a list of images, use index to get the image, recommend to use cluster_id, as vm could only mount svt iso directly from cluster it runs on.

```hcl
data "cloudtower_cluster" "sample_cluster" {
name = "sample_cluster"
}
data "cloudtower_iso" "sample_iso" {
cluster_id_in = [data.cloudtower_cluster.sample_cluster.clusters[0].id]
}
```



58 changes: 58 additions & 0 deletions docs/data-sources/cloudtower_svt_iso.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,62 @@ Read-Only:
- `name` (String)
- `version` (Number)

### Usage

All arguments are optional, and if multiple arguments are provided, they are ANDed together.

### Use name to get a specific image

use name will search a image by its name directly. Return of the data source will be a list, even if there is only one image found, use index 0 to get the image.

```hcl
data "cloudtower_svt_iso" "sample_iso" {
name = "sample_iso"
}
```

### Use name_contains to fuzzy search images

use name_contains will search images by its name contains a certain string. Return a list of images, use index to get the image.

```hcl
data "cloudtower_svt_iso" "sample_iso" {
name_contains = "sample"
}
```

### Use name_in to search images in name array

use name_in will search images by its name in a certain array. Return a list of images, use index to get the image.

```hcl
data "cloudtower_svt_iso" "sample_iso" {
name_in = ["sample_iso", "sample_iso2"]
}
```

### Use cluster_id to get a specific image stored in a cluster

use cluster_id will search a image by its cluster id directly. Return of the data source will be a list, even if there is only one image found, use index 0 to get the image.

```hcl
data "cloudtower_cluster" "sample_cluster" {
name = "sample_cluster"
}
data "cloudtower_svt_iso" "sample_iso" {
cluster_id = data.cloudtower_cluster.sample_cluster.clusters[0].clusters[0].id
}
```

### Use cluster_id_in to search images stored in a cluster in a certain array

use cluster_id_in will search images by its cluster id in a certain array. Return a list of images, use index to get the image. Recommend to use cluster_id, as vm could only mount svt iso directly from cluster it runs on.

```hcl
data "cloudtower_cluster" "sample_cluster" {
name = "sample_cluster"
}
data "cloudtower_svt_iso" "sample_iso" {
cluster_id_in = [data.cloudtower_cluster.sample_cluster.clusters[0].clusters[0].id]
}
```
Loading

0 comments on commit bf38e8b

Please sign in to comment.