Skip to content
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

doc: Add website #81

Merged
merged 1 commit into from
Sep 29, 2018
Merged
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
21 changes: 19 additions & 2 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
TEST?=$$(go list ./... |grep -v 'vendor')
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
WEBSITE_REPO=github.com/hashicorp/terraform-website
PKG_NAME=ovirt

default: build

Expand Down Expand Up @@ -52,10 +54,25 @@ vendor-status:
test-compile:
@if [ "$(TEST)" = "./..." ]; then \
echo "ERROR: Set TEST to a specific package. For example,"; \
echo " make test-compile TEST=./ovirt"; \
echo " make test-compile TEST=./$(PKG_NAME)"; \
exit 1; \
fi
go test -c $(TEST) $(TESTARGS)

.PHONY: build test testacc vet fmt fmtcheck errcheck vendor-status test-compile tf-fmt tf-fmtcheck
website:
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)

website-test:
ifeq (,$(wildcard $(GOPATH)/src/$(WEBSITE_REPO)))
echo "$(WEBSITE_REPO) not found in your GOPATH (necessary for layouts and assets), get-ting..."
git clone https://$(WEBSITE_REPO) $(GOPATH)/src/$(WEBSITE_REPO)
endif
@$(MAKE) -C $(GOPATH)/src/$(WEBSITE_REPO) website-provider-test PROVIDER_PATH=$(shell pwd) PROVIDER_NAME=$(PKG_NAME)


.PHONY: build test testacc vet fmt fmtcheck errcheck vendor-status test-compile tf-fmt tf-fmtcheck website website-test

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,17 @@ provider "ovirt" {
* ovirt_storagedomains
* ovirt_vnic_profiles

Provider Documents
--------------
Currently the documents for this provider is not hosted by the offcial site [Terraform Providers](https://www.terraform.io/docs/providers/index.html). Please enter the provider directory and build the website locallly.

```sh
$ cd $GOPATH/src/github.com/imjoey/terraform-provider-ovirt
$ make website
```

The commands above will start a docker-based web server powered by [Middleman](https://middlemanapp.com/), which hosts the documents in `website` directory. Simply open `http://localhost:4567/docs/providers/ovirt` and enjoy them.


Disclaimer
---------
Expand Down
46 changes: 46 additions & 0 deletions website/docs/d/clusters.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
layout: "ovirt"
page_title: "oVirt: ovirt_clusters"
sidebar_current: "docs-ovirt-datasource-clusters"
description: |-
Provides details about oVirt clusters
---

# Data Source: ovirt\_clusters

The oVirt Clusters data source allows access to details of list of clusters within oVirt.

## Example Usage

```hcl
data "ovirt_clusters" "filtered_clusters" {
name_regex = "^default*"

search = {
criteria = "architecture = x86_64 and Storage.name = data"
max = 2
case_sensitive = false
}
}
```

## Argument Reference

The following arguments are supported:

* `name_regex` - (Optional) The fully functional regular expression for name
* `search` - (Optional) The general search criteria representation, fitting the rules of [Searching](http://ovirt.github.io/ovirt-engine-api-model/master/#_searching)
* criteria - (Optional) The criteria for searching, using the same syntax as the oVirt query language
* max - (Optional) The maximum amount of objects returned. If not specified, the search will return all the objects.
* case_sensitive - (Optional) If the search are case sensitive, default value is `false`

> The `search.criteria` also supports asterisk for searching by name, to indicate that any string matches, including the empty string. For example, the criteria `search=name=myobj*` will return all the objects with names beginning with `myobj`, such as `myobj2`, `myobj-test`. So, you could use `name_regex` for searching by complicated regular expression, and `search.criteria` for simple case accordingly.

## Attributes Reference

`clusters` is set to the wrapper of the found clusters. Each item of `clusters` contains the following attributes exported:

* `id` - The ID of oVirt Cluster
* `name` - The name of oVirt Cluster
* `description` - The description of oVirt Cluster
* `datacenter_id` - The ID of oVirt Datacenter the cluster belongs to
47 changes: 47 additions & 0 deletions website/docs/d/datacenters.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
layout: "ovirt"
page_title: "oVirt: ovirt_datacenters"
sidebar_current: "docs-ovirt-datasource-datacenters"
description: |-
Provides details about oVirt datacenters
---

# Data Source: ovirt\_datacenters

The oVirt Datacenters data source allows access to details of list of datacenters within oVirt.

## Example Usage

```hcl
data "ovirt_datacenters" "filtered_datacenters" {
name_regex = "^default*"

search = {
criteria = "status = up and Storage.name = data"
max = 2
case_sensitive = false
}
}
```

## Argument Reference

The following arguments are supported:

* `name_regex` - (Optional) The fully functional regular expression for name
* `search` - (Optional) The general search criteria representation, fitting the rules of [Searching](http://ovirt.github.io/ovirt-engine-api-model/master/#_searching)
* criteria - (Optional) The criteria for searching, using the same syntax as the oVirt query language
* max - (Optional) The maximum amount of objects returned. If not specified, the search will return all the objects.
* case_sensitive - (Optional) If the search are case sensitive, default value is `false`

> The `search.criteria` also supports asterisk for searching by name, to indicate that any string matches, including the empty string. For example, the criteria `search=name=myobj*` will return all the objects with names beginning with `myobj`, such as `myobj2`, `myobj-test`. So, you could use `name_regex` for searching by complicated regular expression, and `search.criteria` for simple case accordingly.

## Attributes Reference

`datacenters` is set to the wrapper of the found datacenters. Each item of `datacenters` contains the following attributes exported:

* `id` - The ID of oVirt Datacenter
* `name` - The name of oVirt Datacenter
* `status` - The status of oVirt Datacenter
* `local` - Whether it uses local storage
* `quota_mode` - The type of quota mode
51 changes: 51 additions & 0 deletions website/docs/d/disks.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
layout: "ovirt"
page_title: "oVirt: ovirt_disks"
sidebar_current: "docs-ovirt-datasource-disks"
description: |-
Provides details about oVirt disks
---

# Data Source: ovirt\_disks

The oVirt Disks data source allows access to details of list of disks within oVirt.

## Example Usage

```hcl
data "ovirt_disks" "filtered_disks" {
name_regex = "^test_disk*"

search = {
criteria = "name = test_disk1 and provisioned_size > 1024000000"
max = 2
case_sensitive = false
}
}
```

## Argument Reference

The following arguments are supported:

* `name_regex` - (Optional) The fully functional regular expression for name
* `search` - (Optional) The general search criteria representation, fitting the rules of [Searching](http://ovirt.github.io/ovirt-engine-api-model/master/#_searching)
* criteria - (Optional) The criteria for searching, using the same syntax as the oVirt query language
* max - (Optional) The maximum amount of objects returned. If not specified, the search will return all the objects.
* case_sensitive - (Optional) If the search are case sensitive, default value is `false`

> The `search.criteria` also supports asterisk for searching by name, to indicate that any string matches, including the empty string. For example, the criteria `search=name=myobj*` will return all the objects with names beginning with `myobj`, such as `myobj2`, `myobj-test`. So, you could use `name_regex` for searching by complicated regular expression, and `search.criteria` for simple case accordingly.

## Attributes Reference

`disks` is set to the wrapper of the found disks. Each item of `disks` contains the following attributes exported:

* `id` - The ID of oVirt Disk
* `name` - The name of oVirt Disk
* `alias` - The alias of oVirt Disk
* `format` - The format of oVirt Disk
* `quota_id` - The ID of quota of oVirt Disk
* `storage_domain_id` - The ID of storage domain the Disk belongs to
* `size` - The provisioned size of oVirt Disk
* `sharable` - Whether oVirt Disk could be attached to multiple vms
* `sparse` - Whether the physical storage for oVirt Disk should not be preallocated
48 changes: 48 additions & 0 deletions website/docs/d/networks.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
layout: "ovirt"
page_title: "oVirt: ovirt_networks"
sidebar_current: "docs-ovirt-datasource-networks"
description: |-
Provides details about oVirt networks
---

# Data Source: ovirt\_networks

The oVirt Networks data source allows access to details of list of networks within oVirt.

## Example Usage

```hcl
data "ovirt_networks" "filtered_networks" {
name_regex = "^ovirtmgmt-t*"

search = {
criteria = "datacenter = Default and name = ovirtmgmt-test"
max = 2
case_sensitive = false
}
}
```

## Argument Reference

The following arguments are supported:

* `name_regex` - (Optional) The fully functional regular expression for name
* `search` - (Optional) The general search criteria representation, fitting the rules of [Searching](http://ovirt.github.io/ovirt-engine-api-model/master/#_searching)
* criteria - (Optional) The criteria for searching, using the same syntax as the oVirt query language
* max - (Optional) The maximum amount of objects returned. If not specified, the search will return all the objects.
* case_sensitive - (Optional) If the search are case sensitive, default value is `false`

> The `search.criteria` also supports asterisk for searching by name, to indicate that any string matches, including the empty string. For example, the criteria `search=name=myobj*` will return all the objects with names beginning with `myobj`, such as `myobj2`, `myobj-test`. So, you could use `name_regex` for searching by complicated regular expression, and `search.criteria` for simple case accordingly.

## Attributes Reference

`networks` is set to the wrapper of the found networks. Each item of `networks` contains the following attributes exported:

* `id` - The ID of oVirt Network
* `name` - The name of oVirt Network
* `datacenter_id` - The ID of oVirt Datacenter the Network belongs to
* `description` - The description of oVirt Network
* `vlan_id` - The vlan tag
* `mtu` - The mtu of oVirt Network
49 changes: 49 additions & 0 deletions website/docs/d/storagedomains.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
layout: "ovirt"
page_title: "oVirt: ovirt_storagedomains"
sidebar_current: "docs-ovirt-datasource-storagedomains"
description: |-
Provides details about oVirt storagedomains
---

# Data Source: ovirt\_storagedomains

The oVirt Storagedomains data source allows access to details of list of storagedomains within oVirt.

## Example Usage

```hcl
data "ovirt_storagedomains" "filtered_storagedomains" {
name_regex = "^MAIN_dat.*|^DEV_dat.*"

search = {
criteria = "status != unattached and name = DS_INTERNAL and datacenter = MY_DC"
max = 2
case_sensitive = false
}
}
```

## Argument Reference

The following arguments are supported:

* `name_regex` - (Optional) The fully functional regular expression for name
* `search` - (Optional) The general search criteria representation, fitting the rules of [Searching](http://ovirt.github.io/ovirt-engine-api-model/master/#_searching)
* criteria - (Optional) The criteria for searching, using the same syntax as the oVirt query language
* max - (Optional) The maximum amount of objects returned. If not specified, the search will return all the objects.
* case_sensitive - (Optional) If the search are case sensitive, default value is `false`

> The `search.criteria` also supports asterisk for searching by name, to indicate that any string matches, including the empty string. For example, the criteria `search=name=myobj*` will return all the objects with names beginning with `myobj`, such as `myobj2`, `myobj-test`. So, you could use `name_regex` for searching by complicated regular expression, and `search.criteria` for simple case accordingly.

## Attributes Reference

`storagedomains` is set to the wrapper of the found storagedomains. Each item of `storagedomains` contains the following attributes exported:

* `id` - The ID of oVirt Storagedomain
* `name` - The name of oVirt Storagedomain
* `status` - The status of oVirt Storagedomain
* `external_status` - The external status of oVirt Storagedomain
* `type` - The type of oVirt Storagedomain
* `description` - The description of oVirt Storagedomain
* `datacenter_id` - The ID of oVirt Datacenter the Storagedomain belongs to
39 changes: 39 additions & 0 deletions website/docs/d/vnic_profiles.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
layout: "ovirt"
page_title: "oVirt: ovirt_vnic_profiles"
sidebar_current: "docs-ovirt-datasource-vnic-profiles"
description: |-
Provides details about oVirt vnic profiles
---

# Data Source: ovirt\_vnic\_profiles

The oVirt vNIC profiles data source allows access to details of list of vNIC profiles within oVirt.

## Example Usage

```hcl
data "ovirt_vnic_profiles" "filtered_vnic_profiles" {
name_regex = ".*mirror$"
network_id = "649f2d61-7f23-477b-93bd-d55f974d8bc8"
}
```

## Argument Reference

The following arguments are supported:

* `name_regex` - (Optional) The fully functional regular expression for name
* `network_id` - (Optional) The ID of network the vnic profile belongs to

> This data source dose not support for the regular oVirt query language.

## Attributes Reference

`vnic_profiles` is set to the wrapper of the found vnic profiles. Each item of `vnic_profiles` contains the following attributes exported:

* `id` - The ID of oVirt vNIC profile
* `name` - The name of oVirt vNIC profile
* `network_id` - The ID of network the vNIC profile applies to
* `migratable` - Whether `pass_through` vNIC is migratable
* `port_mirroring` - Whether port mirroring is enabled
41 changes: 41 additions & 0 deletions website/docs/index.html.markdown
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
layout: "ovirt"
page_title: "Provider: oVirt"
sidebar_current: "docs-ovirt-index"
description: |-
The oVirt provider is used to interact with the many resources supported by oVirt. The provider needs to be configured with the proper credentials before it can be used.
---

# oVirt Provider
The oVirt provider is used to interact with the many resources supported by oVirt. The provider needs to be configured with the proper credentials before it can be used.

Use the navigation to the left to read about the available resources.

## Example Usage

```hcl
# Configure the oVirt Provider
provider "ovirt" {
url = "https://engine-api/ovirt-engine/api"
username = "admin@internal"
password = "thepassword"
headers {
filter = true
all_content = true
}
}

# Create a VM
resource "ovirt_vm" "test-vm" {
# ...
}
```

## Configuration Reference

The following arguments are supported:

* `url` - (Required) The oVirt engine API URL. If omitted, the `OVIRT_URL` environment variable is used.
* `username` - (Required) The username for accessing oVirt engine API. If omitted, the `OVIRT_USERNAME` environment variable is used.
* `password` - (Required) The password of the user for accessing oVirt engine API. If omitted, the `OVIRT_PASSWORD` environment variable is used.
* `headers` - (Optional) A bunch of key-value pairs as the headers of the HTTP connection. The headers will be sent along with each API request, and could be overwrote with the header values specified in individual request.
Loading