diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1f2771c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,61 @@ +name: Create release +on: + push: + tags: + - 'v*' +jobs: + release: + name: Tag + runs-on: ubuntu-20.04 + steps: + - + name: Checkout the code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - + name: Install and configure Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + - + name: Install and configure GoReleaser + env: + GORELEASER_VERSION: '0.155.1' + run: | + curl -sL -o goreleaser_amd64.deb "https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION}/goreleaser_amd64.deb" + sudo dpkg -i goreleaser_amd64.deb + rm -f goreleaser_amd64.deb + - + name: Import the GPG signing key + env: + GPG_KEY: ${{ secrets.GPG_KEY }} + GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} + run: | + mkdir -p ~/.gnupg + chmod 0700 ~/.gnupg + + cat << EOF > ~/.gnupg/gpg.conf + use-agent + pinentry-mode loopback + EOF + + echo "$GPG_KEY" | base64 -d | gpg --batch --allow-secret-key-import --import + gpg --keyid-format LONG --list-secret-keys + + cat << EOF > ~/.gnupg/gpg-agent.conf + default-cache-ttl 7200 + max-cache-ttl 31536000 + allow-loopback-pinentry + allow-preset-passphrase + EOF + + echo RELOADAGENT | gpg-connect-agent + + printf '%s' "$GPG_PASSPHRASE" > ./.gpg_passphrase + - + name: Create release + env: + GPG_FINGERPRINT: ${{ secrets.GPG_FINGERPRINT }} + run: | + goreleaser build --parallelism 2 --rm-dist --timeout 1h diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..c9c6fa1 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,34 @@ +name: Test changes +on: + pull_request: + branches: + - main + - master + - 'v*' +jobs: + test: + name: Pull Request + runs-on: ubuntu-20.04 + steps: + - + name: Checkout the code + uses: actions/checkout@v2 + with: + fetch-depth: 0 + - + name: Install and configure Go + uses: actions/setup-go@v2 + with: + go-version: 1.15 + - + name: Install and configure GoReleaser + env: + GORELEASER_VERSION: '0.155.1' + run: | + curl -sL -o goreleaser_amd64.deb "https://github.com/goreleaser/goreleaser/releases/download/v${GORELEASER_VERSION}/goreleaser_amd64.deb" + sudo dpkg -i goreleaser_amd64.deb + rm -f goreleaser_amd64.deb + - + name: Create snapshot + run: | + goreleaser build --config .goreleaser.test.yml --parallelism 2 --rm-dist --snapshot --timeout 1h diff --git a/.goreleaser.test.yml b/.goreleaser.test.yml new file mode 100644 index 0000000..467767b --- /dev/null +++ b/.goreleaser.test.yml @@ -0,0 +1,37 @@ +before: + hooks: + - go mod tidy +builds: +- env: + - CGO_ENABLED=0 + mod_timestamp: '{{ .CommitTimestamp }}' + flags: + - -trimpath + ldflags: + - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' + goos: + - freebsd + - windows + - linux + - darwin + goarch: + - amd64 + - '386' + - arm + - arm64 + ignore: + - goos: darwin + goarch: '386' + binary: '{{ .ProjectName }}_v{{ .Version }}' +archives: +- format: zip + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' + algorithm: sha256 +signs: + - artifacts: none +release: + draft: false +changelog: + skip: true diff --git a/.goreleaser.yml b/.goreleaser.yml new file mode 100644 index 0000000..dca0b00 --- /dev/null +++ b/.goreleaser.yml @@ -0,0 +1,48 @@ +before: + hooks: + - go mod tidy +builds: + - env: + - CGO_ENABLED=0 + mod_timestamp: '{{ .CommitTimestamp }}' + flags: + - -trimpath + ldflags: + - '-s -w -X main.version={{.Version}} -X main.commit={{.Commit}}' + goos: + - freebsd + - windows + - linux + - darwin + goarch: + - amd64 + - '386' + - arm + - arm64 + ignore: + - goos: darwin + goarch: '386' + binary: '{{ .ProjectName }}_v{{ .Version }}' +archives: + - format: zip + name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' +checksum: + name_template: '{{ .ProjectName }}_{{ .Version }}_SHA256SUMS' + algorithm: sha256 +signs: + - artifacts: checksum + args: + - "--batch" + - "--local-user" + - "{{ .Env.GPG_FINGERPRINT }}" + - "--output" + - "${signature}" + - "--passphrase-fd" + - "0" + - "--detach-sign" + - "${artifact}" + stdin_file: ./.gpg_passphrase +release: + draft: false +changelog: + skip: true diff --git a/.travis.yml b/.travis.yml index 695ca62..5ca0fb0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,7 +8,7 @@ cache: - $HOME/gopath/pkg/mod go: - - 1.13.x + - 1.15.x git: depth: 1 diff --git a/CHANGELOG.md b/CHANGELOG.md index 38871fa..256a612 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,36 @@ -## 0.4.0 (UNRELEASED) +## v0.4.0 FEATURES: * **New Data Source:** `proxmox_virtual_environment_time` * **New Resource:** `proxmox_virtual_environment_time` +BREAKING CHANGES: + +* resource/virtual_environment_vm: `interface` is now required to create disks + + ``` + disk { + datastore_id = "local-lvm" + file_id = "${proxmox_virtual_environment_file.ubuntu_cloud_image.id}" + interface = "scsi0" + } + ``` + ENHANCEMENTS: * provider/configuration: Add `virtual_environment.otp` argument for TOTP support +* resource/virtual_environment_vm: Clone supports resize and datastore_id for moving disks +* resource/virtual_environment_vm: Bulk clones can now use retries as argument to try multiple times to create a clone. +* resource/virtual_environment_vm: `on_boot` parameter can be used to start a VM after the Node has been rebooted. +* resource/virtual_environment_vm: `reboot` parameter can be used to reboot a VM after creation +* resource/virtual_environment_vm: Has now multiple new parameters to set timeouts for the vm creation/cloning `timeout_clone`, `timeout_move_disk`, `timeout_reboot`, `timeout_shutdown_vm`, `timeout_start_vm`, `timeout_stop_vm` BUG FIXES: * library/virtual_environment_nodes: Fix node IP address format +* library/virtual_environment_nodes: Fix WaitForNodeTask now detects errors correctly +* library/virtual_environment_vm: Fix CloneVM now waits for the task to be finished and detect errors. * resource/virtual_environment_container: Fix VM ID collision when `vm_id` is not specified * resource/virtual_environment_vm: Fix VM ID collision when `vm_id` is not specified * resource/virtual_environment_vm: Fix disk import issue when importing from directory-based datastores diff --git a/docs/data-sources/alias.md b/docs/data-sources/alias.md new file mode 100644 index 0000000..bbf5a60 --- /dev/null +++ b/docs/data-sources/alias.md @@ -0,0 +1,29 @@ +--- +layout: page +title: Alias +permalink: /data-sources/alias +nav_order: 1 +parent: Data Sources +subcategory: Virtual Environment +--- + +# Data Source: Alias + +Retrieves information about a specific alias. + +## Example Usage + +``` +data "proxmox_virtual_environment_cluster_alias" "local_network" { + name = "local_network" +} +``` + +## Argument Reference + +* `name` - (Required) Alias name. + +## Attribute Reference + +* `cidr` - (Required) Network/IP specification in CIDR format. +* `comment` - (Optional) Alias comment. diff --git a/docs/data-sources/aliases.md b/docs/data-sources/aliases.md new file mode 100644 index 0000000..68fb7ec --- /dev/null +++ b/docs/data-sources/aliases.md @@ -0,0 +1,26 @@ +--- +layout: page +title: Aliases +permalink: /data-sources/aliases +nav_order: 2 +parent: Data Sources +subcategory: Virtual Environment +--- + +# Data Source: Aliases + +Retrieves the identifiers for all the available aliases. + +## Example Usage + +``` +data "proxmox_virtual_environment_cluster_aliases" "available_aliases" {} +``` + +## Argument Reference + +There are no arguments available for this data source. + +## Attribute Reference + +* `alias_ids` - The pool identifiers. diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_datastores.md b/docs/data-sources/datastores.md similarity index 79% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_datastores.md rename to docs/data-sources/datastores.md index 9a6f9cd..2b9cc74 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_datastores.md +++ b/docs/data-sources/datastores.md @@ -1,10 +1,10 @@ --- layout: page title: Datastores -permalink: /data-sources/virtual-environment/datastores -nav_order: 1 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +permalink: /data-sources/datastores +nav_order: 3 +parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Datastores @@ -19,11 +19,11 @@ data "proxmox_virtual_environment_datastores" "first_node" { } ``` -## Arguments Reference +## Argument Reference * `node_name` - (Required) A node name. -## Attributes Reference +## Attribute Reference * `active` - Whether the datastore is active. * `content_types` - The allowed content types. diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_dns.md b/docs/data-sources/dns.md similarity index 64% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_dns.md rename to docs/data-sources/dns.md index d849502..bc65150 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_dns.md +++ b/docs/data-sources/dns.md @@ -1,10 +1,10 @@ --- layout: page title: DNS -permalink: /data-sources/virtual-environment/dns -nav_order: 2 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +permalink: /data-sources/dns +nav_order: 4 +parent: Data Sources +subcategory: Virtual Environment --- # Data Source: DNS @@ -19,11 +19,11 @@ data "proxmox_virtual_environment_dns" "first_node" { } ``` -## Arguments Reference +## Argument Reference * `node_name` - (Required) A node name. -## Attributes Reference +## Attribute Reference * `domain` - The DNS search domain. * `servers` - The DNS servers. diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_group.md b/docs/data-sources/group.md similarity index 75% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_group.md rename to docs/data-sources/group.md index d82bb62..27b517b 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_group.md +++ b/docs/data-sources/group.md @@ -1,10 +1,10 @@ --- layout: page title: Group -permalink: /data-sources/virtual-environment/group -nav_order: 3 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +permalink: /data-sources/group +nav_order: 5 +parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Group @@ -19,11 +19,11 @@ data "proxmox_virtual_environment_group" "operations_team" { } ``` -## Arguments Reference +## Argument Reference * `group_id` - (Required) The group identifier. -## Attributes Reference +## Attribute Reference * `acl` - The access control list. * `path` - The path. diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_groups.md b/docs/data-sources/groups.md similarity index 65% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_groups.md rename to docs/data-sources/groups.md index cf4e09e..524a25a 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_groups.md +++ b/docs/data-sources/groups.md @@ -1,10 +1,10 @@ --- layout: page title: Groups -permalink: /data-sources/virtual-environment/groups -nav_order: 4 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +permalink: /data-sources/groups +nav_order: 6 +parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Groups @@ -17,11 +17,11 @@ Retrieves basic information about all available user groups. data "proxmox_virtual_environment_groups" "available_groups" {} ``` -## Arguments Reference +## Argument Reference There are no arguments available for this data source. -## Attributes Reference +## Attribute Reference * `comments` - The group comments. * `group_ids` - The group identifiers. diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_hosts.md b/docs/data-sources/hosts.md similarity index 73% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_hosts.md rename to docs/data-sources/hosts.md index 044fe2f..ccc7376 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_hosts.md +++ b/docs/data-sources/hosts.md @@ -1,10 +1,10 @@ --- layout: page title: Hosts -permalink: /data-sources/virtual-environment/hosts -nav_order: 5 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +permalink: /data-sources/hosts +nav_order: 7 +parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Hosts @@ -19,11 +19,11 @@ data "proxmox_virtual_environment_hosts" "first_node_host_entries" { } ``` -## Arguments Reference +## Argument Reference * `node_name` - (Required) A node name. -## Attributes Reference +## Attribute Reference * `addresses` - The IP addresses. * `digest` - The SHA1 digest. diff --git a/docs/data_sources/index.md b/docs/data-sources/index.html similarity index 88% rename from docs/data_sources/index.md rename to docs/data-sources/index.html index d2695eb..27061e0 100644 --- a/docs/data_sources/index.md +++ b/docs/data-sources/index.html @@ -2,7 +2,7 @@ layout: page title: Data Sources permalink: /data-sources -nav_order: 2 +nav_order: 3 has_children: true --- diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_nodes.md b/docs/data-sources/nodes.md similarity index 79% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_nodes.md rename to docs/data-sources/nodes.md index 4631056..d964879 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_nodes.md +++ b/docs/data-sources/nodes.md @@ -1,10 +1,10 @@ --- layout: page title: Nodes -permalink: /data-sources/virtual-environment/nodes -nav_order: 6 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +permalink: /data-sources/nodes +nav_order: 8 +parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Nodes @@ -17,11 +17,11 @@ Retrieves information about all available nodes. data "proxmox_virtual_environment_nodes" "available_nodes" {} ``` -## Arguments Reference +## Argument Reference There are no arguments available for this data source. -## Attributes Reference +## Attribute Reference * `cpu_count` - The CPU count for each node. * `cpu_utilization` - The CPU utilization on each node. diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_pool.md b/docs/data-sources/pool.md similarity index 75% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_pool.md rename to docs/data-sources/pool.md index d919b3d..394e1bb 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_pool.md +++ b/docs/data-sources/pool.md @@ -1,10 +1,10 @@ --- layout: page title: Pool -permalink: /data-sources/virtual-environment/pool -nav_order: 7 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +permalink: /data-sources/pool +nav_order: 9 +parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Pool @@ -19,11 +19,11 @@ data "proxmox_virtual_environment_pool" "operations_pool" { } ``` -## Arguments Reference +## Argument Reference * `pool_id` - (Required) The pool identifier. -## Attributes Reference +## Attribute Reference * `comment` - The pool comment. * `members` - The pool members. diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_pools.md b/docs/data-sources/pools.md similarity index 63% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_pools.md rename to docs/data-sources/pools.md index 28074d9..5b712a5 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_pools.md +++ b/docs/data-sources/pools.md @@ -1,10 +1,10 @@ --- layout: page title: Pools -permalink: /data-sources/virtual-environment/pools -nav_order: 8 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +permalink: /data-sources/pools +nav_order: 10 +parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Pools @@ -17,10 +17,10 @@ Retrieves the identifiers for all the available resource pools. data "proxmox_virtual_environment_pools" "available_pools" {} ``` -## Arguments Reference +## Argument Reference There are no arguments available for this data source. -## Attributes Reference +## Attribute Reference * `pool_ids` - The pool identifiers. diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_role.md b/docs/data-sources/role.md similarity index 62% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_role.md rename to docs/data-sources/role.md index 26d15f4..24cbbff 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_role.md +++ b/docs/data-sources/role.md @@ -1,10 +1,10 @@ --- layout: page title: Role -permalink: /data-sources/virtual-environment/role -nav_order: 9 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +permalink: /data-sources/role +nav_order: 11 +parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Role @@ -19,10 +19,10 @@ data "proxmox_virtual_environment_role" "operations_role" { } ``` -## Arguments Reference +## Argument Reference * `role_id` - (Required) The role identifier. -## Attributes Reference +## Attribute Reference * `privileges` - The role privileges diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_roles.md b/docs/data-sources/roles.md similarity index 68% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_roles.md rename to docs/data-sources/roles.md index af7c9b2..fb0fc4b 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_roles.md +++ b/docs/data-sources/roles.md @@ -1,10 +1,10 @@ --- layout: page title: Roles -permalink: /data-sources/virtual-environment/roles -nav_order: 10 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +permalink: /data-sources/roles +nav_order: 12 +parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Roles @@ -17,11 +17,11 @@ Retrieves information about all the available roles. data "proxmox_virtual_environment_roles" "available_roles" {} ``` -## Arguments Reference +## Argument Reference There are no arguments available for this data source. -## Attributes Reference +## Attribute Reference * `privileges` - The role privileges. * `role_ids` - The role identifiers. diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_time.md b/docs/data-sources/time.md similarity index 68% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_time.md rename to docs/data-sources/time.md index 54fc08a..b580034 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_time.md +++ b/docs/data-sources/time.md @@ -1,10 +1,10 @@ --- layout: page title: Time -permalink: /data-sources/virtual-environment/time -nav_order: 11 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +permalink: /data-sources/time +nav_order: 13 +parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Time @@ -19,11 +19,11 @@ data "proxmox_virtual_environment_time" "first_node_time" { } ``` -## Arguments Reference +## Argument Reference * `node_name` - (Required) A node name. -## Attributes Reference +## Attribute Reference * `local_time` - The node's local time. * `time_zone` - The node's time zone. diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_user.md b/docs/data-sources/user.md similarity index 80% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_user.md rename to docs/data-sources/user.md index a6338b0..5c15995 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_user.md +++ b/docs/data-sources/user.md @@ -1,10 +1,10 @@ --- layout: page title: User -permalink: /data-sources/virtual-environment/user -nav_order: 12 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +permalink: /data-sources/user +nav_order: 14 +parent: Data Sources +subcategory: Virtual Environment --- # Data Source: User @@ -19,11 +19,11 @@ data "proxmox_virtual_environment_user" "operations_user" { } ``` -## Arguments Reference +## Argument Reference * `user_id` - (Required) The user identifier. -## Attributes Reference +## Attribute Reference * `acl` - The access control list. * `path` - The path. diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_users.md b/docs/data-sources/users.md similarity index 77% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_users.md rename to docs/data-sources/users.md index 6259ed4..2768738 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_users.md +++ b/docs/data-sources/users.md @@ -1,10 +1,10 @@ --- layout: page title: Users -permalink: /data-sources/virtual-environment/users -nav_order: 13 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +permalink: /data-sources/users +nav_order: 15 +parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Users @@ -17,11 +17,11 @@ Retrieves information about all the available users. data "proxmox_virtual_environment_users" "available_users" {} ``` -## Arguments Reference +## Argument Reference There are no arguments available for this data source. -## Attributes Reference +## Attribute Reference * `comments` - The user comments. * `emails` - The users' email addresses. diff --git a/docs/data_sources/virtual_environment/data_source_virtual_environment_version.md b/docs/data-sources/version.md similarity index 70% rename from docs/data_sources/virtual_environment/data_source_virtual_environment_version.md rename to docs/data-sources/version.md index 700dc88..45c43da 100644 --- a/docs/data_sources/virtual_environment/data_source_virtual_environment_version.md +++ b/docs/data-sources/version.md @@ -1,10 +1,10 @@ --- layout: page title: Version -permalink: /data-sources/virtual-environment/version -nav_order: 14 -parent: Virtual Environment Data Sources -grand_parent: Data Sources +permalink: /data-sources/version +nav_order: 16 +parent: Data Sources +subcategory: Virtual Environment --- # Data Source: Version @@ -17,11 +17,11 @@ Retrieves the version information from the API endpoint. data "proxmox_virtual_environment_version" "current_version" {} ``` -## Arguments Reference +## Argument Reference There are no arguments available for this data source. -## Attributes Reference +## Attribute Reference * `keyboard_layout` - The keyboard layout. * `release` - The release number. diff --git a/docs/data_sources/virtual_environment/index.md b/docs/data_sources/virtual_environment/index.md deleted file mode 100644 index 9e0eea0..0000000 --- a/docs/data_sources/virtual_environment/index.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: page -title: Virtual Environment Data Sources -permalink: /data-sources/virtual-environment -nav_order: 1 -parent: Data Sources -has_children: true ---- - -# Virtual Environment Data Sources diff --git a/docs/index.md b/docs/index.md index 48f9918..e56366b 100644 --- a/docs/index.md +++ b/docs/index.md @@ -23,22 +23,6 @@ provider "proxmox" { } ``` -## Installation - -You can install the latest release of the provider using either Git Bash or regular Bash: - -```sh -$ export PROVIDER_PLATFORM="$([[ "$OSTYPE" =~ ^msys|cygwin$ ]] && echo "windows" || ([[ "$OSTYPE" == "darwin"* ]] && echo "darwin" || ([[ "$OSTYPE" == "linux"* ]] && echo "linux" || echo "unsupported")))" -$ export PROVIDER_VERSION="$(curl -L -s -H 'Accept: application/json' https://github.com/danitso/terraform-provider-proxmox/releases/latest | sed -e 's/.*"tag_name":"\([^"]*\)".*/\1/')" -$ export PLUGINS_PATH="$([[ "$PROVIDER_PLATFORM" == "windows" ]] && cygpath -u "$APPDATA" || echo "$HOME")/terraform.d/plugins" -$ mkdir -p "$PLUGINS_PATH" -$ curl -o "${PLUGINS_PATH}/terraform-provider-proxmox_v${PROVIDER_VERSION}.zip" -sL "https://github.com/danitso/terraform-provider-proxmox/releases/download/${PROVIDER_VERSION}/terraform-provider-proxmox_v${PROVIDER_VERSION}-custom_${PROVIDER_PLATFORM}_amd64.zip" -$ unzip -o -d "$PLUGINS_PATH" "${PLUGINS_PATH}/terraform-provider-proxmox_v${PROVIDER_VERSION}.zip" -$ rm "${PLUGINS_PATH}/terraform-provider-proxmox_v${PROVIDER_VERSION}.zip" -``` - -You can also install it manually by following the instructions to [install it as a plugin](https://www.terraform.io/docs/plugins/basics.html#installing-plugins). You can download the latest release from the [releases](https://github.com/danitso/terraform-provider-proxmox/releases) page. - ## Authentication The Proxmox provider offers a flexible means of providing credentials for authentication. The following methods are supported, in this order, and explained below: @@ -80,7 +64,7 @@ $ export PROXMOX_VE_PASSWORD="a-strong-password" $ terraform plan ``` -## Arguments Reference +## Argument Reference In addition to [generic provider arguments](https://www.terraform.io/docs/configuration/providers.html) (e.g. `alias` and `version`), the following arguments are supported in the Proxmox `provider` block: diff --git a/docs/resources/alias.md b/docs/resources/alias.md new file mode 100644 index 0000000..319914e --- /dev/null +++ b/docs/resources/alias.md @@ -0,0 +1,39 @@ +--- +layout: page +title: Alias +permalink: /ressources/alias +nav_order: 1 +parent: Resources +subcategory: Virtual Environment +--- + +# Resource: Alias + +Aliases are used to see what devices or group of devices are affected by a rule. +We can create aliases to identify an IP address or a network. + +## Example Usage + +``` +resource "proxmox_virtual_environment_cluster_alias" "local_network" { + name = "local_network" + cidr = "192.168.0.0/23" + comment = "Managed by Terraform" +} + +resource "proxmox_virtual_environment_cluster_alias" "ubuntu_vm" { + name = "ubuntu" + cidr = "192.168.0.1" + comment = "Managed by Terraform" +} +``` + +## Argument Reference + +* `name` - (Required) Alias name. +* `cidr` - (Required) Network/IP specification in CIDR format. +* `comment` - (Optional) Alias comment. + +## Attribute Reference + +There are no attribute references available for this resource. diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_certificate.md b/docs/resources/certificate.md similarity index 90% rename from docs/resources/virtual_environment/proxmox_virtual_environment_certificate.md rename to docs/resources/certificate.md index f8c0bc7..148801d 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_certificate.md +++ b/docs/resources/certificate.md @@ -1,10 +1,10 @@ --- layout: page title: Certificate -permalink: /ressources/virtual-environment/certificate -nav_order: 1 -parent: Virtual Environment Resources -grand_parent: Resources +permalink: /resources/certificate +nav_order: 2 +parent: Resources +subcategory: Virtual Environment --- # Resource: Certificate @@ -44,14 +44,14 @@ resource "tls_self_signed_cert" "proxmox_virtual_environment_certificate" { } ``` -## Arguments Reference +## Argument Reference * `certificate` - (Required) The PEM encoded certificate. * `certificate_chain` - (Optional) The PEM encoded certificate chain. * `node_name` - (Required) A node name. * `private_key` - (Required) The PEM encoded private key. -## Attributes Reference +## Attribute Reference * `expiration_date` - The expiration date (RFC 3339). * `file_name` - The file name. diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_container.md b/docs/resources/container.md similarity index 96% rename from docs/resources/virtual_environment/proxmox_virtual_environment_container.md rename to docs/resources/container.md index d6272fc..ee1b530 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_container.md +++ b/docs/resources/container.md @@ -1,10 +1,10 @@ --- layout: page title: Container -permalink: /ressources/virtual-environment/container -nav_order: 2 -parent: Virtual Environment Resources -grand_parent: Resources +permalink: /resources/container +nav_order: 3 +parent: Resources +subcategory: Virtual Environment --- # Resource: Container @@ -81,7 +81,7 @@ output "ubuntu_container_public_key" { } ``` -## Arguments Reference +## Argument Reference * `clone` - (Optional) The cloning configuration. * `datastore_id` - (Optional) The identifier for the target datastore. @@ -148,6 +148,6 @@ output "ubuntu_container_public_key" { * `template` - (Optional) Whether to create a template (defaults to `false`). * `vm_id` - (Optional) The virtual machine identifier -## Attributes Reference +## Attribute Reference There are no additional attributes available for this resource. diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_dns.md b/docs/resources/dns.md similarity index 83% rename from docs/resources/virtual_environment/proxmox_virtual_environment_dns.md rename to docs/resources/dns.md index ec66adc..49bdf12 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_dns.md +++ b/docs/resources/dns.md @@ -1,10 +1,10 @@ --- layout: page title: DNS -permalink: /ressources/virtual-environment/dns -nav_order: 3 -parent: Virtual Environment Resources -grand_parent: Resources +permalink: /resources/dns +nav_order: 4 +parent: Resources +subcategory: Virtual Environment --- # Resource: DNS @@ -29,13 +29,13 @@ data "proxmox_virtual_environment_dns" "first_node_dns_configuration" { } ``` -## Arguments Reference +## Argument Reference * `domain` - (Required) The DNS search domain. * `node_name` - (Required) A node name. * `servers` - (Optional) The DNS servers. -## Attributes Reference +## Attribute Reference There are no additional attributes available for this resource. diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_file.md b/docs/resources/file.md similarity index 91% rename from docs/resources/virtual_environment/proxmox_virtual_environment_file.md rename to docs/resources/file.md index df11f12..34ea946 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_file.md +++ b/docs/resources/file.md @@ -1,10 +1,10 @@ --- layout: page title: File -permalink: /ressources/virtual-environment/file -nav_order: 4 -parent: Virtual Environment Resources -grand_parent: Resources +permalink: /resources/file +nav_order: 5 +parent: Resources +subcategory: Virtual Environment --- # Resource: File @@ -25,7 +25,7 @@ resource "proxmox_virtual_environment_file" "ubuntu_container_template" { } ``` -## Arguments Reference +## Argument Reference * `content_type` - (Optional) The content type. * `backup` @@ -44,7 +44,7 @@ resource "proxmox_virtual_environment_file" "ubuntu_container_template" { * `file_name` - (Required) The file name. * `resize` - (Optional) The number of bytes to resize the file to. -## Attributes Reference +## Attribute Reference * `file_modification_date` - The file modification date (RFC 3339). * `file_name` - The file name. diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_group.md b/docs/resources/group.md similarity index 77% rename from docs/resources/virtual_environment/proxmox_virtual_environment_group.md rename to docs/resources/group.md index e5ddfa7..1e13cf6 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_group.md +++ b/docs/resources/group.md @@ -1,10 +1,10 @@ --- layout: page title: Group -permalink: /ressources/virtual-environment/group -nav_order: 5 -parent: Virtual Environment Resources -grand_parent: Resources +permalink: /resources/group +nav_order: 6 +parent: Resources +subcategory: Virtual Environment --- # Resource: Group @@ -20,7 +20,7 @@ resource "proxmox_virtual_environment_group" "operations_team" { } ``` -## Arguments Reference +## Argument Reference * `acl` - (Optional) The access control list (multiple blocks supported). * `path` - The path. @@ -29,6 +29,6 @@ resource "proxmox_virtual_environment_group" "operations_team" { * `comment` - (Optional) The group comment. * `group_id` - (Required) The group identifier. -## Attributes Reference +## Attribute Reference * `members` - The group members as a list of `username@realm` entries diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_hosts.md b/docs/resources/hosts.md similarity index 81% rename from docs/resources/virtual_environment/proxmox_virtual_environment_hosts.md rename to docs/resources/hosts.md index 81b0c1b..e9805ef 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_hosts.md +++ b/docs/resources/hosts.md @@ -1,10 +1,10 @@ --- layout: page title: Hosts -permalink: /ressources/virtual-environment/hosts -nav_order: 6 -parent: Virtual Environment Resources -grand_parent: Resources +permalink: /resources/hosts +nav_order: 7 +parent: Resources +subcategory: Virtual Environment --- # Resource: Hosts @@ -28,14 +28,14 @@ resource "proxmox_virtual_environment_hosts" "first_node_host_entries" { } ``` -## Arguments Reference +## Argument Reference * `node_name` - (Required) A node name. * `entry` - (Required) A host entry (multiple blocks supported). * `address` - (Required) The IP address. * `hostnames` - (Required) The hostnames. -## Attributes Reference +## Attribute Reference * `addresses` - The IP addresses. * `digest` - The SHA1 digest. diff --git a/docs/resources/index.md b/docs/resources/index.html similarity index 87% rename from docs/resources/index.md rename to docs/resources/index.html index bc99992..1271607 100644 --- a/docs/resources/index.md +++ b/docs/resources/index.html @@ -2,7 +2,7 @@ layout: page title: Resources permalink: /resources -nav_order: 3 +nav_order: 2 has_children: true --- diff --git a/docs/resources/ipset.md b/docs/resources/ipset.md new file mode 100644 index 0000000..935539f --- /dev/null +++ b/docs/resources/ipset.md @@ -0,0 +1,50 @@ +--- +layout: page +title: IPSet +permalink: /ressources/ipset +nav_order: 8 +parent: Resources +subcategory: Virtual Environment +--- + +# Resource: IPSet + +An IPSet allows us to group multiple IP addresses, IP subnets and aliases. + +## Example Usage + +``` +resource "proxmox_virtual_environment_cluster_ipset" "ipset" { + name = "local_network" + comment = "Managed by Terraform" + + cidr { + name = "192.168.0.0/23" + comment = "Local network 1" + } + + cidr { + name = "192.168.0.1" + comment = "Server 1" + nomatch = true + } + + cidr { + name = "192.168.2.1" + comment = "Server 1" + } +} +``` + +## Argument Reference + +* `name` - (Required) Alias name. +* `comment` - (Optional) Alias comment. +* `cidr` - (Optional) IP/CIDR block (multiple blocks supported). + * `name` - Network/IP specification in CIDR format. + * `comment` - (Optional) Arbitrary string annotation. + * `nomatch` - (Optional) Entries marked as `nomatch` are skipped as if those were not added to the set. + +## Attribute Reference + +There are no attribute references available for this resource. diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_pool.md b/docs/resources/pool.md similarity index 76% rename from docs/resources/virtual_environment/proxmox_virtual_environment_pool.md rename to docs/resources/pool.md index 5af936f..31bbb69 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_pool.md +++ b/docs/resources/pool.md @@ -1,10 +1,10 @@ --- layout: page title: Pool -permalink: /ressources/virtual-environment/pool -nav_order: 7 -parent: Virtual Environment Resources -grand_parent: Resources +permalink: /resources/pool +nav_order: 9 +parent: Resources +subcategory: Virtual Environment --- # Resource: Pool @@ -20,12 +20,12 @@ resource "proxmox_virtual_environment_pool" "operations_pool" { } ``` -## Arguments Reference +## Argument Reference * `comment` - (Optional) The pool comment. * `pool_id` - (Required) The pool identifier. -## Attributes Reference +## Attribute Reference * `members` - The pool members. * `datastore_id` - The datastore identifier. diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_role.md b/docs/resources/role.md similarity index 70% rename from docs/resources/virtual_environment/proxmox_virtual_environment_role.md rename to docs/resources/role.md index 108f956..38bf541 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_role.md +++ b/docs/resources/role.md @@ -1,10 +1,10 @@ --- layout: page title: Role -permalink: /ressources/virtual-environment/role -nav_order: 8 -parent: Virtual Environment Resources -grand_parent: Resources +permalink: /resources/role +nav_order: 10 +parent: Resources +subcategory: Virtual Environment --- # Resource: Role @@ -23,11 +23,11 @@ resource "proxmox_virtual_environment_role" "operations_monitoring" { } ``` -## Arguments Reference +## Argument Reference * `privileges` - (Required) The role privileges. * `role_id` - (Required) The role identifier. -## Attributes Reference +## Attribute Reference There are no additional attributes available for this resource. diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_time.md b/docs/resources/time.md similarity index 71% rename from docs/resources/virtual_environment/proxmox_virtual_environment_time.md rename to docs/resources/time.md index c124386..1872063 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_time.md +++ b/docs/resources/time.md @@ -1,10 +1,10 @@ --- layout: page title: Time -permalink: /ressources/virtual-environment/time -nav_order: 9 -parent: Virtual Environment Resources -grand_parent: Resources +permalink: /resources/time +nav_order: 11 +parent: Resources +subcategory: Virtual Environment --- # Resource: Time @@ -20,12 +20,12 @@ resource "proxmox_virtual_environment_time" "first_node_time" { } ``` -## Arguments Reference +## Argument Reference * `node_name` - (Required) A node name. * `time_zone` - (Required) The node's time zone. -## Attributes Reference +## Attribute Reference * `local_time` - The node's local time. * `utc_time` - The node's local time formatted as UTC. diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_user.md b/docs/resources/user.md similarity index 88% rename from docs/resources/virtual_environment/proxmox_virtual_environment_user.md rename to docs/resources/user.md index e40dd67..e918454 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_user.md +++ b/docs/resources/user.md @@ -1,10 +1,10 @@ --- layout: page title: User -permalink: /ressources/virtual-environment/user -nav_order: 10 -parent: Virtual Environment Resources -grand_parent: Resources +permalink: /resources/user +nav_order: 12 +parent: Resources +subcategory: Virtual Environment --- # Resource: User @@ -35,7 +35,7 @@ resource "proxmox_virtual_environment_role" "operations_monitoring" { } ``` -## Arguments Reference +## Argument Reference * `acl` - (Optional) The access control list (multiple blocks supported). * `path` - The path. @@ -52,6 +52,6 @@ resource "proxmox_virtual_environment_role" "operations_monitoring" { * `password` - (Required) The user's password. * `user_id` - (Required) The user identifier. -## Attributes Reference +## Attribute Reference There are no additional attributes available for this resource. diff --git a/docs/resources/virtual_environment/index.md b/docs/resources/virtual_environment/index.md deleted file mode 100644 index e1e3495..0000000 --- a/docs/resources/virtual_environment/index.md +++ /dev/null @@ -1,10 +0,0 @@ ---- -layout: page -title: Virtual Environment Resources -permalink: /resources/virtual-environment -nav_order: 1 -parent: Resources -has_children: true ---- - -# Virtual Environment Resources diff --git a/docs/resources/virtual_environment/proxmox_virtual_environment_vm.md b/docs/resources/vm.md similarity index 92% rename from docs/resources/virtual_environment/proxmox_virtual_environment_vm.md rename to docs/resources/vm.md index 63ba31e..5b940dd 100644 --- a/docs/resources/virtual_environment/proxmox_virtual_environment_vm.md +++ b/docs/resources/vm.md @@ -1,10 +1,10 @@ --- layout: page title: VM -permalink: /ressources/virtual-environment/vm -nav_order: 11 -parent: Virtual Environment Resources -grand_parent: Resources +permalink: /resources/vm +nav_order: 13 +parent: Resources +subcategory: Virtual Environment --- # Resource: VM @@ -28,6 +28,7 @@ resource "proxmox_virtual_environment_vm" "ubuntu_vm" { disk { datastore_id = "local-lvm" file_id = "${proxmox_virtual_environment_file.ubuntu_cloud_image.id}" + interface = "scsi0" } initialization { @@ -91,7 +92,7 @@ output "ubuntu_vm_public_key" { } ``` -## Arguments Reference +## Argument Reference * `acpi` - (Optional) Whether to enable ACPI (defaults to `true`). * `agent` - (Optional) The QEMU agent configuration. @@ -118,6 +119,7 @@ output "ubuntu_vm_public_key" { * `clone` - (Optional) The cloning configuration. * `datastore_id` - (Optional) The identifier for the target datastore. * `node_name` - (Optional) The name of the source node (leave blank, if equal to the `node_name` argument). + * `retries` - (Optional) Number of retries in Proxmox for clone vm. Sometimes Proxmox errors with timeout when creating multiple clones at once. * `vm_id` - (Required) The identifier for the source VM. * `cpu` - (Optional) The CPU configuration. * `architecture` - (Optional) The CPU architecture (defaults to `x86_64`). @@ -179,6 +181,7 @@ output "ubuntu_vm_public_key" { * `raw` - Raw Disk Image. * `vmdk` - VMware Disk Image. * `file_id` - (Optional) The file ID for a disk image (experimental - might cause high CPU utilization during import, especially with large disk images). + * `interface` - (Required) The disk interface for Proxmox, currently scsi, sata and virtio are supported. * `size` - (Optional) The disk size in gigabytes (defaults to `8`). * `speed` - (Optional) The speed limits. * `read` - (Optional) The maximum read speed in megabytes per second. @@ -245,6 +248,7 @@ output "ubuntu_vm_public_key" { * `rate_limit` - (Optional) The rate limit in megabytes per second. * `vlan_id` - (Optional) The VLAN identifier. * `node_name` - (Required) The name of the node to assign the virtual machine to. +* `on_boot` - (Optional) Specifies whether a VM will be started during system boot. (defaults to `false`) * `operating_system` - (Optional) The Operating System configuration. * `type` - (Optional) The type (defaults to `other`). * `l24` - Linux Kernel 2.4. @@ -260,6 +264,7 @@ output "ubuntu_vm_public_key" { * `wvista` - Windows Vista. * `wxp` - Windows XP. * `pool_id` - (Optional) The identifier for a pool to assign the virtual machine to. +* `reboot` - (Optional) Reboot the VM after initial creation. (defaults to `false`) * `serial_device` - (Optional) A serial device (multiple blocks supported). * `device` - (Optional) The device (defaults to `socket`). * `/dev/*` - A host serial device. @@ -267,6 +272,12 @@ output "ubuntu_vm_public_key" { * `started` - (Optional) Whether to start the virtual machine (defaults to `true`). * `tablet_device` - (Optional) Whether to enable the USB tablet device (defaults to `true`). * `template` - (Optional) Whether to create a template (defaults to `false`). +* `timeout_clone` - (Optional) Timeout for cloning a VM in seconds (defaults to 1800). +* `timeout_move_disk` - (Optional) Timeout for moving the disk of a VM in seconds (defaults to 1800). +* `timeout_reboot` - (Optional) Timeout for rebooting a VM in seconds (defaults to 1800). +* `timeout_shutdown_vm` - (Optional) Timeout for shutting down a VM in seconds (defaults to 1800). +* `timeout_start_vm` - (Optional) Timeout for starting a VM in seconds (defaults to 1800). +* `timeout_stop_vm` - (Optional) Timeout for stopping a VM in seconds (defaults to 300). * `vga` - (Optional) The VGA configuration. * `enabled` - (Optional) Whether to enable the VGA device (defaults to `true`). * `memory` - (Optional) The VGA memory in megabytes (defaults to `16`). @@ -285,7 +296,7 @@ output "ubuntu_vm_public_key" { * `vmware` - VMware Compatible. * `vm_id` - (Optional) The VM identifier. -## Attributes Reference +## Attribute Reference * `ipv4_addresses` - The IPv4 addresses per network interface published by the QEMU agent (empty list when `agent.enabled` is `false`) * `ipv6_addresses` - The IPv6 addresses per network interface published by the QEMU agent (empty list when `agent.enabled` is `false`) diff --git a/example/data_source_virtual_environment_cluster_alias.tf b/example/data_source_virtual_environment_cluster_alias.tf new file mode 100644 index 0000000..946225e --- /dev/null +++ b/example/data_source_virtual_environment_cluster_alias.tf @@ -0,0 +1,7 @@ +data "proxmox_virtual_environment_cluster_alias" "example" { + name = "example" +} + +output "data_proxmox_virtual_environment_cluster_alias_example_cidr" { + value = proxmox_virtual_environment_cluster_alias.example.cidr +} diff --git a/example/data_source_virtual_environment_cluster_aliases.tf b/example/data_source_virtual_environment_cluster_aliases.tf new file mode 100644 index 0000000..f7a0308 --- /dev/null +++ b/example/data_source_virtual_environment_cluster_aliases.tf @@ -0,0 +1,9 @@ +data "proxmox_virtual_environment_cluster_aliases" "example" { + depends_on = ["proxmox_virtual_environment_cluster_alias.example"] +} + +output "data_proxmox_virtual_environment_cluster_aliases" { + value = "${map( + "alias_ids", data.proxmox_virtual_environment_cluster_aliases.example.alias_ids, + )}" +} diff --git a/example/resource_virtual_environemnt_cluster_alias.tf b/example/resource_virtual_environemnt_cluster_alias.tf new file mode 100644 index 0000000..34170be --- /dev/null +++ b/example/resource_virtual_environemnt_cluster_alias.tf @@ -0,0 +1,13 @@ +resource "proxmox_virtual_environment_cluster_alias" "example" { + name = "local_network" + cidr = "192.168.0.0/23" + comment = "Managed by Terraform" +} + +output "proxmox_virtual_environment_cluster_alias_example_name" { + value = "${proxmox_virtual_environment_cluster_alias.example.name}" +} + +output "proxmox_virtual_environment_cluster_alias_example_cidr" { + value = "${proxmox_virtual_environment_cluster_alias.example.cidr}" +} diff --git a/example/resource_virtual_environment_cluster_ipset.tf b/example/resource_virtual_environment_cluster_ipset.tf new file mode 100644 index 0000000..5d81f53 --- /dev/null +++ b/example/resource_virtual_environment_cluster_ipset.tf @@ -0,0 +1,25 @@ +resource "proxmox_virtual_environment_cluster_ipset" "example" { + name = "local_network" + comment = "Managed by Terraform" + + cidr { + name = "192.168.0.0/23" + comment = "Local network 1" + } + + cidr { + name = "192.168.0.1" + comment = "Server 1" + nomatch = true + } + + cidr { + name = "192.168.2.1" + comment = "Server 1" + } +} + +output "resource_proxmox_virtual_environment_cluster_ipset" { + value = "${proxmox_virtual_environment_cluster_ipset.example.name}" +} + diff --git a/example/resource_virtual_environment_vm.tf b/example/resource_virtual_environment_vm.tf index 0816d6e..1c99bd2 100644 --- a/example/resource_virtual_environment_vm.tf +++ b/example/resource_virtual_environment_vm.tf @@ -8,6 +8,7 @@ resource "proxmox_virtual_environment_vm" "example_template" { disk { datastore_id = "${element(data.proxmox_virtual_environment_datastores.example.datastore_ids, index(data.proxmox_virtual_environment_datastores.example.datastore_ids, "local-lvm"))}" file_id = "${proxmox_virtual_environment_file.ubuntu_cloud_image.id}" + interface = "scsi0" } initialization { diff --git a/example/versions.tf b/example/versions.tf index 45c5000..6066ec0 100644 --- a/example/versions.tf +++ b/example/versions.tf @@ -4,7 +4,7 @@ terraform { source = "hashicorp/local" } proxmox = { - source = "terraform.danitso.com/provider/proxmox" + source = "danitso/proxmox" } tls = { source = "hashicorp/tls" diff --git a/go.mod b/go.mod index 40ff9fc..84ab365 100644 --- a/go.mod +++ b/go.mod @@ -1,12 +1,41 @@ module github.com/danitso/terraform-provider-proxmox -go 1.13 +go 1.15 require ( + cloud.google.com/go v0.74.0 // indirect + cloud.google.com/go/storage v1.12.0 // indirect + github.com/agext/levenshtein v1.2.3 // indirect + github.com/apparentlymart/go-cidr v1.1.0 // indirect + github.com/aws/aws-sdk-go v1.36.19 // indirect + github.com/fatih/color v1.10.0 // indirect github.com/google/go-querystring v1.0.0 - github.com/hashicorp/terraform v0.12.23 - github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51 // indirect - github.com/pkg/sftp v1.11.0 - golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 - google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 + github.com/google/uuid v1.1.3 // indirect + github.com/hashicorp/errwrap v1.1.0 // indirect + github.com/hashicorp/go-getter v1.5.1 // indirect + github.com/hashicorp/go-hclog v0.15.0 // indirect + github.com/hashicorp/go-multierror v1.1.0 // indirect + github.com/hashicorp/go-plugin v1.4.0 // indirect + github.com/hashicorp/go-uuid v1.0.2 // indirect + github.com/hashicorp/hcl/v2 v2.8.1 // indirect + github.com/hashicorp/terraform-plugin-sdk v1.16.0 + github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 // indirect + github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce // indirect + github.com/mitchellh/cli v1.1.2 // indirect + github.com/mitchellh/go-testing-interface v1.14.1 // indirect + github.com/mitchellh/go-wordwrap v1.0.1 // indirect + github.com/mitchellh/mapstructure v1.4.0 // indirect + github.com/oklog/run v1.1.0 // indirect + github.com/pkg/sftp v1.12.0 + github.com/posener/complete v1.2.3 // indirect + github.com/spf13/afero v1.5.1 // indirect + github.com/ulikunitz/xz v0.5.9 // indirect + github.com/vmihailenco/tagparser v0.1.2 // indirect + github.com/zclconf/go-cty v1.7.1 // indirect + github.com/zclconf/go-cty-yaml v1.0.2 // indirect + golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad + golang.org/x/net v0.0.0-20201224014010-6772e930b67b // indirect + golang.org/x/sys v0.0.0-20201231184435-2d18734c6014 // indirect + golang.org/x/tools v0.0.0-20210102185154-773b96fafca2 // indirect + google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d // indirect ) diff --git a/go.sum b/go.sum index e94fd28..aa3a658 100644 --- a/go.sum +++ b/go.sum @@ -5,345 +5,465 @@ cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6A cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= cloud.google.com/go v0.45.1 h1:lRi0CHyU+ytlvylOlFKKq0af6JncuyoRh1J+QJBqQx0= cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.61.0/go.mod h1:XukKJg4Y7QsUu0Hxg3qQKUWR4VuWivmyMK2+rUyxAqw= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.66.0/go.mod h1:dgqGAjKCDxyhGTtC9dAREQGUJpkceNm1yt590Qno0Ko= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0 h1:kpgPA77kSSbjSs+fWHkPTxQ6J5Z2Qkruo5jfXEkHxNQ= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= -github.com/Azure/azure-sdk-for-go v35.0.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/azure-sdk-for-go v36.2.0+incompatible/go.mod h1:9XXNKU+eRnpl9moKnB4QOLf1HestfXbmab5FXxiDBjc= -github.com/Azure/go-autorest/autorest v0.9.0/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest v0.9.2/go.mod h1:xyHB1BMZT0cuDHU7I0+g046+BFDTQ8rEZB0s4Yfa6bI= -github.com/Azure/go-autorest/autorest/adal v0.5.0/go.mod h1:8Z9fGy2MpX0PvDjB1pEgQTmVqjGhiHBW7RJJEciWzS0= -github.com/Azure/go-autorest/autorest/adal v0.8.1-0.20191028180845-3492b2aff503/go.mod h1:Z6vX6WXXuyieHAXwMj0S6HY6e6wcHn37qQMBQlvY3lc= -github.com/Azure/go-autorest/autorest/azure/cli v0.2.0/go.mod h1:WWTbGPvkAg3I4ms2j2s+Zr5xCGwGqTQh+6M2ZqOczkE= -github.com/Azure/go-autorest/autorest/date v0.1.0/go.mod h1:plvfp3oPSKwf2DNjlBjWF/7vwR+cUD/ELuzDCXwHUVA= -github.com/Azure/go-autorest/autorest/date v0.2.0/go.mod h1:vcORJHLJEh643/Ioh9+vPmf1Ij9AEBM5FuBIXLmIy0g= -github.com/Azure/go-autorest/autorest/mocks v0.1.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.2.0/go.mod h1:OTyCOPRA2IgIlWxVYxBee2F5Gr4kF2zd2J5cFRaIDN0= -github.com/Azure/go-autorest/autorest/mocks v0.3.0/go.mod h1:a8FDP3DYzQ4RYfVAxAN3SVSiiO77gL2j2ronKKP0syM= -github.com/Azure/go-autorest/autorest/to v0.3.0/go.mod h1:MgwOyqaIuKdG4TL/2ywSsIWKAfJfgHDo8ObuUk3t5sA= -github.com/Azure/go-autorest/autorest/validation v0.2.0/go.mod h1:3EEqHnBxQGHXRYq3HT1WyXAvT7LLY3tl70hw6tQIbjI= -github.com/Azure/go-autorest/logger v0.1.0/go.mod h1:oExouG+K6PryycPJfVSxi/koC6LSNgds39diKLz7Vrc= -github.com/Azure/go-autorest/tracing v0.5.0/go.mod h1:r/s2XiOKccPW3HrqB+W0TQzfbtp2fGCgRFtBroKn4Dk= -github.com/Azure/go-ntlmssp v0.0.0-20180810175552-4a21cbd618b4/go.mod h1:chxPXzSsl7ZWRAuOIE23GDNzjWuZquvFlgA8xmpunjU= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0 h1:STgFzyU5/8miMl0//zKh2aQeTyeaUH3WN9bSUiJ09bA= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +cloud.google.com/go/storage v1.12.0 h1:4y3gHptW1EHVtcPAVE0eBBlFuGqEejTTG3KdIE0lUX4= +cloud.google.com/go/storage v1.12.0/go.mod h1:fFLk2dp2oAhDz8QFKwqrjdJvxSp/W2g7nillojlL5Ho= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= -github.com/ChrisTrenkamp/goxpath v0.0.0-20170922090931-c385f95c6022/go.mod h1:nuWgzSkT5PnyOd+272uUmV0dnAnAn42Mk7PiQC5VzN4= -github.com/QcloudApi/qcloud_sign_golang v0.0.0-20141224014652-e4130a326409/go.mod h1:1pk82RBxDY/JZnPQrtqHlUFfCctgdorsd9M06fMynOM= -github.com/Unknwon/com v0.0.0-20151008135407-28b053d5a292/go.mod h1:KYCjqMOeHpNuTOiFQU6WEcTG7poCJrUs0YgyHNtn1no= -github.com/abdullin/seq v0.0.0-20160510034733-d5467c17e7af/go.mod h1:5Jv4cbFiHJMsVxt52+i0Ha45fjshj6wxYr1r19tB9bw= +github.com/Masterminds/goutils v1.1.0 h1:zukEsf/1JZwCMgHiK3GZftabmxiCw4apj3a28RPBiVg= +github.com/Masterminds/goutils v1.1.0/go.mod h1:8cTjp+g8YejhMuvIA5y2vz3BpJxksy863GQaJW2MFNU= +github.com/Masterminds/semver v1.5.0 h1:H65muMkzWKEuNDnfl9d70GUjFniHKHRbFPGBuZ3QEww= +github.com/Masterminds/semver v1.5.0/go.mod h1:MB6lktGJrhw8PrUyiEoblNEGEQ+RzHPF078ddwwvV3Y= +github.com/Masterminds/sprig v2.22.0+incompatible h1:z4yfnGrZ7netVz+0EDJ0Wi+5VZCSYp4Z0m2dk6cEM60= +github.com/Masterminds/sprig v2.22.0+incompatible/go.mod h1:y6hNFY5UBTIWBxnzTeuNhlNS5hqE0NB0E6fgfo2Br3o= github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= github.com/agext/levenshtein v1.2.2 h1:0S/Yg6LYmFJ5stwQeRp6EeOcCbj7xiqQSdNelsXvaqE= github.com/agext/levenshtein v1.2.2/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= -github.com/agl/ed25519 v0.0.0-20150830182803-278e1ec8e8a6/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= -github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc= -github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0= -github.com/aliyun/alibaba-cloud-sdk-go v0.0.0-20190329064014-6e358769c32a/go.mod h1:T9M45xf79ahXVelWoOBmH0y4aC1t5kXO5BxwyakgIGA= -github.com/aliyun/aliyun-oss-go-sdk v0.0.0-20190103054945-8205d1f41e70/go.mod h1:T/Aws4fEfogEE9v+HPhhw+CntffsBHJ8nXQCwKr0/g8= -github.com/aliyun/aliyun-tablestore-go-sdk v4.1.2+incompatible/go.mod h1:LDQHRZylxvcg8H7wBIDfvO5g/cy4/sz1iucBlc2l3Jw= -github.com/antchfx/xpath v0.0.0-20190129040759-c8489ed3251e/go.mod h1:Yee4kTMuNiPYJ7nSNorELQMr1J33uOpXDMByNYhvtNk= -github.com/antchfx/xquery v0.0.0-20180515051857-ad5b8c7a47b0/go.mod h1:LzD22aAzDP8/dyiCKFp31He4m2GPjl0AFyzDtZzUu9M= +github.com/agext/levenshtein v1.2.3 h1:YB2fHEn0UJagG8T1rrWknE3ZQzWM06O8AMAatNn7lmo= +github.com/agext/levenshtein v1.2.3/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558= +github.com/agl/ed25519 v0.0.0-20170116200512-5312a6153412/go.mod h1:WPjqKcmVOxf0XSf3YxCJs6N6AOSrOx3obionmG7T0y0= +github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= +github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239/go.mod h1:2FmKhYUyUczH0OGQWaF5ceTx0UBShxjsH6f8oGKYe2c= github.com/apparentlymart/go-cidr v1.0.1 h1:NmIwLZ/KdsjIUlhf+/Np40atNXm/+lZ5txfTJ/SpF+U= github.com/apparentlymart/go-cidr v1.0.1/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= +github.com/apparentlymart/go-cidr v1.1.0 h1:2mAhrMoF+nhXqxTzSZMUzDHkLjmIHC+Zzn4tdgBZjnU= +github.com/apparentlymart/go-cidr v1.1.0/go.mod h1:EBcsNrHc3zQeuaeCeCtQruQm+n9/YjEn/vI25Lg7Gwc= github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= +github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0 h1:MzVXffFUye+ZcSR6opIgz9Co7WcDx6ZcY+RjfFHoA0I= github.com/apparentlymart/go-dump v0.0.0-20190214190832-042adf3cf4a0/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM= github.com/apparentlymart/go-textseg v1.0.0 h1:rRmlIsPEEhUTIKQb7T++Nz/A5Q6C9IuX2wFoYVvnCs0= github.com/apparentlymart/go-textseg v1.0.0/go.mod h1:z96Txxhf3xSFMPmb5X/1W05FF/Nj9VFpLOpjS5yuumk= -github.com/apparentlymart/go-versions v0.0.2-0.20180815153302-64b99f7cb171/go.mod h1:JXY95WvQrPJQtudvNARshgWajS7jNNlM90altXIPNyI= -github.com/armon/circbuf v0.0.0-20190214190532-5111143e8da2/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= -github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/apparentlymart/go-textseg/v12 v12.0.0 h1:bNEQyAGak9tojivJNkoqWErVCQbjdL7GzRt3F8NvfJ0= +github.com/apparentlymart/go-textseg/v12 v12.0.0/go.mod h1:S/4uRK2UtaQttw1GenVJEynmyUenKwP++x/+DdGV/Ec= github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= github.com/armon/go-radix v1.0.0 h1:F4z6KzEeeQIMeLFa97iZU6vupzoecKdU5TX24SNppXI= github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-socks5 v0.0.0-20160902184237-e75332964ef5/go.mod h1:wHh0iHkYZB8zMSxRWpUBQtwG5a7fFgvEO+odwuTv2gs= github.com/aws/aws-sdk-go v1.15.78/go.mod h1:E3/ieXAlvM0XWO57iftYVDLLvQ824smPP3ATZkfNZeM= github.com/aws/aws-sdk-go v1.25.3 h1:uM16hIw9BotjZKMZlX05SN2EFtaWfi/NonPKIARiBLQ= github.com/aws/aws-sdk-go v1.25.3/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo= -github.com/baiyubin/aliyun-sts-go-sdk v0.0.0-20180326062324-cfa1a18b161f/go.mod h1:AuiFmCCPBSrqvVMvuqFuk0qogytodnVFVSN5CeJB8Gc= -github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/aws/aws-sdk-go v1.36.19 h1:zbJZKkxeDiYxUYFjymjWxPye+qa1G2gRVyhIzZrB9zA= +github.com/aws/aws-sdk-go v1.36.19/go.mod h1:hcU610XS61/+aQV88ixoOzUoG7v3b31pl2zKMmprdro= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d h1:xDfNPAt8lFiC1UJrqV3uuy861HCTo708pDMbjHHdCas= github.com/bgentry/go-netrc v0.0.0-20140422174119-9fd32a8b3d3d/go.mod h1:6QX/PXZ00z/TKoufEY6K/a0k6AhaJrQKdFe6OfVXsa4= github.com/bgentry/speakeasy v0.1.0 h1:ByYyxL9InA1OWqxJqqp2A5pYHUrCiAL6K3J+LKSsQkY= github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= -github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= -github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= -github.com/bmatcuk/doublestar v1.1.5 h1:2bNwBOmhyFEFcoB3tGvTD5xanq+4kyOZlB8wFYbMjkk= -github.com/bmatcuk/doublestar v1.1.5/go.mod h1:wiQtGV+rzVYxB7WIlirSN++5HPtPlXEo9MEoZQC/PmE= -github.com/boltdb/bolt v1.3.1/go.mod h1:clJnj/oiGkjum5o1McbSZDSLxVThjynRyGBgiAx27Ps= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= github.com/cheggaaa/pb v1.0.27/go.mod h1:pQciLPpbU0oxA0h+VJYYLxO+XeDQb5pZijXscXHm81s= github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= -github.com/coreos/bbolt v1.3.0/go.mod h1:iRUV2dpdMOn7Bo10OQBFzIJO9kkE559Wcmn+qkEiiKk= -github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= -github.com/coreos/go-semver v0.2.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= -github.com/coreos/go-systemd v0.0.0-20181012123002-c6f51f82210d/go.mod h1:F5haX7vjVVG0kc13fIWeqUViNPyEJxv/OmvnBo0Yme4= -github.com/coreos/pkg v0.0.0-20180928190104-399ea9e2e55f/go.mod h1:E3G3o1h8I7cfcXa63jLwjI0eiQQMgzzUDFVpN/nH/eA= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dimchansky/utfbom v1.1.0/go.mod h1:rO41eb7gLfo8SF1jd9F8HplJm1Fewwi4mQvIirEdv+8= -github.com/dnaeon/go-vcr v0.0.0-20180920040454-5637cf3d8a31/go.mod h1:aBB1+wY4s93YsC3HHjMBMrwTj2R9FHDzUr9KyGc8n1E= -github.com/dylanmei/iso8601 v0.1.0/go.mod h1:w9KhXSgIyROl1DefbMYIE7UVSIvELTbMrCfx+QkYnoQ= -github.com/dylanmei/winrmtest v0.0.0-20190225150635-99b7fe2fddf1/go.mod h1:lcy9/2gH1jn/VCLouHA6tOEwLoNVd4GW6zhuKLmHC2Y= +github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= github.com/fatih/color v1.7.0 h1:DkWD4oS2D8LGGgTQ6IvwJJXSL5Vp2ffcQg58nFV38Ys= github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= -github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= -github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= -github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= -github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= -github.com/go-test/deep v1.0.1/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= +github.com/fatih/color v1.10.0 h1:s36xzo75JdqLaaWoiEHk767eHiwo0598uUxyfiPkDsg= +github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/flynn/go-shlex v0.0.0-20150515145356-3f9db97f8568/go.mod h1:xEzjJPgXI435gkrCt3MPfRiAkVrwSbHsst4LCFVfpJc= +github.com/gliderlabs/ssh v0.2.2/go.mod h1:U7qILu1NlMHj9FlMhZLlkCdDnU1DBEAqr0aevW3Awn0= +github.com/go-git/gcfg v1.5.0/go.mod h1:5m20vg6GwYabIxaOonVkTdrILxQMpEShl1xiMF4ua+E= +github.com/go-git/go-billy/v5 v5.0.0/go.mod h1:pmpqyWchKfYfrkb/UVH4otLvyi/5gJlGI4Hb3ZqZ3W0= +github.com/go-git/go-git-fixtures/v4 v4.0.1/go.mod h1:m+ICp2rF3jDhFgEZ/8yziagdT1C+ZpZcrJjappBCDSw= +github.com/go-git/go-git/v5 v5.1.0/go.mod h1:ZKfuPUoY1ZqIG4QG9BDBh3G4gLM5zvPuSJAozQrZuyM= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68= github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= -github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= -github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= -github.com/golang/groupcache v0.0.0-20180513044358-24b0969c4cb7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1 h1:qGJ6qTW+x6xX/my+8YUVl4WNpX9B7+/l2tRsHGZ7f2s= github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4 h1:l75CXGRSwbaYNpl/Z2X1XIIAMSCquvXgpVZDhwEIJsc= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= github.com/golang/protobuf v1.1.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= -github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4 h1:87PNWwrRvUSnqS4dlcBU/ftvOIBep4sYuBLlh6rX2wk= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3 h1:JjCZWpVbqXDqFVmTfYWEVTMIYrL/NPdPSCHPJ0T/raM= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4 h1:L8R9j+yAqZuZjsqh/z+F1NCffTKKLShY6zXTItVIZ8M= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-querystring v1.0.0 h1:Xkwi/a1rcvNg1PPYe5vI8GbeBY/jrVuDX5ASuANWTrk= github.com/google/go-querystring v1.0.0/go.mod h1:odCYkC5MyYFN7vkCjXpyrEuKhc/BUO6wN/zVPAxq5ck= +github.com/google/martian v2.1.0+incompatible h1:/CP5g8u/VJHijgedC/Legn3BAbAaWPgecwXBIDzw5no= github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0 h1:wCKgOCHuUEVfsaQLpPSJb7VdYCdTVZQAuOdYm1yc/60= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200905233945-acf8798be1f7/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.1.1 h1:Gkbcsh/GbpXz7lPftLA3P6TYMwjCLYm83jiFQZF/3gY= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.1.3 h1:twObb+9XcuH5B9V1TBCvvvZoO6iEdILi2a76PYn5rJI= +github.com/google/uuid v1.1.3/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= github.com/googleapis/gax-go/v2 v2.0.5 h1:sjZBwGj9Jlw33ImPtvFviGYvseOtDM7hkSKB7+Tv3SM= github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= -github.com/gophercloud/gophercloud v0.0.0-20190208042652-bc37892e1968/go.mod h1:3WdhXV3rUYy9p6AUW8d94kr+HS62Y4VL9mBnFxsD8q4= -github.com/gophercloud/utils v0.0.0-20190128072930-fbb6ab446f01/go.mod h1:wjDF8z83zTeg5eMLml5EBSlAhbF7G8DobyI1YsMuyzw= -github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= -github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ= -github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs= -github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk= -github.com/grpc-ecosystem/grpc-gateway v1.8.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY= -github.com/hashicorp/aws-sdk-go-base v0.4.0/go.mod h1:eRhlz3c4nhqxFZJAahJEFL7gh6Jyj5rQmQc7F9eHFyQ= -github.com/hashicorp/consul v0.0.0-20171026175957-610f3c86a089/go.mod h1:mFrjN1mfidgJfYP1xrJCF+AfRhr6Eaqhb2+sfyn/OOI= github.com/hashicorp/errwrap v1.0.0 h1:hLrqtEDnRye3+sgx6z4qVLNuviH3MR5aQ0ykNJa/UYA= github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= -github.com/hashicorp/go-azure-helpers v0.10.0/go.mod h1:YuAtHxm2v74s+IjQwUG88dHBJPd5jL+cXr5BGVzSKhE= +github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I= +github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= github.com/hashicorp/go-checkpoint v0.5.0/go.mod h1:7nfLNL10NsxqO4iWuW6tWW0HjZuDrwkBuEQsVcpCOgg= github.com/hashicorp/go-cleanhttp v0.5.0/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM= github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= -github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02 h1:l1KB3bHVdvegcIf5upQ5mjcHjs2qsWnKh4Yr9xgIuu8= +github.com/hashicorp/go-getter v1.4.0 h1:ENHNi8494porjD0ZhIrjlAHnveSFhY7hvOJrV/fsKkw= +github.com/hashicorp/go-getter v1.4.0/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= github.com/hashicorp/go-getter v1.4.2-0.20200106182914-9813cbd4eb02/go.mod h1:7qxyCd8rBfcShwsvxgIguu4KbS3l8bUCwg2Umn7RjeY= +github.com/hashicorp/go-getter v1.5.1 h1:lM9sM02nvEApQGFgkXxWbhfqtyN+AyhQmi+MaMdBDOI= +github.com/hashicorp/go-getter v1.5.1/go.mod h1:a7z7NPPfNQpJWcn4rSWFtdrSldqLdLPEF3d8nFMsSLM= github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd/go.mod h1:9bjs9uLqI8l75knNv3lV1kA55veR+WUPSiKIWcQHudI= -github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f h1:Yv9YzBlAETjy6AOX9eLBZ3nshNVRREgerT/3nvxlGho= -github.com/hashicorp/go-hclog v0.0.0-20181001195459-61d530d6c27f/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= -github.com/hashicorp/go-immutable-radix v0.0.0-20180129170900-7f3cd4390caa/go.mod h1:6ij3Z20p+OhOkCSrA0gImAWoHYQRGbnlcuk6XYTiaRw= -github.com/hashicorp/go-msgpack v0.5.4/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI= +github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= +github.com/hashicorp/go-hclog v0.14.1/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-hclog v0.15.0 h1:qMuK0wxsoW4D0ddCCYwPSTm4KQv1X1ke3WmPWZ0Mvsk= +github.com/hashicorp/go-hclog v0.15.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-multierror v1.0.0 h1:iVjPR7a6H0tWELX5NxNe7bYopibicUzc7uPribsnS6o= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= -github.com/hashicorp/go-plugin v1.0.1-0.20190610192547-a1bc61569a26 h1:hRho44SAoNu1CBtn5r8Q9J3rCs4ZverWZ4R+UeeNuWM= -github.com/hashicorp/go-plugin v1.0.1-0.20190610192547-a1bc61569a26/go.mod h1:++UyYGoz3o5w9ZzAdZxtQKrWWP+iqPBn3cQptSMzBuY= -github.com/hashicorp/go-retryablehttp v0.5.2 h1:AoISa4P4IsW0/m4T6St8Yw38gTl5GtBAgfkhYh1xAz4= -github.com/hashicorp/go-retryablehttp v0.5.2/go.mod h1:9B5zBasrRhHXnJnui7y6sL7es7NDiJgTc6Er0maI1Xs= -github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-multierror v1.1.0 h1:B9UzwGQJehnUY1yNrnwREHc3fGbC2xefo8g4TbElacI= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-plugin v1.3.0/go.mod h1:F9eH4LrE/ZsRdbwhfjs9k9HoDUwAHnYtXdgmf1AVNs0= +github.com/hashicorp/go-plugin v1.4.0 h1:b0O7rs5uiJ99Iu9HugEzsM67afboErkHUWddUSpUO3A= +github.com/hashicorp/go-plugin v1.4.0/go.mod h1:5fGEH17QVwTTcR0zV7yhDPLLmFX9YSZ38b18Udy6vYQ= github.com/hashicorp/go-safetemp v1.0.0 h1:2HR189eFNrjHQyENnQMMpCiBAsRxzbTMIgBhEyExpmo= github.com/hashicorp/go-safetemp v1.0.0/go.mod h1:oaerMy3BhqiTbVye6QuFhFtIceqFoDHxNAB65b+Rj1I= -github.com/hashicorp/go-slug v0.4.1/go.mod h1:I5tq5Lv0E2xcNXNkmx7BSfzi1PsJ2cNjs3cC3LwyhK8= -github.com/hashicorp/go-sockaddr v0.0.0-20180320115054-6d291a969b86/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= -github.com/hashicorp/go-tfe v0.3.27/go.mod h1:DVPSW2ogH+M9W1/i50ASgMht8cHP7NxxK0nrY9aFikQ= github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-uuid v1.0.1 h1:fv1ep09latC32wFoVwnqcnKJGnMSdBanPczbHAYm1BE= github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.2 h1:cfejS+Tpcp13yd5nYHWDI6qVCny6wyX2Mt5SGur2IGE= +github.com/hashicorp/go-uuid v1.0.2/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= github.com/hashicorp/go-version v1.1.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/go-version v1.2.0 h1:3vNe/fWF5CBgRIguda1meWhsZHy3m8gCJ5wx+dIzX/E= github.com/hashicorp/go-version v1.2.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= +github.com/hashicorp/go-version v1.2.1 h1:zEfKbn2+PDgroKdiOzqiE8rsmLqU2uwi5PB5pBJ3TkI= +github.com/hashicorp/go-version v1.2.1/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA= github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/golang-lru v0.5.1 h1:0hERBMJE1eitiLkihrMvRVBYAkpHzc/J3QdDN+dAcgU= github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f h1:UdxlrJz4JOnY8W+DbLISwf2B8WXEolNRA8BGCwI9jws= github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= +github.com/hashicorp/hcl/v2 v2.0.0 h1:efQznTz+ydmQXq3BOnRa3AXzvCeTq1P4dKj/z5GLlY8= github.com/hashicorp/hcl/v2 v2.0.0/go.mod h1:oVVDG71tEinNGYCxinCYadcmKU9bglqW9pV3txagJ90= -github.com/hashicorp/hcl/v2 v2.3.0 h1:iRly8YaMwTBAKhn1Ybk7VSdzbnopghktCD031P8ggUE= github.com/hashicorp/hcl/v2 v2.3.0/go.mod h1:d+FwDBbOLvpAM3Z6J7gPj/VoAGkNe/gm352ZhjJ/Zv8= -github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590 h1:2yzhWGdgQUWZUCNK+AoO35V+HTsgEmcM4J9IkArh7PI= -github.com/hashicorp/hil v0.0.0-20190212112733-ab17b08d6590/go.mod h1:n2TSygSNwsLJ76m8qFXTSc7beTb+auJxYdqrnoqwZWE= -github.com/hashicorp/memberlist v0.1.0/go.mod h1:ncdBp14cuox2iFOq3kDiquKU6fqsTBc3W6JvZwjxxsE= -github.com/hashicorp/serf v0.0.0-20160124182025-e4ec8cc423bb/go.mod h1:h/Ru6tmZazX7WO/GDmwdpS975F019L4t5ng5IgwbNrE= -github.com/hashicorp/terraform v0.12.23 h1:3fTWHq6JkHk4VJ8Z6A+8MvvAVtlSXbXViPJSWLuSNAk= -github.com/hashicorp/terraform v0.12.23/go.mod h1:eJcloDEx5ywM4a1tetIuVrlqklM0bUVRYJBYAh4CYzA= -github.com/hashicorp/terraform-config-inspect v0.0.0-20191212124732-c6ae6269b9d7/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= +github.com/hashicorp/hcl/v2 v2.8.1 h1:FJ60CIYaMyJOKzPndhMyjiz353Fd+2jr6PodF5Xzb08= +github.com/hashicorp/hcl/v2 v2.8.1/go.mod h1:bQTN5mpo+jewjJgh8jr0JUguIi7qPHUF6yIfAEN3jqY= +github.com/hashicorp/logutils v1.0.0 h1:dLEQVugN8vlakKOUE3ihGLTZJRB4j+M2cdTm/ORI65Y= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8 h1:+RyjwU+Gnd/aTJBPZVDNm903eXVjjqhbaR4Ypx3xYyY= +github.com/hashicorp/terraform-config-inspect v0.0.0-20191115094559-17f92b0546e8/go.mod h1:p+ivJws3dpqbp1iP84+npOyAmTTOLMgCzrXd3GSdn/A= +github.com/hashicorp/terraform-exec v0.10.0/go.mod h1:tOT8j1J8rP05bZBGWXfMyU3HkLi1LWyqL3Bzsc3CJjo= +github.com/hashicorp/terraform-json v0.5.0/go.mod h1:eAbqb4w0pSlRmdvl8fOyHAi/+8jnkVYN28gJkSJrLhU= +github.com/hashicorp/terraform-plugin-sdk v1.16.0 h1:NrkXMRjHErUPPTHQkZ6JIn6bByiJzGnlJzH1rVdNEuE= +github.com/hashicorp/terraform-plugin-sdk v1.16.0/go.mod h1:5sVxrwW6/xzFhZyql+Q9zXCUEJaGWcBIxBbZFLpVXOI= +github.com/hashicorp/terraform-plugin-test/v2 v2.1.2/go.mod h1:jerO5mrd+jVNALy8aiq+VZOg/CR8T2T1QR3jd6JKGOI= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596 h1:hjyO2JsNZUKT1ym+FAdlBEkGPevazYsmVgIMw7dVELg= github.com/hashicorp/terraform-svchost v0.0.0-20191011084731-65d371908596/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= -github.com/hashicorp/vault v0.10.4/go.mod h1:KfSyffbKxoVyspOdlaGVjIuwLobi07qD1bAbosPMpP0= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734 h1:HKLsbzeOsfXmKNpr3GiT18XAblV0BjCbzL8KQAMZGa0= +github.com/hashicorp/terraform-svchost v0.0.0-20200729002733-f050f53b9734/go.mod h1:kNDNcF7sN4DocDLBkQYz73HGKwN1ANB1blq4lIYLYvg= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb h1:b5rjCoWHc7eqmAS4/qyk21ZsHyb6Mxv/jykxvNTkU4M= github.com/hashicorp/yamux v0.0.0-20180604194846-3520598351bb/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d h1:kJCB4vdITiW1eC1vq2e6IsrXKrZit1bv/TDYFGMp4BQ= +github.com/hashicorp/yamux v0.0.0-20181012175058-2f1d1f20f75d/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce h1:7UnVY3T/ZnHUrfviiAgIUjg2PXxsQfs5bphsG8F7Keo= +github.com/hashicorp/yamux v0.0.0-20200609203250-aecfd211c9ce/go.mod h1:+NfK9FKeTrX5uv1uIXGdwYDTeHna2qgaIlx54MXqjAM= +github.com/huandu/xstrings v1.3.2 h1:L18LIDzqlW6xN2rEkpdV8+oL/IXWJ1APd+vsdYy4Wdw= +github.com/huandu/xstrings v1.3.2/go.mod h1:y5/lhBue+AyNmUVz9RLU9xbLR0o4KIIExikq4ovT0aE= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/imdario/mergo v0.3.9/go.mod h1:2EnlNZ0deacrJVfApfmtdGgDfMuh/nq6Ok1EcJh5FfA= +github.com/imdario/mergo v0.3.11 h1:3tnifQM4i+fbajXKBHXWEH+KvNHqojZ778UH75j3bGA= +github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= +github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= +github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jhump/protoreflect v1.6.0 h1:h5jfMVslIg6l29nsMs0D8Wj17RDVdNYti0vDN/PZZoE= +github.com/jhump/protoreflect v1.6.0/go.mod h1:eaTn3RZAmMBcV0fifFvlm6VHNz3wSkYyXYWUh7ymB74= github.com/jmespath/go-jmespath v0.0.0-20160202185014-0b12d6b521d8/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af h1:pmfjZENx5imkbgOkpRUYLnmbU7UEFbjtDA2hxJ1ichM= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= -github.com/jonboulle/clockwork v0.1.0/go.mod h1:Ii8DK3G1RaLaWxj9trq07+26W01tbo22gdxWY5EU2bo= -github.com/joyent/triton-go v0.0.0-20180313100802-d8f9c0314926/go.mod h1:U+RSyWxWd04xTqnuOQxnai7XGS2PrPY2cfGoDKtMHjA= -github.com/json-iterator/go v1.1.5/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU= +github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= -github.com/jtolds/gls v4.2.1+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= -github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w= -github.com/kardianos/osext v0.0.0-20190222173326-2bc1f35cddc0/go.mod h1:1NbS8ALrpOvjt0rHPNLyCIeMtbizbir8U//inJ+zuB8= -github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51/go.mod h1:CzGEWj7cYgsdH8dAjBGEr58BoE7ScuLd+fwFZ44+/x8= +github.com/jstemmer/go-junit-report v0.9.1 h1:6QPYqodiu3GuPL+7mfx+NwDdp2eTkp9IfEUpgAwUN0o= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd/go.mod h1:CT57kijsi8u/K/BOFA39wgDQJ9CxiF4nAY/ojJ6r6mM= github.com/keybase/go-crypto v0.0.0-20161004153544-93f5b35093ba/go.mod h1:ghbZscTyKdM07+Fw3KSi0hcJm+AlEUWj8QLlPtijN/M= -github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= github.com/kr/fs v0.1.0 h1:Jskdu9ieNAYnjxsi0LbQp1ulIKZV1LAFgK1tWhpZgl8= github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= -github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k= +github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc= github.com/kylelemons/godebug v1.1.0/go.mod h1:9/0rRGxNHcop5bhtWyNeEfOS8JIWk580+fNqagV/RAw= -github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo= -github.com/likexian/gokit v0.0.0-20190309162924-0a377eecf7aa/go.mod h1:QdfYv6y6qPA9pbBA2qXtoT8BMKha6UyNbxWGWl/9Jfk= -github.com/likexian/gokit v0.0.0-20190418170008-ace88ad0983b/go.mod h1:KKqSnk/VVSW8kEyO2vVCXoanzEutKdlBAPohmGXkxCk= -github.com/likexian/gokit v0.0.0-20190501133040-e77ea8b19cdc/go.mod h1:3kvONayqCaj+UgrRZGpgfXzHdMYCAO0KAt4/8n0L57Y= -github.com/likexian/gokit v0.20.15/go.mod h1:kn+nTv3tqh6yhor9BC4Lfiu58SmH8NmQ2PmEl+uM6nU= -github.com/likexian/simplejson-go v0.0.0-20190409170913-40473a74d76d/go.mod h1:Typ1BfnATYtZ/+/shXfFYLrovhFyuKvzwrdOnIDHlmg= -github.com/likexian/simplejson-go v0.0.0-20190419151922-c1f9f0b4f084/go.mod h1:U4O1vIJvIKwbMZKUJ62lppfdvkCdVd2nfMimHK81eec= -github.com/likexian/simplejson-go v0.0.0-20190502021454-d8787b4bfa0b/go.mod h1:3BWwtmKP9cXWwYCr5bkoVDEfLywacOv0s06OBEDpyt8= -github.com/lusis/go-artifactory v0.0.0-20160115162124-7e4ce345df82/go.mod h1:y54tfGmO3NKssKveTEFFzH8C/akrSOy/iW9qEAUDV84= -github.com/masterzen/simplexml v0.0.0-20160608183007-4572e39b1ab9/go.mod h1:kCEbxUJlNDEBNbdQMkPSp6yaKcRXVI6f4ddk8Riv4bc= -github.com/masterzen/winrm v0.0.0-20190223112901-5e5c9a7fe54b/go.mod h1:wr1VqkwW0AB5JS0QLy5GpVMS9E3VtRoSYXUYyVk46KY= github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= github.com/mattn/go-colorable v0.1.1 h1:G1f5SKeVxmagw/IyvzvtZE4Gybcc4Tr1tf7I8z0XgOg= github.com/mattn/go-colorable v0.1.1/go.mod h1:FuOcm+DKB9mbwrcAfNl7/TZVBZ6rcnceauSikq3lYCQ= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.8 h1:c1ghPdyEDarC70ftn0y+A/Ee++9zz8ljHG1b13eJ0s8= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.4/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= github.com/mattn/go-isatty v0.0.5 h1:tHXDdz1cpzGaovsTB+TVB8q90WEokoVmfMqoVcrLUgw= github.com/mattn/go-isatty v0.0.5/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.12 h1:wuysRhFDzyxgEmMf5xjvJ2M9dZoWAXNNr5LSBS7uHXY= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= github.com/mattn/go-runewidth v0.0.4/go.mod h1:LwmH8dsx7+W8Uxz3IHJYH5QSwggIsqBzpuz5H//U1FU= -github.com/mattn/go-shellwords v1.0.4/go.mod h1:3xCvwCdWdlDJUrvuMn7Wuy9eWs4pE8vqg+NOMyg4B2o= -github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= -github.com/miekg/dns v1.0.8/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= -github.com/mitchellh/cli v1.0.0 h1:iGBIsUe3+HZ/AD/Vd7DErOt5sU9fa8Uj7A2s1aggv1Y= -github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.1/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/cli v1.1.2 h1:PvH+lL2B7IQ101xQL63Of8yFS2y+aDlsFcsqNc+u/Kw= +github.com/mitchellh/cli v1.1.2/go.mod h1:6iaV0fGdElS6dPBx0EApTxHrcWvmJphyh2n8YBLPPZ4= github.com/mitchellh/colorstring v0.0.0-20190213212951-d06e56a500db/go.mod h1:l0dey0ia/Uv7NcFFVbCLtqEBQbrT4OCwCSKTEv6enCw= github.com/mitchellh/copystructure v1.0.0 h1:Laisrj+bAB6b/yJwB5Bt3ITZhGJdqmxquMKeZ+mmkFQ= github.com/mitchellh/copystructure v1.0.0/go.mod h1:SNtv71yrdKgLRyLFxmLdkAbkKEFWgYaq1OVrnRcwhnw= github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= -github.com/mitchellh/go-linereader v0.0.0-20190213213312-1b945b3263eb/go.mod h1:OaY7UOoTkkrX3wRwjpYRKafIkkyeD0UtweSHAWWiqQM= github.com/mitchellh/go-testing-interface v0.0.0-20171004221916-a61a99592b77/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= github.com/mitchellh/go-testing-interface v1.0.0 h1:fzU/JVNcaqHQEcVFAKeR41fkiLdIPrefOvVG1VZ96U0= github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.0.4/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/go-testing-interface v1.14.1 h1:jrgshOhYAUVNMAJiKbEu7EqAwgJJ2JqpQmpLJOu07cU= +github.com/mitchellh/go-testing-interface v1.14.1/go.mod h1:gfgS7OtZj6MA4U1UrDRp04twqAjfvlZyCfX3sDjEym8= github.com/mitchellh/go-wordwrap v0.0.0-20150314170334-ad45545899c7/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= github.com/mitchellh/go-wordwrap v1.0.0 h1:6GlHJ/LTGMrIJbwgdqdl2eEH8o+Exx/0m8ir9Gns0u4= github.com/mitchellh/go-wordwrap v1.0.0/go.mod h1:ZXFpozHsX6DPmq2I0TCekCxypsnAUbP2oI0UX1GXzOo= -github.com/mitchellh/hashstructure v1.0.0 h1:ZkRJX1CyOoTkar7p/mLS5TZU4nJ1Rn/F8u9dGS02Q3Y= -github.com/mitchellh/hashstructure v1.0.0/go.mod h1:QjSHrPWS+BGUVBYkbTZWEnOh3G1DutKwClXU/ABz6AQ= +github.com/mitchellh/go-wordwrap v1.0.1 h1:TLuKupo69TCn6TQSyGxwI1EblZZEsQ0vMlAFQflz0v0= +github.com/mitchellh/go-wordwrap v1.0.1/go.mod h1:R62XHJLzvMFRBbcrT7m7WgmE1eOyTSsCt+hzestvNj0= github.com/mitchellh/mapstructure v1.1.2 h1:fmNYVwqnSfB9mZU6OS2O6GsXM+wcskZDuKQzvN1EDeE= github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= -github.com/mitchellh/panicwrap v1.0.0/go.mod h1:pKvZHwWrZowLUzftuFq7coarnxbBXU4aQh3N0BJOeeA= -github.com/mitchellh/prefixedio v0.0.0-20190213213902-5733675afd51/go.mod h1:kB1naBgV9ORnkiTVeyJOI1DavaJkG4oNIq0Af6ZVKUo= +github.com/mitchellh/mapstructure v1.4.0 h1:7ks8ZkOP5/ujthUsT07rNv+nkLXCQWKNHuwzOAesEks= +github.com/mitchellh/mapstructure v1.4.0/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= github.com/mitchellh/reflectwalk v1.0.0 h1:9D+8oIskB4VJBN5SFlmc27fSlIBZaov1Wpk/IfikLNY= github.com/mitchellh/reflectwalk v1.0.0/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= -github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= -github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= -github.com/mozillazg/go-httpheader v0.2.1/go.mod h1:jJ8xECTlalr6ValeXYdOF8fFUISeBAdw6E61aqQma60= -github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U= -github.com/nu7hatch/gouuid v0.0.0-20131221200532-179d4d0c4d8d/go.mod h1:YUTz3bUH2ZwIWBy3CJBeOBEugqcmXREj14T+iG/4k4U= +github.com/mitchellh/reflectwalk v1.0.1 h1:FVzMWA5RllMAKIdUSC8mdWo3XtwoecrH79BY70sEEpE= +github.com/mitchellh/reflectwalk v1.0.1/go.mod h1:mSTlrgnPZtwu0c4WaC2kGObEpuNDbx0jmZXqmk4esnw= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e h1:fD57ERR4JtEqsWbfPhv4DMiApHyliiK5xCTNVSPiaAs= +github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno= github.com/oklog/run v1.0.0 h1:Ru7dDtJNOyC66gQ5dQmaCa0qIsAUFY3sFpK1Xk8igrw= github.com/oklog/run v1.0.0/go.mod h1:dlhp/R75TPv97u0XWUtDeV/lRKWPKSdTuV0TZvrmrQA= -github.com/packer-community/winrmcp v0.0.0-20180102160824-81144009af58/go.mod h1:f6Izs6JvFTdnRbziASagjZ2vmf55NSIkC/weStxCHqk= -github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= -github.com/pkg/browser v0.0.0-20180916011732-0a3d74bf9ce4/go.mod h1:4OwLy04Bl9Ef3GJJCoec+30X3LQs/0/m4HFRt/2LUSA= -github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/oklog/run v1.1.0 h1:GEenZ1cK0+q0+wsJew9qUg/DyD8k3JzYsZAi5gYi2mA= +github.com/oklog/run v1.1.0/go.mod h1:sVPdnTZT1zYwAJeCMu2Th4T21pA3FPOQRfWjQlk7DVU= +github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY= github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= -github.com/pkg/sftp v1.11.0 h1:4Zv0OGbpkg4yNuUtH0s8rvoYxRCNyT29NVUo6pgPmxI= -github.com/pkg/sftp v1.11.0/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pkg/sftp v1.12.0 h1:/f3b24xrDhkhddlaobPe2JgBqfdt+gC/NYl0QY9IOuI= +github.com/pkg/sftp v1.12.0/go.mod h1:fUqqXB5vEgVCZ131L+9say31RAri6aF6KDViawhxKK8= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= github.com/posener/complete v1.2.1 h1:LrvDIY//XNo65Lq84G/akBuMGlawHvGBABv8f/ZN6DI= github.com/posener/complete v1.2.1/go.mod h1:6gapUrK/U1TAN7ciCoNRIdVC5sbdBTUh1DKN0g6uH7E= -github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= -github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs= -github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= -github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4= -github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= -github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6SoW27p1b0cqNHllgS5HIMJraePCO15w5zCzIWYg= -github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= -github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/posener/complete v1.2.3 h1:NP0eAhjcjImqslEwo/1hq7gpajME0fTLTezBKDqfXqo= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ= github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo= -github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo= -github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= -github.com/smartystreets/goconvey v0.0.0-20180222194500-ef6db91d284a/go.mod h1:XDJAKZRPZ1CvBcN2aX5YOUTYGHki24fSF0Iv48Ibg0s= -github.com/soheilhy/cmux v0.1.4/go.mod h1:IM3LyeVVIOuxMH7sFAkER9+bJ4dT7Ms6E4xg4kGIyLM= -github.com/spf13/afero v1.2.1 h1:qgMbHoJbPbw579P+1zVY+6n4nIFuIchaIjzZ/I/Yq8M= -github.com/spf13/afero v1.2.1/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/sergi/go-diff v1.1.0 h1:we8PVUC3FE2uYfodKH/nBHMSetSfHDR6scGdBi+erh0= +github.com/sergi/go-diff v1.1.0/go.mod h1:STckp+ISIX8hZLjrqAeVduY0gWCT9IjLuqbuNXdaHfM= +github.com/spf13/afero v1.2.2 h1:5jhuqJyZCZf2JRofRvN/nIFgIWNzPa3/Vz8mYylgbWc= +github.com/spf13/afero v1.2.2/go.mod h1:9ZxEEn6pIJ8Rxe320qSDBk6AsU0r9pR7Q4OcevTdifk= +github.com/spf13/afero v1.5.1 h1:VHu76Lk0LSP1x254maIu2bplkWpfBWI+B+6fdoZprcg= +github.com/spf13/afero v1.5.1/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= github.com/spf13/pflag v1.0.2/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= -github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= -github.com/svanharmelen/jsonapi v0.0.0-20180618144545-0c0828c3f16d/go.mod h1:BSTlc8jOjh0niykqEGVXOLXdi9o0r0kR8tCYiMvjFgw= -github.com/tencentcloud/tencentcloud-sdk-go v3.0.82+incompatible/go.mod h1:0PfYow01SHPMhKY31xa+EFz2RStxIqj6JFAJS+IkCi4= -github.com/tencentyun/cos-go-sdk-v5 v0.0.0-20190808065407-f07404cefc8c/go.mod h1:wk2XFUg6egk4tSDNZtXeKfe2G6690UVyt163PuUxBZk= -github.com/terraform-providers/terraform-provider-openstack v1.15.0/go.mod h1:2aQ6n/BtChAl1y2S60vebhyJyZXBsuAI5G4+lHrT1Ew= -github.com/tmc/grpc-websocket-proxy v0.0.0-20171017195756-830351dc03c6/go.mod h1:ncp9v5uamzpCO7NfCPTXjqaC+bZgJeR0sMTm6dMHP7U= -github.com/ugorji/go v0.0.0-20180813092308-00b869d2f4a5/go.mod h1:hnLbHMwcvSihnDhEfx2/BzKp2xb0Y+ErdfYcrs9tkJQ= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/ulikunitz/xz v0.5.5 h1:pFrO0lVpTBXLpYw+pnLj6TbvHuyjXMfjGeCwSqCVwok= github.com/ulikunitz/xz v0.5.5/go.mod h1:2bypXElzHzzJZwzH67Y6wb67pO62Rzfn7BSiF4ABRW8= +github.com/ulikunitz/xz v0.5.7/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.8/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= +github.com/ulikunitz/xz v0.5.9 h1:RsKRIA2MO8x56wkkcd3LbtcE/uMszhb6DpRf+3uwa3I= +github.com/ulikunitz/xz v0.5.9/go.mod h1:nbz6k7qbPmH4IRqmfOplQw/tblSgqTqBwxkY0oWt/14= github.com/vmihailenco/msgpack v3.3.3+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= github.com/vmihailenco/msgpack v4.0.1+incompatible h1:RMF1enSPeKTlXrXdOcqjFUElywVZjjC6pqse21bKbEU= github.com/vmihailenco/msgpack v4.0.1+incompatible/go.mod h1:fy3FlTQTDXWkZ7Bh6AcGMlsjHatGryHQYUTf1ShIgkk= +github.com/vmihailenco/msgpack/v4 v4.3.12 h1:07s4sz9IReOgdikxLTKNbBdqDMLsjPKXwvCazn8G65U= +github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= +github.com/vmihailenco/tagparser v0.1.1 h1:quXMXlA39OCbd2wAdTsGDlK9RkOk6Wuw+x37wVyIuWY= +github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/vmihailenco/tagparser v0.1.2 h1:gnjoVuB/kljJ5wICEEOpx98oXMWPLj22G67Vbd1qPqc= +github.com/vmihailenco/tagparser v0.1.2/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= github.com/xanzy/ssh-agent v0.2.1/go.mod h1:mLlQY/MoOhWBj+gOGMQkOeiEvkx+8pJSI+0Bx9h2kr4= -github.com/xiang90/probing v0.0.0-20160813154853-07dd2e8dfe18/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU= -github.com/xlab/treeprint v0.0.0-20161029104018-1d6e34225557/go.mod h1:ce1O1j6UtZfjr22oyGxGLbauSBp2YVXpARAosm7dHBg= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= github.com/zclconf/go-cty v1.0.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.1.0/go.mod h1:xnAOWiHeOqg2nWS62VtQ7pbOu17FtxJNW8RLEih+O3s= github.com/zclconf/go-cty v1.2.0/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= github.com/zclconf/go-cty v1.2.1 h1:vGMsygfmeCl4Xb6OA5U5XVAaQZ69FvoG7X2jUtQujb8= github.com/zclconf/go-cty v1.2.1/go.mod h1:hOPWgoHbaTUnI5k4D2ld+GRpFJSCe6bCM7m1q/N4PQ8= +github.com/zclconf/go-cty v1.7.1 h1:AvsC01GMhMLFL8CgEYdHGM+yLnnDOwhPAYcgTkeF0Gw= +github.com/zclconf/go-cty v1.7.1/go.mod h1:VDR4+I79ubFBGm1uJac1226K5yANQFHeauxPBoP54+o= github.com/zclconf/go-cty-yaml v1.0.1 h1:up11wlgAaDvlAGENcFDnZgkn0qUJurso7k6EpURKNF8= github.com/zclconf/go-cty-yaml v1.0.1/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= +github.com/zclconf/go-cty-yaml v1.0.2 h1:dNyg4QLTrv2IfJpm7Wtxi55ed5gLGOlPrZ6kMd51hY0= +github.com/zclconf/go-cty-yaml v1.0.2/go.mod h1:IP3Ylp0wQpYm50IHK8OZWKMu6sPJIUgKa8XhiVHura0= go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= go.opencensus.io v0.22.0 h1:C9hSCOW830chIVkdja34wa6Ky+IzWllkUinR+BtRZd4= go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= -go.uber.org/atomic v1.3.2/go.mod h1:gD2HeocX3+yG+ygLZcrzQJaqmWj9AIm7n08wl/qW/PE= -go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= -go.uber.org/zap v1.9.1/go.mod h1:vwi/ZaCAaUcBkycHslxD9B2zi4UTXhF60s6SWpuDF0Q= -golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5 h1:dntmOdLpSpHlVqbW5Eay97DelsZHe+55D+xC6i0dDS0= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= golang.org/x/crypto v0.0.0-20190219172222-a4c6cb3142f2/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= -golang.org/x/crypto v0.0.0-20190222235706-ffb98f73852f/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20190701094942-4def268fd1a4/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586 h1:7KByu05hhLed2MO29w7p1XfZvZ13m8mub3shuVftRs0= golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200302210943-78000ba7a073/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20200820211705-5c72a883971a/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad h1:DN0cp81fZ3njFcrLCytUHRSUkqBjfTo4Tx9RJTWs0EY= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5 h1:2M3HP5CCK1Si9FQhwnzYhXdG6DXeebvUHFpre8QvbyI= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0 h1:8pl+sMODzuvGJkmj2W4kZihvVb5mKm8pB/X44PIQHv8= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180530234432-1e491301e022/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180811021610-c39426892332/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20181220203305-927f97764cc3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= -golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= @@ -351,23 +471,53 @@ golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb h1:TR699M2v0qoKTOHxeLgp6zPqaQNs74f01a/ob9W0qko= golang.org/x/net v0.0.0-20191009170851-d66e71096ffb/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a h1:GuSPYbZzB5/dcLNCwLQLsg3obCJtX9IJhpXkvY7kzk0= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200904194848-62affa334b73/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b h1:iFwSg7t5GZmB/Q5TjiEAsdoLDrdJRC1RiF2WhuV29Qw= +golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45 h1:SVwTIAaPC2U/AvvLNZ2a7OVsmBpC8L5BlwK1whH3hm0= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5 h1:Lm4OryKCca1vehdsWogr9N4t7NfZxLbJoc/H0w4K4S4= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181107165924-66b7b1311ac8/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= -golang.org/x/sys v0.0.0-20190129075346-302c3dd5f1cc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190221075227-b4e8571b14e0/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -378,14 +528,48 @@ golang.org/x/sys v0.0.0-20190502175342-a43fa875dd82/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa h1:KIDDMLT1O0Nr7TSxp8xM5tJcdn8tgyAONntO829og1M= -golang.org/x/sys v0.0.0-20190804053845-51ab0e2deafa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527 h1:uYVVQ9WP/Ds2ROhcaGPeIdVq0RIXVLwsHlnvJ+cT1So= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200828194041-157a740278f4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201231184435-2d18734c6014 h1:joucsQqXmyBVxViHCPFjG3hx8JzIFSaym3l3MM/Jsdg= +golang.org/x/sys v0.0.0-20201231184435-2d18734c6014/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1 h1:v+OssWQX+hTHEmOBgwxdZxK4zHq3yOs8F9J7mk0PY8E= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2 h1:tW2bmiBqwgJj/UpqtC8EpXEZVYOwU0yG4iWbprSVAcs= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4 h1:0YWbFKbhXG/wIiuHDSKpS0Iy7FSA+u45VtBMfQcFTTc= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= @@ -394,17 +578,86 @@ golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200713011307-fd294ab11aed/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200828161849-5deb26317202/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20200915173823-2db8f0ff891c/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20200918232735-d647fc253266/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2 h1:vEtypaVub6UvKkiXZ2xx9QIvp9TL7sI7xp7vdi2kezA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210102185154-773b96fafca2 h1:crjwvdT+rSAILpNOKhk/BNmefsucqGTeeRX2YBK/6Jg= +golang.org/x/tools v0.0.0-20210102185154-773b96fafca2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= google.golang.org/api v0.9.0 h1:jbyannxz0XFD3zdjgrSUsaJbgpH4eTrkdhRChkHPfO8= google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.31.0/go.mod h1:CL+9IBCa2WWU6gRuBWaKqGWLFFwbEUXkfeMkHLQWYWo= +google.golang.org/api v0.32.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0 h1:l2Nfbl2GPXdWorv+dT2XfinX2jOOw4zv1VhLstx+6rE= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1 h1:QzqyMA1tlu6CgqCDUtU9V+ZKhLFT2dkJuANu5QaxI3I= google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20170818010345-ee236bd376b0/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= @@ -413,21 +666,93 @@ google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRn google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55 h1:gSJIx1SDwno+2ElGhA4+qG2zF97qiUzTM+rQ0klBOcE= google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= -google.golang.org/grpc v1.14.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200711021454-869866162049/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200831141814-d751682dd103/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200914193844-75d14daec038/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200921151605-7abf4a1a14d5/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d h1:HV9Z9qMhQEsdlvxNFELgQ11RkMzO3CMkjEySjCtuLes= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/grpc v1.8.0/go.mod h1:yo6s7OP7yaDglbqo1J04qKzAhqBH6lvTonzMVmEdcZw= google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= google.golang.org/grpc v1.21.1 h1:j6XxA85m/6txkUCHvzlV5f+HBNl/1r5cZ2A/3IEFOO8= google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= -gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1 h1:zvIju4sqAGvwKspUQOhwnpcqSbzi7/H6QomNNjTL4sk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.32.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0 h1:raiipEjMOIC/TO2AvyTxP25XFdLxNIBwzDh3FM3XztI= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0 h1:Ejskq+SyPohKW+1uil0JJMtmHCgJPJ/qWTxr8qp+R4c= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f h1:BLraFXnmrev5lT+xlilqcH8XK9/i0At2xKjWk4p6zsU= +gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/cheggaaa/pb.v1 v1.0.27/go.mod h1:V/YB90LKu/1FcN3WVnfiiE5oMCibMjukxqG/qStrOgw= -gopkg.in/ini.v1 v1.42.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= -gopkg.in/resty.v1 v1.12.0/go.mod h1:mDo4pnntr5jdWRML875a/NmxYqAlA73dVijT2AXvQQo= -gopkg.in/yaml.v2 v2.0.0-20170812160011-eb3733d160e7/go.mod h1:JAlM8MvJe8wmxCU4Bli9HhUf9+ttbYbLASfIpnQbh74= -gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/warnings.v0 v0.1.2/go.mod h1:jksf8JmL6Qr/oQM2OXTHunEvvTAsrWBLb6OOjuVWRNI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0 h1:clyUAQHOM3G0M3f5vQj7LuJrETvjVot3Z5el9nffUtU= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/main.go b/main.go index d6fa573..68efbda 100644 --- a/main.go +++ b/main.go @@ -6,8 +6,8 @@ package main import ( "github.com/danitso/terraform-provider-proxmox/proxmoxtf" - "github.com/hashicorp/terraform/plugin" - "github.com/hashicorp/terraform/terraform" + "github.com/hashicorp/terraform-plugin-sdk/plugin" + "github.com/hashicorp/terraform-plugin-sdk/terraform" ) func main() { diff --git a/proxmox/virtual_environment_cluster_alias.go b/proxmox/virtual_environment_cluster_alias.go new file mode 100644 index 0000000..6fc57aa --- /dev/null +++ b/proxmox/virtual_environment_cluster_alias.go @@ -0,0 +1,63 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmox + +import ( + "errors" + "fmt" + "net/url" + "sort" +) + +// CreateAlias create an alias +func (c *VirtualEnvironmentClient) CreateAlias(d *VirtualEnvironmentClusterAliasCreateRequestBody) error { + return c.DoRequest(hmPOST, "cluster/firewall/aliases", d, nil) +} + +// DeleteAlias delete an alias +func (c *VirtualEnvironmentClient) DeleteAlias(id string) error { + return c.DoRequest(hmDELETE, fmt.Sprintf("cluster/firewall/aliases/%s", url.PathEscape(id)), nil, nil) +} + +// GetAlias retrieves an alias +func (c *VirtualEnvironmentClient) GetAlias(id string) (*VirtualEnvironmentClusterAliasGetResponseData, error) { + resBody := &VirtualEnvironmentClusterAliasGetResponseBody{} + err := c.DoRequest(hmGET, fmt.Sprintf("cluster/firewall/aliases/%s", url.PathEscape(id)), nil, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil +} + +// ListAlias retrieves a list of aliases. +func (c *VirtualEnvironmentClient) ListAliases() ([]*VirtualEnvironmentClusterAliasGetResponseData, error) { + resBody := &VirtualEnvironmentClusterAliasListResponseBody{} + err := c.DoRequest(hmGET, "cluster/firewall/aliases", nil, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + sort.Slice(resBody.Data, func(i, j int) bool { + return resBody.Data[i].Name < resBody.Data[j].Name + }) + + return resBody.Data, nil +} + +// UpdateAlias updates an alias. +func (c *VirtualEnvironmentClient) UpdateAlias(id string, d *VirtualEnvironmentClusterAliasUpdateRequestBody) error { + return c.DoRequest(hmPUT, fmt.Sprintf("cluster/firewall/aliases/%s", url.PathEscape(id)), d, nil) +} \ No newline at end of file diff --git a/proxmox/virtual_environment_cluster_alias_types.go b/proxmox/virtual_environment_cluster_alias_types.go new file mode 100644 index 0000000..d681320 --- /dev/null +++ b/proxmox/virtual_environment_cluster_alias_types.go @@ -0,0 +1,39 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmox + +// VirtualEnvironmentClusterAliasCreateRequestBody contains the data for an alias create request. +type VirtualEnvironmentClusterAliasCreateRequestBody struct { + Comment *string `json:"comment,omitempty" url:"comment,omitempty"` + Name string `json:"name" url:"name"` + CIDR string `json:"cidr" url:"cidr"` +} + +// VirtualEnvironmentClusterAliasGetResponseBody contains the body from an alias get response. +type VirtualEnvironmentClusterAliasGetResponseBody struct { + Data *VirtualEnvironmentClusterAliasGetResponseData `json:"data,omitempty"` +} + +// VirtualEnvironmentClusterAliasGetResponseData contains the data from an alias get response. +type VirtualEnvironmentClusterAliasGetResponseData struct { + Comment *string `json:"comment,omitempty" url:"comment,omitempty"` + Name string `json:"name" url:"name"` + CIDR string `json:"cidr" url:"cidr"` + Digest *string `json:"digest" url:"digest"` + IPVersion int `json:"ipversion" url:"ipversion"` +} + +// VirtualEnvironmentClusterAliasListResponseBody contains the data from an alias get response. +type VirtualEnvironmentClusterAliasListResponseBody struct { + Data []*VirtualEnvironmentClusterAliasGetResponseData `json:"data,omitempty"` +} + +// VirtualEnvironmentClusterAliasUpdateRequestBody contains the data for an alias update request. +type VirtualEnvironmentClusterAliasUpdateRequestBody struct { + Comment *string `json:"comment,omitempty" url:"comment,omitempty"` + ReName string `json:"rename" url:"rename"` + CIDR string `json:"cidr" url:"cidr"` +} + diff --git a/proxmox/virtual_environment_cluster_ipset.go b/proxmox/virtual_environment_cluster_ipset.go new file mode 100644 index 0000000..3513bed --- /dev/null +++ b/proxmox/virtual_environment_cluster_ipset.go @@ -0,0 +1,73 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmox + +import ( + "errors" + "fmt" + "net/url" + "sort" +) + +// CreateIPSet create an IPSet +func (c *VirtualEnvironmentClient) CreateIPSet(d *VirtualEnvironmentClusterIPSetCreateRequestBody) error { + return c.DoRequest(hmPOST, "cluster/firewall/ipset", d, nil) +} + +// Add IP or Network to IPSet +func (c *VirtualEnvironmentClient) AddCIDRToIPSet(id string, d *VirtualEnvironmentClusterIPSetGetResponseData) error { + return c.DoRequest(hmPOST, fmt.Sprintf("cluster/firewall/ipset/%s/", url.PathEscape(id)), d, nil) +} + +// UpdateIPSet updates an IPSet. +func (c *VirtualEnvironmentClient) UpdateIPSet(d *VirtualEnvironmentClusterIPSetUpdateRequestBody) error { + return c.DoRequest(hmPOST, fmt.Sprint("cluster/firewall/ipset/"), d, nil) +} + +// DeleteIPSet delete an IPSet +func (c *VirtualEnvironmentClient) DeleteIPSet(id string) error { + return c.DoRequest(hmDELETE, fmt.Sprintf("cluster/firewall/ipset/%s", url.PathEscape(id)), nil, nil) +} + +// DeleteIPSetContent remove IP or Network from IPSet. +func (c *VirtualEnvironmentClient) DeleteIPSetContent(id string, cidr string) error { + return c.DoRequest(hmDELETE, fmt.Sprintf("cluster/firewall/ipset/%s/%s", url.PathEscape(id), url.PathEscape(cidr)), nil, nil) +} + +// GetListIPSetContent retrieve a list of IPSet content +func (c *VirtualEnvironmentClient) GetListIPSetContent(id string) ([]*VirtualEnvironmentClusterIPSetGetResponseData, error) { + resBody := &VirtualEnvironmentClusterIPSetGetResponseBody{} + err := c.DoRequest(hmGET, fmt.Sprintf("cluster/firewall/ipset/%s", url.PathEscape(id)), nil, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil +} + +// GetListIPSets retrieves list of IPSets. +func (c *VirtualEnvironmentClient) GetListIPSets() (*VirtualEnvironmentClusterIPSetListResponseBody, error) { + resBody := &VirtualEnvironmentClusterIPSetListResponseBody{} + err := c.DoRequest(hmGET, "cluster/firewall/ipset", nil, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + sort.Slice(resBody.Data, func(i, j int) bool { + return resBody.Data[i].Name < resBody.Data[j].Name + }) + + return resBody, nil +} \ No newline at end of file diff --git a/proxmox/virtual_environment_cluster_ipset_types.go b/proxmox/virtual_environment_cluster_ipset_types.go new file mode 100644 index 0000000..36edaff --- /dev/null +++ b/proxmox/virtual_environment_cluster_ipset_types.go @@ -0,0 +1,48 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +/** +* Reference: https://pve.proxmox.com/pve-docs/api-viewer/#/cluster/firewall/ipset + */ + +package proxmox + +// VirtualEnvironmentClusterIPSetListResponseBody contains the data from an IPSet get response. +type VirtualEnvironmentClusterIPSetListResponseBody struct { + Data []*VirtualEnvironmentClusterIPSetCreateRequestBody `json:"data,omitempty"` +} + +// VirtualEnvironmentClusterIPSetCreateRequestBody contains the data for an IPSet create request +type VirtualEnvironmentClusterIPSetCreateRequestBody struct { + Comment string `json:"comment,omitempty" url:"comment,omitempty"` + Name string `json:"name" url:"name"` +} + +// VirtualEnvironmentClusterIPSetGetResponseBody contains the body from an IPSet get response. +type VirtualEnvironmentClusterIPSetGetResponseBody struct { + Data []*VirtualEnvironmentClusterIPSetGetResponseData `json:"data,omitempty"` +} + +// VirtualEnvironmentClusterIPSetGetResponseData contains the data from an IPSet get response. +type VirtualEnvironmentClusterIPSetGetResponseData struct { + CIDR string `json:"cidr" url:"cidr"` + NoMatch *CustomBool `json:"nomatch,omitempty" url:"nomatch,omitempty,int"` + Comment string `json:"comment,omitempty" url:"comment,omitempty"` +} + +// VirtualEnvironmentClusterIPSetUpdateRequestBody contains the data for an IPSet update request. +type VirtualEnvironmentClusterIPSetUpdateRequestBody struct { + ReName string `json:"rename,omitempty" url:"rename,omitempty"` + Comment *string `json:"comment,omitempty" url:"comment,omitempty"` + Name string `json:"name" url:"name"` +} + +// VirtualEnvironmentClusterIPSetGetResponseData contains list of IPSets from +type VirtualEnvironmentClusterIPSetListResponseData struct { + Comment *string `json:"comment,omitempty" url:"comment,omitempty"` + Name string `json:"name" url:"name"` +} + +// VirtualEnvironmentClusterIPSetContent is an array of VirtualEnvironmentClusterIPSetGetResponseData. +type VirtualEnvironmentClusterIPSetContent []VirtualEnvironmentClusterIPSetGetResponseData diff --git a/proxmox/virtual_environment_nodes.go b/proxmox/virtual_environment_nodes.go index da114ae..b3dd78d 100644 --- a/proxmox/virtual_environment_nodes.go +++ b/proxmox/virtual_environment_nodes.go @@ -10,6 +10,7 @@ import ( "net/url" "sort" "strings" + "time" "golang.org/x/crypto/ssh" ) @@ -88,6 +89,22 @@ func (c *VirtualEnvironmentClient) GetNodeTime(nodeName string) (*VirtualEnviron return resBody.Data, nil } +// GetNodeTaskStatus retrieves the status of a node task. +func (c *VirtualEnvironmentClient) GetNodeTaskStatus(nodeName string, upid string) (*VirtualEnvironmentNodeGetTaskStatusResponseData, error) { + resBody := &VirtualEnvironmentNodeGetTaskStatusResponseBody{} + err := c.DoRequest(hmGET, fmt.Sprintf("nodes/%s/tasks/%s/status", url.PathEscape(nodeName), url.PathEscape(upid)), nil, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil +} + // ListNodeNetworkDevices retrieves a list of network devices for a specific nodes. func (c *VirtualEnvironmentClient) ListNodeNetworkDevices(nodeName string) ([]*VirtualEnvironmentNodeNetworkDeviceListResponseData, error) { resBody := &VirtualEnvironmentNodeNetworkDeviceListResponseBody{} @@ -157,3 +174,36 @@ func (c *VirtualEnvironmentClient) OpenNodeShell(nodeName string) (*ssh.Client, func (c *VirtualEnvironmentClient) UpdateNodeTime(nodeName string, d *VirtualEnvironmentNodeUpdateTimeRequestBody) error { return c.DoRequest(hmPUT, fmt.Sprintf("nodes/%s/time", url.PathEscape(nodeName)), d, nil) } + +// WaitForNodeTask waits for a specific node task to complete. +func (c *VirtualEnvironmentClient) WaitForNodeTask(nodeName string, upid string, timeout int, delay int) error { + timeDelay := int64(delay) + timeMax := float64(timeout) + timeStart := time.Now() + timeElapsed := timeStart.Sub(timeStart) + + for timeElapsed.Seconds() < timeMax { + if int64(timeElapsed.Seconds())%timeDelay == 0 { + status, err := c.GetNodeTaskStatus(nodeName, upid) + + if err != nil { + return err + } + + if status.Status != "running" { + if status.ExitCode != "OK" { + return fmt.Errorf("Task \"%s\" on node \"%s\" failed to complete with error: %s", upid, nodeName, status.ExitCode) + } + return nil + } + + time.Sleep(1 * time.Second) + } + + time.Sleep(200 * time.Millisecond) + + timeElapsed = time.Now().Sub(timeStart) + } + + return fmt.Errorf("Timeout while waiting for task \"%s\" on node \"%s\" to complete", upid, nodeName) +} diff --git a/proxmox/virtual_environment_nodes_types.go b/proxmox/virtual_environment_nodes_types.go index 66e6cdd..f8b7d08 100644 --- a/proxmox/virtual_environment_nodes_types.go +++ b/proxmox/virtual_environment_nodes_types.go @@ -29,6 +29,18 @@ type VirtualEnvironmentNodeGetTimeResponseData struct { UTCTime CustomTimestamp `json:"time"` } +// VirtualEnvironmentNodeGetTaskStatusResponseBody contains the body from a node get task status response. +type VirtualEnvironmentNodeGetTaskStatusResponseBody struct { + Data *VirtualEnvironmentNodeGetTaskStatusResponseData `json:"data,omitempty"` +} + +// VirtualEnvironmentNodeGetTaskStatusResponseData contains the data from a node get task status response. +type VirtualEnvironmentNodeGetTaskStatusResponseData struct { + PID int `json:"pid,omitempty"` + Status string `json:"status,omitempty"` + ExitCode string `json:"exitstatus,omitempty"` +} + // VirtualEnvironmentNodeListResponseBody contains the body from a node list response. type VirtualEnvironmentNodeListResponseBody struct { Data []*VirtualEnvironmentNodeListResponseData `json:"data,omitempty"` diff --git a/proxmox/virtual_environment_vm.go b/proxmox/virtual_environment_vm.go index 8993977..d5bf739 100644 --- a/proxmox/virtual_environment_vm.go +++ b/proxmox/virtual_environment_vm.go @@ -24,8 +24,35 @@ var ( ) // CloneVM clones a virtual machine. -func (c *VirtualEnvironmentClient) CloneVM(nodeName string, vmID int, d *VirtualEnvironmentVMCloneRequestBody) error { - return c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/clone", url.PathEscape(nodeName), vmID), d, nil) +func (c *VirtualEnvironmentClient) CloneVM(nodeName string, vmID int, retries int, d *VirtualEnvironmentVMCloneRequestBody, timeout int) error { + resBody := &VirtualEnvironmentVMMoveDiskResponseBody{} + var err error + + // just a guard in case someone sets retries to 0 unknowingly + if retries <= 0 { + retries = 1 + } + + for i := 0; i < retries; i++ { + err = c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/clone", url.PathEscape(nodeName), vmID), d, resBody) + + if err != nil { + return err + } + + if resBody.Data == nil { + return errors.New("The server did not include a data object in the response") + } + + err = c.WaitForNodeTask(nodeName, *resBody.Data, timeout, 5) + + if err == nil { + return nil + } + time.Sleep(10 * time.Second) + } + + return err } // CreateVM creates a virtual machine. @@ -130,29 +157,194 @@ func (c *VirtualEnvironmentClient) GetVMStatus(nodeName string, vmID int) (*Virt return resBody.Data, nil } +// MoveVMDisk moves a virtual machine disk. +func (c *VirtualEnvironmentClient) MoveVMDisk(nodeName string, vmID int, d *VirtualEnvironmentVMMoveDiskRequestBody, timeout int) error { + taskID, err := c.MoveVMDiskAsync(nodeName, vmID, d) + + if strings.Contains(err.Error(), "you can't move to the same storage with same format") { + // if someone tries to move to the same storage, the move is considered to be successful + return nil + } + + if err != nil { + return err + } + + err = c.WaitForNodeTask(nodeName, *taskID, timeout, 5) + + if err != nil { + return err + } + + return nil +} + +// MoveVMDiskAsync moves a virtual machine disk asynchronously. +func (c *VirtualEnvironmentClient) MoveVMDiskAsync(nodeName string, vmID int, d *VirtualEnvironmentVMMoveDiskRequestBody) (*string, error) { + resBody := &VirtualEnvironmentVMMoveDiskResponseBody{} + err := c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/move_disk", url.PathEscape(nodeName), vmID), d, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil +} + // ListVMs retrieves a list of virtual machines. func (c *VirtualEnvironmentClient) ListVMs() ([]*VirtualEnvironmentVMListResponseData, error) { return nil, errors.New("Not implemented") } // RebootVM reboots a virtual machine. -func (c *VirtualEnvironmentClient) RebootVM(nodeName string, vmID int, d *VirtualEnvironmentVMRebootRequestBody) error { - return c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/reboot", url.PathEscape(nodeName), vmID), d, nil) +func (c *VirtualEnvironmentClient) RebootVM(nodeName string, vmID int, d *VirtualEnvironmentVMRebootRequestBody, timeout int) error { + taskID, err := c.RebootVMAsync(nodeName, vmID, d) + + if err != nil { + return err + } + + err = c.WaitForNodeTask(nodeName, *taskID, timeout, 5) + + if err != nil { + return err + } + + return nil +} + +// RebootVMAsync reboots a virtual machine asynchronously. +func (c *VirtualEnvironmentClient) RebootVMAsync(nodeName string, vmID int, d *VirtualEnvironmentVMRebootRequestBody) (*string, error) { + resBody := &VirtualEnvironmentVMRebootResponseBody{} + err := c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/reboot", url.PathEscape(nodeName), vmID), d, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil +} + +// ResizeVMDisk resizes a virtual machine disk. +func (c *VirtualEnvironmentClient) ResizeVMDisk(nodeName string, vmID int, d *VirtualEnvironmentVMResizeDiskRequestBody) error { + var err error + log.Printf("[DEBUG] RESIZE size: %s, disk: %s", d.Size, d.Disk) + for i := 0; i < 5; i++ { + err = c.DoRequest(hmPUT, fmt.Sprintf("nodes/%s/qemu/%d/resize", url.PathEscape(nodeName), vmID), d, nil) + if err == nil { + return nil + } + log.Printf("[DEBUG] resize disk failed, retry nr: %d", i) + time.Sleep(5 * time.Second) + } + return err } // ShutdownVM shuts down a virtual machine. -func (c *VirtualEnvironmentClient) ShutdownVM(nodeName string, vmID int, d *VirtualEnvironmentVMShutdownRequestBody) error { - return c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/shutdown", url.PathEscape(nodeName), vmID), d, nil) +func (c *VirtualEnvironmentClient) ShutdownVM(nodeName string, vmID int, d *VirtualEnvironmentVMShutdownRequestBody, timeout int) error { + taskID, err := c.ShutdownVMAsync(nodeName, vmID, d) + + if err != nil { + return err + } + + err = c.WaitForNodeTask(nodeName, *taskID, timeout, 5) + + if err != nil { + return err + } + + return nil +} + +// ShutdownVMAsync shuts down a virtual machine asynchronously. +func (c *VirtualEnvironmentClient) ShutdownVMAsync(nodeName string, vmID int, d *VirtualEnvironmentVMShutdownRequestBody) (*string, error) { + resBody := &VirtualEnvironmentVMShutdownResponseBody{} + err := c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/shutdown", url.PathEscape(nodeName), vmID), d, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil } // StartVM starts a virtual machine. -func (c *VirtualEnvironmentClient) StartVM(nodeName string, vmID int) error { - return c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/start", url.PathEscape(nodeName), vmID), nil, nil) +func (c *VirtualEnvironmentClient) StartVM(nodeName string, vmID int, timeout int) error { + taskID, err := c.StartVMAsync(nodeName, vmID) + + if err != nil { + return err + } + + err = c.WaitForNodeTask(nodeName, *taskID, timeout, 5) + + if err != nil { + return err + } + + return nil } -// StopVM stops a virtual machine immediately. -func (c *VirtualEnvironmentClient) StopVM(nodeName string, vmID int) error { - return c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/stop", url.PathEscape(nodeName), vmID), nil, nil) +// StartVMAsync starts a virtual machine asynchronously. +func (c *VirtualEnvironmentClient) StartVMAsync(nodeName string, vmID int) (*string, error) { + resBody := &VirtualEnvironmentVMStartResponseBody{} + err := c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/start", url.PathEscape(nodeName), vmID), nil, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil +} + +// StopVM stops a virtual machine. +func (c *VirtualEnvironmentClient) StopVM(nodeName string, vmID int, timeout int) error { + taskID, err := c.StopVMAsync(nodeName, vmID) + + if err != nil { + return err + } + + err = c.WaitForNodeTask(nodeName, *taskID, timeout, 5) + + if err != nil { + return err + } + + return nil +} + +// StopVMAsync stops a virtual machine asynchronously. +func (c *VirtualEnvironmentClient) StopVMAsync(nodeName string, vmID int) (*string, error) { + resBody := &VirtualEnvironmentVMStopResponseBody{} + err := c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/status/stop", url.PathEscape(nodeName), vmID), nil, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil } // UpdateVM updates a virtual machine. @@ -161,8 +353,19 @@ func (c *VirtualEnvironmentClient) UpdateVM(nodeName string, vmID int, d *Virtua } // UpdateVMAsync updates a virtual machine asynchronously. -func (c *VirtualEnvironmentClient) UpdateVMAsync(nodeName string, vmID int, d *VirtualEnvironmentVMUpdateRequestBody) error { - return c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/config", url.PathEscape(nodeName), vmID), d, nil) +func (c *VirtualEnvironmentClient) UpdateVMAsync(nodeName string, vmID int, d *VirtualEnvironmentVMUpdateRequestBody) (*string, error) { + resBody := &VirtualEnvironmentVMUpdateAsyncResponseBody{} + err := c.DoRequest(hmPOST, fmt.Sprintf("nodes/%s/qemu/%d/config", url.PathEscape(nodeName), vmID), d, resBody) + + if err != nil { + return nil, err + } + + if resBody.Data == nil { + return nil, errors.New("The server did not include a data object in the response") + } + + return resBody.Data, nil } // WaitForNetworkInterfacesFromVMAgent waits for a virtual machine's QEMU agent to publish the network interfaces. diff --git a/proxmox/virtual_environment_vm_types.go b/proxmox/virtual_environment_vm_types.go index 89f2829..7b10b9e 100644 --- a/proxmox/virtual_environment_vm_types.go +++ b/proxmox/virtual_environment_vm_types.go @@ -162,10 +162,15 @@ type CustomStorageDevice struct { MaxWriteSpeedMbps *int `json:"mbps_wr,omitempty" url:"mbps_wr,omitempty"` Media *string `json:"media,omitempty" url:"media,omitempty"` Size *string `json:"size,omitempty" url:"size,omitempty"` + Format *string `json:"format,omitempty" url:"format,omitempty"` + Interface *string + ID *string + FileID *string + SizeInt *int } // CustomStorageDevices handles QEMU SATA device parameters. -type CustomStorageDevices []CustomStorageDevice +type CustomStorageDevices map[string]CustomStorageDevice // CustomUSBDevice handles QEMU USB device parameters. type CustomUSBDevice struct { @@ -244,7 +249,7 @@ type VirtualEnvironmentVMCreateRequestBody struct { HookScript *string `json:"hookscript,omitempty" url:"hookscript,omitempty"` Hotplug CustomCommaSeparatedList `json:"hotplug,omitempty" url:"hotplug,omitempty,comma"` Hugepages *string `json:"hugepages,omitempty" url:"hugepages,omitempty"` - IDEDevices CustomStorageDevices `json:"ide,omitempty" url:"ide,omitempty"` + IDEDevices CustomStorageDevices `json:"ide,omitempty" url:",omitempty"` KeyboardLayout *string `json:"keyboard,omitempty" url:"keyboard,omitempty"` KVMArguments CustomLineBreakSeparatedList `json:"args,omitempty" url:"args,omitempty,space"` KVMEnabled *CustomBool `json:"kvm,omitempty" url:"kvm,omitempty,int"` @@ -280,7 +285,7 @@ type VirtualEnvironmentVMCreateRequestBody struct { USBDevices CustomUSBDevices `json:"usb,omitempty" url:"usb,omitempty"` VGADevice *CustomVGADevice `json:"vga,omitempty" url:"vga,omitempty"` VirtualCPUCount *int `json:"vcpus,omitempty" url:"vcpus,omitempty"` - VirtualIODevices CustomVirtualIODevices `json:"virtio,omitempty" url:"virtio,omitempty"` + VirtualIODevices CustomStorageDevices `json:"virtio,omitempty" url:"virtio,omitempty"` VMGenerationID *string `json:"vmgenid,omitempty" url:"vmgenid,omitempty"` VMID *int `json:"vmid,omitempty" url:"vmid,omitempty"` VMStateDatastoreID *string `json:"vmstatestorage,omitempty" url:"vmstatestorage,omitempty"` @@ -440,7 +445,22 @@ type VirtualEnvironmentVMGetResponseData struct { USBDevices *CustomUSBDevices `json:"usb,omitempty"` VGADevice *CustomVGADevice `json:"vga,omitempty"` VirtualCPUCount *int `json:"vcpus,omitempty"` - VirtualIODevices *CustomVirtualIODevices `json:"virtio,omitempty"` + VirtualIODevice0 *CustomStorageDevice `json:"virtio0,omitempty"` + VirtualIODevice1 *CustomStorageDevice `json:"virtio1,omitempty"` + VirtualIODevice2 *CustomStorageDevice `json:"virtio2,omitempty"` + VirtualIODevice3 *CustomStorageDevice `json:"virtio3,omitempty"` + VirtualIODevice4 *CustomStorageDevice `json:"virtio4,omitempty"` + VirtualIODevice5 *CustomStorageDevice `json:"virtio5,omitempty"` + VirtualIODevice6 *CustomStorageDevice `json:"virtio6,omitempty"` + VirtualIODevice7 *CustomStorageDevice `json:"virtio7,omitempty"` + VirtualIODevice8 *CustomStorageDevice `json:"virtio8,omitempty"` + VirtualIODevice9 *CustomStorageDevice `json:"virtio9,omitempty"` + VirtualIODevice10 *CustomStorageDevice `json:"virtio10,omitempty"` + VirtualIODevice11 *CustomStorageDevice `json:"virtio11,omitempty"` + VirtualIODevice12 *CustomStorageDevice `json:"virtio12,omitempty"` + VirtualIODevice13 *CustomStorageDevice `json:"virtio13,omitempty"` + VirtualIODevice14 *CustomStorageDevice `json:"virtio14,omitempty"` + VirtualIODevice15 *CustomStorageDevice `json:"virtio15,omitempty"` VMGenerationID *string `json:"vmgenid,omitempty"` VMStateDatastoreID *string `json:"vmstatestorage,omitempty"` WatchdogDevice *CustomWatchdogDevice `json:"watchdog,omitempty"` @@ -478,11 +498,39 @@ type VirtualEnvironmentVMListResponseData struct { ACPI *CustomBool `json:"acpi,omitempty" url:"acpi,omitempty,int"` } +// VirtualEnvironmentVMMoveDiskRequestBody contains the body for a VM move disk request. +type VirtualEnvironmentVMMoveDiskRequestBody struct { + BandwidthLimit *int `json:"bwlimit,omitempty" url:"bwlimit,omitempty"` + DeleteOriginalDisk *CustomBool `json:"delete,omitempty,int" url:"delete,omitempty,int"` + Digest *string `json:"digest,omitempty" url:"digest,omitempty"` + Disk string `json:"disk" url:"disk"` + TargetStorage string `json:"storage" url:"storage"` + TargetStorageFormat *string `json:"format,omitempty" url:"format,omitempty"` +} + +// VirtualEnvironmentVMMoveDiskResponseBody contains the body from a VM move disk response. +type VirtualEnvironmentVMMoveDiskResponseBody struct { + Data *string `json:"data,omitempty"` +} + // VirtualEnvironmentVMRebootRequestBody contains the body for a VM reboot request. type VirtualEnvironmentVMRebootRequestBody struct { Timeout *int `json:"timeout,omitempty" url:"timeout,omitempty"` } +// VirtualEnvironmentVMRebootResponseBody contains the body from a VM reboot response. +type VirtualEnvironmentVMRebootResponseBody struct { + Data *string `json:"data,omitempty"` +} + +// VirtualEnvironmentVMResizeDiskRequestBody contains the body for a VM resize disk request. +type VirtualEnvironmentVMResizeDiskRequestBody struct { + Digest *string `json:"digest,omitempty" url:"digest,omitempty"` + Disk string `json:"disk" url:"disk"` + Size string `json:"size" url:"size"` + SkipLock *CustomBool `json:"skiplock,omitempty,int" url:"skiplock,omitempty,int"` +} + // VirtualEnvironmentVMShutdownRequestBody contains the body for a VM shutdown request. type VirtualEnvironmentVMShutdownRequestBody struct { ForceStop *CustomBool `json:"forceStop,omitempty,int" url:"forceStop,omitempty,int"` @@ -491,6 +539,26 @@ type VirtualEnvironmentVMShutdownRequestBody struct { Timeout *int `json:"timeout,omitempty" url:"timeout,omitempty"` } +// VirtualEnvironmentVMShutdownResponseBody contains the body from a VM shutdown response. +type VirtualEnvironmentVMShutdownResponseBody struct { + Data *string `json:"data,omitempty"` +} + +// VirtualEnvironmentVMStartResponseBody contains the body from a VM start response. +type VirtualEnvironmentVMStartResponseBody struct { + Data *string `json:"data,omitempty"` +} + +// VirtualEnvironmentVMStopResponseBody contains the body from a VM stop response. +type VirtualEnvironmentVMStopResponseBody struct { + Data *string `json:"data,omitempty"` +} + +// VirtualEnvironmentVMUpdateAsyncResponseBody contains the body from a VM async update response. +type VirtualEnvironmentVMUpdateAsyncResponseBody struct { + Data *string `json:"data,omitempty"` +} + // VirtualEnvironmentVMUpdateRequestBody contains the data for an virtual machine update request. type VirtualEnvironmentVMUpdateRequestBody VirtualEnvironmentVMCreateRequestBody @@ -988,7 +1056,7 @@ func (r CustomStorageDevice) EncodeValues(key string, v *url.Values) error { func (r CustomStorageDevices) EncodeValues(key string, v *url.Values) error { for i, d := range r { if d.Enabled { - d.EncodeValues(fmt.Sprintf("%s%d", key, i), v) + d.EncodeValues(i, v) } } @@ -1497,6 +1565,8 @@ func (r *CustomStorageDevice) UnmarshalJSON(b []byte) error { r.Media = &v[1] case "size": r.Size = &v[1] + case "format": + r.Format = &v[1] } } } diff --git a/proxmoxtf/data_source_virtual_environment_alias.go b/proxmoxtf/data_source_virtual_environment_alias.go new file mode 100644 index 0000000..ee7045b --- /dev/null +++ b/proxmoxtf/data_source_virtual_environment_alias.go @@ -0,0 +1,68 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +const ( + dvDataVirtualEnvironmentClusterAliasComment = "" + + mkDataSourceVirtualEnvironmentClusterAliasName = "name" + mkDataSourceVirtualEnvironmentClusterAliasCIDR = "cidr" + mkDataSourceVirtualEnvironmentClusterAliasComment = "comment" +) + +func dataSourceVirtualEnvironmentClusterAlias() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + mkDataSourceVirtualEnvironmentClusterAliasName: { + Type: schema.TypeString, + Description: "Alias name", + Required: true, + }, + mkDataSourceVirtualEnvironmentClusterAliasCIDR: { + Type: schema.TypeString, + Description: "IP/CIDR block", + Computed: true, + }, + mkDataSourceVirtualEnvironmentClusterAliasComment: { + Type: schema.TypeString, + Description: "Alias comment", + Computed: true, + }, + }, + Read: dataSourceVirtualEnvironmentAliasRead, + } +} + +func dataSourceVirtualEnvironmentAliasRead(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + AliasID := d.Get(mkDataSourceVirtualEnvironmentClusterAliasName).(string) + Alias, err := veClient.GetAlias(AliasID) + + if err != nil { + return err + } + + d.SetId(AliasID) + + d.Set(mkDataSourceVirtualEnvironmentClusterAliasCIDR, Alias.CIDR) + + if Alias.Comment != nil { + d.Set(mkDataSourceVirtualEnvironmentClusterAliasComment, Alias.Comment) + } else { + d.Set(mkDataSourceVirtualEnvironmentClusterAliasComment, dvDataVirtualEnvironmentClusterAliasComment) + } + + return nil +} diff --git a/proxmoxtf/data_source_virtual_environment_alias_test.go b/proxmoxtf/data_source_virtual_environment_alias_test.go new file mode 100644 index 0000000..9ed3bbf --- /dev/null +++ b/proxmoxtf/data_source_virtual_environment_alias_test.go @@ -0,0 +1,40 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +// TestDataSourceVirtualEnvironmentAliasInstantiation tests whether the DataSourceVirtualEnvironmentAlias instance can be instantiated. +func TestDataSourceVirtualEnvironmentAliasInstantiation(t *testing.T) { + s := dataSourceVirtualEnvironmentClusterAlias() + + if s == nil { + t.Fatalf("Cannot instantiate dataSourceVirtualEnvironmentAlias") + } +} + +// TestDataSourceVirtualEnvironmentAliasSchema tests the dataSourceVirtualEnvironmentAlias schema. +func TestDataSourceVirtualEnvironmentAliasSchema(t *testing.T) { + s := dataSourceVirtualEnvironmentClusterAlias() + + testRequiredArguments(t, s, []string{ + mkDataSourceVirtualEnvironmentClusterAliasName, + }) + + testComputedAttributes(t, s, []string{ + mkDataSourceVirtualEnvironmentClusterAliasCIDR, + mkDataSourceVirtualEnvironmentClusterAliasComment, + }) + + testValueTypes(t, s, map[string]schema.ValueType{ + mkDataSourceVirtualEnvironmentClusterAliasName: schema.TypeString, + mkDataSourceVirtualEnvironmentClusterAliasCIDR: schema.TypeString, + mkDataSourceVirtualEnvironmentClusterAliasComment: schema.TypeString, + }) +} diff --git a/proxmoxtf/data_source_virtual_environment_aliases.go b/proxmoxtf/data_source_virtual_environment_aliases.go new file mode 100644 index 0000000..5945e87 --- /dev/null +++ b/proxmoxtf/data_source_virtual_environment_aliases.go @@ -0,0 +1,54 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +const ( + mkDataSourceVirtualEnvironmentClusterAliasesAliasIDs = "alias_ids" +) + +func dataSourceVirtualEnvironmentClusterAliases() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + mkDataSourceVirtualEnvironmentClusterAliasesAliasIDs: { + Type: schema.TypeList, + Description: "Alias IDs", + Computed: true, + Elem: &schema.Schema{Type: schema.TypeString}, + }, + }, + Read: dataSourceVirtualEnvironmentClusterAliasesRead, + } +} + +func dataSourceVirtualEnvironmentClusterAliasesRead(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + list, err := veClient.ListPools() + + if err != nil { + return err + } + + aliasIDs := make([]interface{}, len(list)) + + for i, v := range list { + aliasIDs[i] = v.ID + } + + d.SetId("aliases") + + d.Set(mkDataSourceVirtualEnvironmentClusterAliasesAliasIDs, aliasIDs) + + return nil +} diff --git a/proxmoxtf/data_source_virtual_environment_aliases_test.go b/proxmoxtf/data_source_virtual_environment_aliases_test.go new file mode 100644 index 0000000..2f2331f --- /dev/null +++ b/proxmoxtf/data_source_virtual_environment_aliases_test.go @@ -0,0 +1,33 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +// TestDataSourceVirtualEnvironmentAliasesInstantiation tests whether the DataSourceVirtualEnvironmentAliases instance can be instantiated. +func TestDataSourceVirtualEnvironmentAliasesInstantiation(t *testing.T) { + s := dataSourceVirtualEnvironmentClusterAliases() + + if s == nil { + t.Fatalf("Cannot instantiate dataSourceVirtualEnvironmentAliases") + } +} + +// TestDataSourceVirtualEnvironmentAliasesSchema tests the dataSourceVirtualEnvironmentAliases schema. +func TestDataSourceVirtualEnvironmentAliasesSchema(t *testing.T) { + s := dataSourceVirtualEnvironmentClusterAliases() + + testComputedAttributes(t, s, []string{ + mkDataSourceVirtualEnvironmentClusterAliasesAliasIDs, + }) + + testValueTypes(t, s, map[string]schema.ValueType{ + mkDataSourceVirtualEnvironmentClusterAliasesAliasIDs: schema.TypeList, + }) +} diff --git a/proxmoxtf/data_source_virtual_environment_datastores.go b/proxmoxtf/data_source_virtual_environment_datastores.go index 890440b..d1f3a51 100644 --- a/proxmoxtf/data_source_virtual_environment_datastores.go +++ b/proxmoxtf/data_source_virtual_environment_datastores.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "fmt" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_datastores_test.go b/proxmoxtf/data_source_virtual_environment_datastores_test.go index 8f20951..401a5c2 100644 --- a/proxmoxtf/data_source_virtual_environment_datastores_test.go +++ b/proxmoxtf/data_source_virtual_environment_datastores_test.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "testing" ) diff --git a/proxmoxtf/data_source_virtual_environment_dns.go b/proxmoxtf/data_source_virtual_environment_dns.go index 9d4df2d..945a275 100644 --- a/proxmoxtf/data_source_virtual_environment_dns.go +++ b/proxmoxtf/data_source_virtual_environment_dns.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "fmt" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_dns_test.go b/proxmoxtf/data_source_virtual_environment_dns_test.go index 47dfe3b..a279322 100644 --- a/proxmoxtf/data_source_virtual_environment_dns_test.go +++ b/proxmoxtf/data_source_virtual_environment_dns_test.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "testing" ) diff --git a/proxmoxtf/data_source_virtual_environment_group.go b/proxmoxtf/data_source_virtual_environment_group.go index 3e03411..592d70a 100644 --- a/proxmoxtf/data_source_virtual_environment_group.go +++ b/proxmoxtf/data_source_virtual_environment_group.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_group_test.go b/proxmoxtf/data_source_virtual_environment_group_test.go index d763944..8b97848 100644 --- a/proxmoxtf/data_source_virtual_environment_group_test.go +++ b/proxmoxtf/data_source_virtual_environment_group_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentGroupInstantiation tests whether the DataSourceVirtualEnvironmentGroup instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_groups.go b/proxmoxtf/data_source_virtual_environment_groups.go index 4d4a6b5..2239345 100644 --- a/proxmoxtf/data_source_virtual_environment_groups.go +++ b/proxmoxtf/data_source_virtual_environment_groups.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_groups_test.go b/proxmoxtf/data_source_virtual_environment_groups_test.go index 32bf5eb..d98fccc 100644 --- a/proxmoxtf/data_source_virtual_environment_groups_test.go +++ b/proxmoxtf/data_source_virtual_environment_groups_test.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "testing" ) diff --git a/proxmoxtf/data_source_virtual_environment_hosts.go b/proxmoxtf/data_source_virtual_environment_hosts.go index af13d17..5f6927e 100644 --- a/proxmoxtf/data_source_virtual_environment_hosts.go +++ b/proxmoxtf/data_source_virtual_environment_hosts.go @@ -8,7 +8,7 @@ import ( "fmt" "strings" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_hosts_test.go b/proxmoxtf/data_source_virtual_environment_hosts_test.go index 35be566..669a7d5 100644 --- a/proxmoxtf/data_source_virtual_environment_hosts_test.go +++ b/proxmoxtf/data_source_virtual_environment_hosts_test.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "testing" ) diff --git a/proxmoxtf/data_source_virtual_environment_nodes.go b/proxmoxtf/data_source_virtual_environment_nodes.go index 56000ab..fc9a5ae 100644 --- a/proxmoxtf/data_source_virtual_environment_nodes.go +++ b/proxmoxtf/data_source_virtual_environment_nodes.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "math" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_nodes_test.go b/proxmoxtf/data_source_virtual_environment_nodes_test.go index ff9c2bf..eb8141e 100644 --- a/proxmoxtf/data_source_virtual_environment_nodes_test.go +++ b/proxmoxtf/data_source_virtual_environment_nodes_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentNodesInstantiation tests whether the DataSourceVirtualEnvironmentNodes instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_pool.go b/proxmoxtf/data_source_virtual_environment_pool.go index 828a540..4059f87 100644 --- a/proxmoxtf/data_source_virtual_environment_pool.go +++ b/proxmoxtf/data_source_virtual_environment_pool.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_pool_test.go b/proxmoxtf/data_source_virtual_environment_pool_test.go index d9cca8e..6a9106d 100644 --- a/proxmoxtf/data_source_virtual_environment_pool_test.go +++ b/proxmoxtf/data_source_virtual_environment_pool_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentPoolInstantiation tests whether the DataSourceVirtualEnvironmentPool instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_pools.go b/proxmoxtf/data_source_virtual_environment_pools.go index 8c8fb66..77f7b60 100644 --- a/proxmoxtf/data_source_virtual_environment_pools.go +++ b/proxmoxtf/data_source_virtual_environment_pools.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_pools_test.go b/proxmoxtf/data_source_virtual_environment_pools_test.go index c3f1e8d..d2af819 100644 --- a/proxmoxtf/data_source_virtual_environment_pools_test.go +++ b/proxmoxtf/data_source_virtual_environment_pools_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentPoolsInstantiation tests whether the DataSourceVirtualEnvironmentPools instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_role.go b/proxmoxtf/data_source_virtual_environment_role.go index 844bffc..288d81e 100644 --- a/proxmoxtf/data_source_virtual_environment_role.go +++ b/proxmoxtf/data_source_virtual_environment_role.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_role_test.go b/proxmoxtf/data_source_virtual_environment_role_test.go index 90a983c..ddbac56 100644 --- a/proxmoxtf/data_source_virtual_environment_role_test.go +++ b/proxmoxtf/data_source_virtual_environment_role_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentRoleInstantiation tests whether the DataSourceVirtualEnvironmentRole instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_roles.go b/proxmoxtf/data_source_virtual_environment_roles.go index 79d5899..297f8a9 100644 --- a/proxmoxtf/data_source_virtual_environment_roles.go +++ b/proxmoxtf/data_source_virtual_environment_roles.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_roles_test.go b/proxmoxtf/data_source_virtual_environment_roles_test.go index a305917..fa375e9 100644 --- a/proxmoxtf/data_source_virtual_environment_roles_test.go +++ b/proxmoxtf/data_source_virtual_environment_roles_test.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" "testing" ) diff --git a/proxmoxtf/data_source_virtual_environment_time.go b/proxmoxtf/data_source_virtual_environment_time.go index 3b56256..b05a3e9 100644 --- a/proxmoxtf/data_source_virtual_environment_time.go +++ b/proxmoxtf/data_source_virtual_environment_time.go @@ -8,7 +8,7 @@ import ( "fmt" "time" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_time_test.go b/proxmoxtf/data_source_virtual_environment_time_test.go index 7333708..a45ba03 100644 --- a/proxmoxtf/data_source_virtual_environment_time_test.go +++ b/proxmoxtf/data_source_virtual_environment_time_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentTimeInstantiation tests whether the DataSourceVirtualEnvironmentRoles instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_user.go b/proxmoxtf/data_source_virtual_environment_user.go index 13e4028..7755dd8 100644 --- a/proxmoxtf/data_source_virtual_environment_user.go +++ b/proxmoxtf/data_source_virtual_environment_user.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "time" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_user_test.go b/proxmoxtf/data_source_virtual_environment_user_test.go index ff2846b..9353cfa 100644 --- a/proxmoxtf/data_source_virtual_environment_user_test.go +++ b/proxmoxtf/data_source_virtual_environment_user_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentUserInstantiation tests whether the DataSourceVirtualEnvironmentUser instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_users.go b/proxmoxtf/data_source_virtual_environment_users.go index cdabdfe..d7b8510 100644 --- a/proxmoxtf/data_source_virtual_environment_users.go +++ b/proxmoxtf/data_source_virtual_environment_users.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "time" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_users_test.go b/proxmoxtf/data_source_virtual_environment_users_test.go index d14d257..376c36b 100644 --- a/proxmoxtf/data_source_virtual_environment_users_test.go +++ b/proxmoxtf/data_source_virtual_environment_users_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentUsersInstantiation tests whether the DataSourceVirtualEnvironmentUsers instance can be instantiated. diff --git a/proxmoxtf/data_source_virtual_environment_version.go b/proxmoxtf/data_source_virtual_environment_version.go index 0d07922..be12638 100644 --- a/proxmoxtf/data_source_virtual_environment_version.go +++ b/proxmoxtf/data_source_virtual_environment_version.go @@ -5,7 +5,7 @@ package proxmoxtf import ( - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/data_source_virtual_environment_version_test.go b/proxmoxtf/data_source_virtual_environment_version_test.go index 6d935a1..30e1fe0 100644 --- a/proxmoxtf/data_source_virtual_environment_version_test.go +++ b/proxmoxtf/data_source_virtual_environment_version_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestDataSourceVirtualEnvironmentVersionInstantiation tests whether the DataSourceVirtualEnvironmentVersion instance can be instantiated. diff --git a/proxmoxtf/provider.go b/proxmoxtf/provider.go index 7d2b514..6d692c4 100644 --- a/proxmoxtf/provider.go +++ b/proxmoxtf/provider.go @@ -10,7 +10,7 @@ import ( "os" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( @@ -36,33 +36,37 @@ func Provider() *schema.Provider { return &schema.Provider{ ConfigureFunc: providerConfigure, DataSourcesMap: map[string]*schema.Resource{ - "proxmox_virtual_environment_datastores": dataSourceVirtualEnvironmentDatastores(), - "proxmox_virtual_environment_dns": dataSourceVirtualEnvironmentDNS(), - "proxmox_virtual_environment_group": dataSourceVirtualEnvironmentGroup(), - "proxmox_virtual_environment_groups": dataSourceVirtualEnvironmentGroups(), - "proxmox_virtual_environment_hosts": dataSourceVirtualEnvironmentHosts(), - "proxmox_virtual_environment_nodes": dataSourceVirtualEnvironmentNodes(), - "proxmox_virtual_environment_pool": dataSourceVirtualEnvironmentPool(), - "proxmox_virtual_environment_pools": dataSourceVirtualEnvironmentPools(), - "proxmox_virtual_environment_role": dataSourceVirtualEnvironmentRole(), - "proxmox_virtual_environment_roles": dataSourceVirtualEnvironmentRoles(), - "proxmox_virtual_environment_time": dataSourceVirtualEnvironmentTime(), - "proxmox_virtual_environment_user": dataSourceVirtualEnvironmentUser(), - "proxmox_virtual_environment_users": dataSourceVirtualEnvironmentUsers(), - "proxmox_virtual_environment_version": dataSourceVirtualEnvironmentVersion(), + "proxmox_virtual_environment_cluster_alias": dataSourceVirtualEnvironmentClusterAlias(), + "proxmox_virtual_environment_cluster_aliases": dataSourceVirtualEnvironmentClusterAliases(), + "proxmox_virtual_environment_datastores": dataSourceVirtualEnvironmentDatastores(), + "proxmox_virtual_environment_dns": dataSourceVirtualEnvironmentDNS(), + "proxmox_virtual_environment_group": dataSourceVirtualEnvironmentGroup(), + "proxmox_virtual_environment_groups": dataSourceVirtualEnvironmentGroups(), + "proxmox_virtual_environment_hosts": dataSourceVirtualEnvironmentHosts(), + "proxmox_virtual_environment_nodes": dataSourceVirtualEnvironmentNodes(), + "proxmox_virtual_environment_pool": dataSourceVirtualEnvironmentPool(), + "proxmox_virtual_environment_pools": dataSourceVirtualEnvironmentPools(), + "proxmox_virtual_environment_role": dataSourceVirtualEnvironmentRole(), + "proxmox_virtual_environment_roles": dataSourceVirtualEnvironmentRoles(), + "proxmox_virtual_environment_time": dataSourceVirtualEnvironmentTime(), + "proxmox_virtual_environment_user": dataSourceVirtualEnvironmentUser(), + "proxmox_virtual_environment_users": dataSourceVirtualEnvironmentUsers(), + "proxmox_virtual_environment_version": dataSourceVirtualEnvironmentVersion(), }, ResourcesMap: map[string]*schema.Resource{ - "proxmox_virtual_environment_certificate": resourceVirtualEnvironmentCertificate(), - "proxmox_virtual_environment_container": resourceVirtualEnvironmentContainer(), - "proxmox_virtual_environment_dns": resourceVirtualEnvironmentDNS(), - "proxmox_virtual_environment_file": resourceVirtualEnvironmentFile(), - "proxmox_virtual_environment_group": resourceVirtualEnvironmentGroup(), - "proxmox_virtual_environment_hosts": resourceVirtualEnvironmentHosts(), - "proxmox_virtual_environment_pool": resourceVirtualEnvironmentPool(), - "proxmox_virtual_environment_role": resourceVirtualEnvironmentRole(), - "proxmox_virtual_environment_time": resourceVirtualEnvironmentTime(), - "proxmox_virtual_environment_user": resourceVirtualEnvironmentUser(), - "proxmox_virtual_environment_vm": resourceVirtualEnvironmentVM(), + "proxmox_virtual_environment_certificate": resourceVirtualEnvironmentCertificate(), + "proxmox_virtual_environment_cluster_alias": resourceVirtualEnvironmentClusterAlias(), + "proxmox_virtual_environment_cluster_ipset": resourceVirtualEnvironmentClusterIPSet(), + "proxmox_virtual_environment_container": resourceVirtualEnvironmentContainer(), + "proxmox_virtual_environment_dns": resourceVirtualEnvironmentDNS(), + "proxmox_virtual_environment_file": resourceVirtualEnvironmentFile(), + "proxmox_virtual_environment_group": resourceVirtualEnvironmentGroup(), + "proxmox_virtual_environment_hosts": resourceVirtualEnvironmentHosts(), + "proxmox_virtual_environment_pool": resourceVirtualEnvironmentPool(), + "proxmox_virtual_environment_role": resourceVirtualEnvironmentRole(), + "proxmox_virtual_environment_time": resourceVirtualEnvironmentTime(), + "proxmox_virtual_environment_user": resourceVirtualEnvironmentUser(), + "proxmox_virtual_environment_vm": resourceVirtualEnvironmentVM(), }, Schema: map[string]*schema.Schema{ mkProviderVirtualEnvironment: { diff --git a/proxmoxtf/provider_test.go b/proxmoxtf/provider_test.go index ce5f243..fd994a3 100644 --- a/proxmoxtf/provider_test.go +++ b/proxmoxtf/provider_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestProviderInstantiation() tests whether the Provider instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_certificate.go b/proxmoxtf/resource_virtual_environment_certificate.go index 42dfc0c..79a81ff 100644 --- a/proxmoxtf/resource_virtual_environment_certificate.go +++ b/proxmoxtf/resource_virtual_environment_certificate.go @@ -10,7 +10,7 @@ import ( "time" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_certificate_test.go b/proxmoxtf/resource_virtual_environment_certificate_test.go index 3692b12..9a5e214 100644 --- a/proxmoxtf/resource_virtual_environment_certificate_test.go +++ b/proxmoxtf/resource_virtual_environment_certificate_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentCertificateInstantiation tests whether the ResourceVirtualEnvironmentCertificate instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_cluster_alias.go b/proxmoxtf/resource_virtual_environment_cluster_alias.go new file mode 100644 index 0000000..2a8a99c --- /dev/null +++ b/proxmoxtf/resource_virtual_environment_cluster_alias.go @@ -0,0 +1,170 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "strings" + + "github.com/danitso/terraform-provider-proxmox/proxmox" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +const ( + dvResourceVirtualEnvironmentClusterAliasComment = "" + + mkResourceVirtualEnvironmentClusterAliasName = "name" + mkResourceVirtualEnvironmentClusterAliasCIDR = "cidr" + mkResourceVirtualEnvironmentClusterAliasComment = "comment" +) + +func resourceVirtualEnvironmentClusterAlias() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + mkResourceVirtualEnvironmentClusterAliasName: { + Type: schema.TypeString, + Description: "Alias name", + Required: true, + ForceNew: false, + }, + mkResourceVirtualEnvironmentClusterAliasCIDR: { + Type: schema.TypeString, + Description: "IP/CIDR block", + Required: true, + ForceNew: false, + }, + mkResourceVirtualEnvironmentClusterAliasComment: { + Type: schema.TypeString, + Description: "Alias comment", + Optional: true, + Default: dvResourceVirtualEnvironmentClusterAliasComment, + }, + }, + Create: resourceVirtualEnvironmentClusterAliasCreate, + Read: resourceVirtualEnvironmentClusterAliasRead, + Update: resourceVirtualEnvironmentClusterAliasUpdate, + Delete: resourceVirtualEnvironmentClusterAliasDelete, + } +} + +func resourceVirtualEnvironmentClusterAliasCreate(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + comment := d.Get(mkResourceVirtualEnvironmentClusterAliasComment).(string) + name := d.Get(mkResourceVirtualEnvironmentClusterAliasName).(string) + cidr := d.Get(mkResourceVirtualEnvironmentClusterAliasCIDR).(string) + + body := &proxmox.VirtualEnvironmentClusterAliasCreateRequestBody{ + Comment: &comment, + Name: name, + CIDR: cidr, + } + + err = veClient.CreateAlias(body) + + if err != nil { + return err + } + + d.SetId(name) + + return resourceVirtualEnvironmentClusterAliasRead(d, m) +} + +func resourceVirtualEnvironmentClusterAliasRead(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + name := d.Id() + alias, err := veClient.GetAlias(name) + + if err != nil { + if strings.Contains(err.Error(), "HTTP 404") { + d.SetId("") + return nil + } + + return err + } + + aliasMap := map[string]interface{}{ + mkResourceVirtualEnvironmentClusterAliasComment: alias.Comment, + mkResourceVirtualEnvironmentClusterAliasName: alias.Name, + mkResourceVirtualEnvironmentClusterAliasCIDR: alias.CIDR, + } + + for key, val := range aliasMap { + err = d.Set(key, val) + + if err != nil { + return err + } + } + + return nil +} + +func resourceVirtualEnvironmentClusterAliasUpdate(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + comment := d.Get(mkResourceVirtualEnvironmentClusterAliasComment).(string) + cidr := d.Get(mkResourceVirtualEnvironmentClusterAliasCIDR).(string) + newName := d.Get(mkResourceVirtualEnvironmentClusterAliasName).(string) + previousName := d.Id() + + body := &proxmox.VirtualEnvironmentClusterAliasUpdateRequestBody{ + ReName: newName, + CIDR: cidr, + Comment: &comment, + } + + err = veClient.UpdateAlias(previousName, body) + + if err != nil { + return err + } + + d.SetId(newName) + + return resourceVirtualEnvironmentClusterAliasRead(d, m) +} + +func resourceVirtualEnvironmentClusterAliasDelete(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return nil + } + + name := d.Id() + err = veClient.DeleteAlias(name) + + if err != nil { + if strings.Contains(err.Error(), "HTTP 404") { + d.SetId("") + return nil + } + + return err + } + + d.SetId("") + + return nil +} diff --git a/proxmoxtf/resource_virtual_environment_cluster_alias_test.go b/proxmoxtf/resource_virtual_environment_cluster_alias_test.go new file mode 100644 index 0000000..bb30ae4 --- /dev/null +++ b/proxmoxtf/resource_virtual_environment_cluster_alias_test.go @@ -0,0 +1,40 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +// TestResourceVirtualEnvironmentAliasInstantiation tests whether the ResourceVirtualEnvironmentAlias instance can be instantiated. +func TestResourceVirtualEnvironmentAliasInstantiation(t *testing.T) { + s := resourceVirtualEnvironmentClusterAlias() + + if s == nil { + t.Fatalf("Cannot instantiate resourceVirtualEnvironmentAlias") + } +} + +// TestResourceVirtualEnvironmentAliasSchema tests the resourceVirtualEnvironmentAlias schema. +func TestResourceVirtualEnvironmentAliasSchema(t *testing.T) { + s := resourceVirtualEnvironmentClusterAlias() + + testRequiredArguments(t, s, []string{ + mkResourceVirtualEnvironmentClusterAliasName, + mkResourceVirtualEnvironmentClusterAliasCIDR, + }) + + testOptionalArguments(t, s, []string{ + mkResourceVirtualEnvironmentClusterAliasComment, + }) + + testValueTypes(t, s, map[string]schema.ValueType{ + mkResourceVirtualEnvironmentClusterAliasName: schema.TypeString, + mkResourceVirtualEnvironmentClusterAliasCIDR: schema.TypeString, + mkResourceVirtualEnvironmentClusterAliasComment: schema.TypeString, + }) +} diff --git a/proxmoxtf/resource_virtual_environment_cluster_ipset.go b/proxmoxtf/resource_virtual_environment_cluster_ipset.go new file mode 100644 index 0000000..a0e8602 --- /dev/null +++ b/proxmoxtf/resource_virtual_environment_cluster_ipset.go @@ -0,0 +1,256 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "strings" + + "github.com/danitso/terraform-provider-proxmox/proxmox" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +const ( + dvResourceVirtualEnvironmentClusterIPSetCIDRComment = "" + dvResourceVirtualEnvironmentClusterIPSetCIDRNoMatch = false + + mkResourceVirtualEnvironmentClusterIPSetName = "name" + mkResourceVirtualEnvironmentClusterIPSetCIDR = "cidr" + mkResourceVirtualEnvironmentClusterIPSetCIDRName = "name" + mkResourceVirtualEnvironmentClusterIPSetCIDRComment = "comment" + mkResourceVirtualEnvironmentClusterIPSetCIDRNoMatch = "nomatch" +) + +func resourceVirtualEnvironmentClusterIPSet() *schema.Resource { + return &schema.Resource{ + Schema: map[string]*schema.Schema{ + mkResourceVirtualEnvironmentClusterIPSetName: { + Type: schema.TypeString, + Description: "IPSet name", + Required: true, + ForceNew: false, + }, + mkResourceVirtualEnvironmentClusterIPSetCIDR: { + Type: schema.TypeList, + Description: "List of IP or Networks", + Optional: true, + ForceNew: true, + DefaultFunc: func() (interface{}, error) { + return []interface{}{}, nil + }, + Elem: &schema.Resource{ + Schema: map[string]*schema.Schema{ + mkResourceVirtualEnvironmentClusterIPSetCIDRName: { + Type: schema.TypeString, + Description: "Network/IP specification in CIDR format", + Required: true, + ForceNew: true, + }, + mkResourceVirtualEnvironmentClusterIPSetCIDRNoMatch: { + Type: schema.TypeBool, + Description: "No match this IP/CIDR", + Optional: true, + Default: dvResourceVirtualEnvironmentClusterIPSetCIDRNoMatch, + ForceNew: true, + }, + mkResourceVirtualEnvironmentClusterIPSetCIDRComment: { + Type: schema.TypeString, + Description: "IP/CIDR comment", + Optional: true, + Default: dvResourceVirtualEnvironmentClusterIPSetCIDRComment, + ForceNew: true, + }, + }, + }, + }, + mkResourceVirtualEnvironmentClusterIPSetCIDRComment: { + Type: schema.TypeString, + Description: "IPSet comment", + Optional: true, + Default: dvResourceVirtualEnvironmentClusterIPSetCIDRComment, + }, + }, + Create: resourceVirtualEnvironmentClusterIPSetCreate, + Read: resourceVirtualEnvironmentClusterIPSetRead, + Update: resourceVirtualEnvironmentClusterIPSetUpdate, + Delete: resourceVirtualEnvironmentClusterIPSetDelete, + } +} + +func resourceVirtualEnvironmentClusterIPSetCreate(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + comment := d.Get(mkResourceVirtualEnvironmentClusterIPSetCIDRComment).(string) + name := d.Get(mkResourceVirtualEnvironmentClusterIPSetName).(string) + + IPSets := d.Get(mkResourceVirtualEnvironmentClusterIPSetCIDR).([]interface{}) + IPSetsArray := make(proxmox.VirtualEnvironmentClusterIPSetContent, len(IPSets)) + + for i, v := range IPSets { + IPSetMap := v.(map[string]interface{}) + IPSetObject := proxmox.VirtualEnvironmentClusterIPSetGetResponseData{} + + cidr := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetCIDRName].(string) + noMatch := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetCIDRNoMatch].(bool) + comment := IPSetMap[mkResourceVirtualEnvironmentClusterIPSetCIDRComment].(string) + + IPSetObject.Comment = comment + IPSetObject.CIDR = cidr + + if noMatch { + noMatchBool := proxmox.CustomBool(true) + IPSetObject.NoMatch = &noMatchBool + } + + IPSetsArray[i] = IPSetObject + } + + body := &proxmox.VirtualEnvironmentClusterIPSetCreateRequestBody{ + Comment: comment, + Name: name, + } + + err = veClient.CreateIPSet(body) + + if err != nil { + return err + } + + for _, v := range IPSetsArray { + err = veClient.AddCIDRToIPSet(name, &v) + + if err != nil { + return err + } + } + + d.SetId(name) + return resourceVirtualEnvironmentClusterIPSetRead(d, m) +} + +func resourceVirtualEnvironmentClusterIPSetRead(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + name := d.Id() + + allIPSets, err := veClient.GetListIPSets() + + if err != nil { + return err + } + + for _, v := range allIPSets.Data { + if v.Name == name { + err = d.Set(mkResourceVirtualEnvironmentClusterIPSetName, v.Name) + + if err != nil { + return err + } + + err = d.Set(mkResourceVirtualEnvironmentClusterIPSetCIDRComment, v.Comment) + + if err != nil { + return err + } + } + } + + IPSet, err := veClient.GetListIPSetContent(name) + + if err != nil { + if strings.Contains(err.Error(), "HTTP 404") { + d.SetId("") + return nil + } + + return err + } + + for key, _ := range IPSet { + d.Set(mkResourceVirtualEnvironmentClusterIPSetCIDR, IPSet[key]) + } + + return nil +} + +func resourceVirtualEnvironmentClusterIPSetUpdate(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return err + } + + comment := d.Get(mkResourceVirtualEnvironmentClusterIPSetCIDRComment).(string) + newName := d.Get(mkResourceVirtualEnvironmentClusterIPSetName).(string) + previousName := d.Id() + + body := &proxmox.VirtualEnvironmentClusterIPSetUpdateRequestBody{ + ReName: previousName, + Name: newName, + Comment: &comment, + } + + err = veClient.UpdateIPSet(body) + + if err != nil { + return err + } + + d.SetId(newName) + + return resourceVirtualEnvironmentClusterIPSetRead(d, m) +} + +func resourceVirtualEnvironmentClusterIPSetDelete(d *schema.ResourceData, m interface{}) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + + if err != nil { + return nil + } + + name := d.Id() + + IPSetContent, err := veClient.GetListIPSetContent(name) + + if err != nil { + return err + } + + // PVE requires content of IPSet be cleared before removal + if len(IPSetContent) > 0 { + for _, IPSet := range IPSetContent { + err = veClient.DeleteIPSetContent(name, IPSet.CIDR) + if err != nil { + return err + } + } + } + + err = veClient.DeleteIPSet(name) + + if err != nil { + if strings.Contains(err.Error(), "HTTP 404") { + d.SetId("") + return nil + } + + return err + } + + d.SetId("") + + return nil +} diff --git a/proxmoxtf/resource_virtual_environment_cluster_ipset_test.go b/proxmoxtf/resource_virtual_environment_cluster_ipset_test.go new file mode 100644 index 0000000..56edb67 --- /dev/null +++ b/proxmoxtf/resource_virtual_environment_cluster_ipset_test.go @@ -0,0 +1,59 @@ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. */ + +package proxmoxtf + +import ( + "testing" + + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" +) + +// TestResourceVirtualEnvironmentIPSetInstantiation tests whether the resourceVirtualEnvironmentClusterIPSet +// instance can be instantiated. +func TestResourceVirtualEnvironmentIPSetInstantiation(t *testing.T) { + s := resourceVirtualEnvironmentClusterIPSet() + + if s == nil { + t.Fatalf("Cannot instantiate resourceVirtualEnvironmentAlias") + } +} + +// TestResourceVirtualEnvironmentIPSetSchema tests the resourceVirtualEnvironmentClusterIPSet schema. +func TestResourceVirtualEnvironmentIPSetSchema(t *testing.T) { + s := resourceVirtualEnvironmentClusterIPSet() + + testRequiredArguments(t, s, []string{ + mkResourceVirtualEnvironmentClusterIPSetName, + }) + + testOptionalArguments(t, s, []string{ + mkResourceVirtualEnvironmentClusterIPSetCIDR, + mkResourceVirtualEnvironmentClusterIPSetCIDRComment, + }) + + testValueTypes(t, s, map[string]schema.ValueType{ + mkResourceVirtualEnvironmentClusterIPSetName: schema.TypeString, + mkResourceVirtualEnvironmentClusterIPSetCIDR: schema.TypeList, + mkResourceVirtualEnvironmentClusterIPSetCIDRComment: schema.TypeString, + }) + + IPSetSchema := testNestedSchemaExistence(t, s, mkResourceVirtualEnvironmentClusterIPSetCIDR) + + testRequiredArguments(t, IPSetSchema, []string{ + mkResourceVirtualEnvironmentClusterIPSetCIDRName, + }) + + testOptionalArguments(t, IPSetSchema, []string{ + mkResourceVirtualEnvironmentClusterIPSetCIDRComment, + mkResourceVirtualEnvironmentClusterIPSetCIDRNoMatch, + }) + + testValueTypes(t, IPSetSchema, map[string]schema.ValueType{ + mkResourceVirtualEnvironmentClusterIPSetCIDRName: schema.TypeString, + mkResourceVirtualEnvironmentClusterIPSetCIDRComment: schema.TypeString, + mkResourceVirtualEnvironmentClusterIPSetCIDRNoMatch: schema.TypeBool, + }) + +} diff --git a/proxmoxtf/resource_virtual_environment_container.go b/proxmoxtf/resource_virtual_environment_container.go index 6ff8be8..c9f5b8d 100644 --- a/proxmoxtf/resource_virtual_environment_container.go +++ b/proxmoxtf/resource_virtual_environment_container.go @@ -10,8 +10,8 @@ import ( "strings" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_container_test.go b/proxmoxtf/resource_virtual_environment_container_test.go index 409b358..e29bc36 100644 --- a/proxmoxtf/resource_virtual_environment_container_test.go +++ b/proxmoxtf/resource_virtual_environment_container_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentContainerInstantiation tests whether the ResourceVirtualEnvironmentContainer instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_dns.go b/proxmoxtf/resource_virtual_environment_dns.go index 63ee205..b4e294c 100644 --- a/proxmoxtf/resource_virtual_environment_dns.go +++ b/proxmoxtf/resource_virtual_environment_dns.go @@ -8,7 +8,7 @@ import ( "fmt" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_dns_test.go b/proxmoxtf/resource_virtual_environment_dns_test.go index dbf1727..b7ea37a 100644 --- a/proxmoxtf/resource_virtual_environment_dns_test.go +++ b/proxmoxtf/resource_virtual_environment_dns_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentDNSInstantiation tests whether the ResourceVirtualEnvironmentDNS instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_file.go b/proxmoxtf/resource_virtual_environment_file.go index badde67..c00f918 100644 --- a/proxmoxtf/resource_virtual_environment_file.go +++ b/proxmoxtf/resource_virtual_environment_file.go @@ -20,7 +20,7 @@ import ( "time" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_file_test.go b/proxmoxtf/resource_virtual_environment_file_test.go index 562aff6..23e7534 100644 --- a/proxmoxtf/resource_virtual_environment_file_test.go +++ b/proxmoxtf/resource_virtual_environment_file_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentFileInstantiation tests whether the ResourceVirtualEnvironmentFile instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_group.go b/proxmoxtf/resource_virtual_environment_group.go index a3a3e10..0c619b8 100644 --- a/proxmoxtf/resource_virtual_environment_group.go +++ b/proxmoxtf/resource_virtual_environment_group.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_group_test.go b/proxmoxtf/resource_virtual_environment_group_test.go index 8efd2ab..028710e 100644 --- a/proxmoxtf/resource_virtual_environment_group_test.go +++ b/proxmoxtf/resource_virtual_environment_group_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentGroupInstantiation tests whether the ResourceVirtualEnvironmentGroup instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_hosts.go b/proxmoxtf/resource_virtual_environment_hosts.go index 914ed9e..7da8446 100644 --- a/proxmoxtf/resource_virtual_environment_hosts.go +++ b/proxmoxtf/resource_virtual_environment_hosts.go @@ -9,7 +9,7 @@ import ( "strings" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_hosts_test.go b/proxmoxtf/resource_virtual_environment_hosts_test.go index 5bb9ba6..9cc2b9a 100644 --- a/proxmoxtf/resource_virtual_environment_hosts_test.go +++ b/proxmoxtf/resource_virtual_environment_hosts_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentHostsInstantiation tests whether the ResourceVirtualEnvironmentHosts instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_pool.go b/proxmoxtf/resource_virtual_environment_pool.go index a40b4fd..f5b76f8 100644 --- a/proxmoxtf/resource_virtual_environment_pool.go +++ b/proxmoxtf/resource_virtual_environment_pool.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_pool_test.go b/proxmoxtf/resource_virtual_environment_pool_test.go index 044c0e8..138c412 100644 --- a/proxmoxtf/resource_virtual_environment_pool_test.go +++ b/proxmoxtf/resource_virtual_environment_pool_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentPoolInstantiation tests whether the ResourceVirtualEnvironmentPool instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_role.go b/proxmoxtf/resource_virtual_environment_role.go index 50b2f75..b87731b 100644 --- a/proxmoxtf/resource_virtual_environment_role.go +++ b/proxmoxtf/resource_virtual_environment_role.go @@ -8,7 +8,7 @@ import ( "strings" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_role_test.go b/proxmoxtf/resource_virtual_environment_role_test.go index 149dd7e..9331cdb 100644 --- a/proxmoxtf/resource_virtual_environment_role_test.go +++ b/proxmoxtf/resource_virtual_environment_role_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentRoleInstantiation tests whether the ResourceVirtualEnvironmentRole instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_time.go b/proxmoxtf/resource_virtual_environment_time.go index bdd1137..7a64440 100644 --- a/proxmoxtf/resource_virtual_environment_time.go +++ b/proxmoxtf/resource_virtual_environment_time.go @@ -9,7 +9,7 @@ import ( "time" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_time_test.go b/proxmoxtf/resource_virtual_environment_time_test.go index fe4d912..0e0fda8 100644 --- a/proxmoxtf/resource_virtual_environment_time_test.go +++ b/proxmoxtf/resource_virtual_environment_time_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentTimeInstantiation tests whether the ResourceVirtualEnvironmentTime instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_user.go b/proxmoxtf/resource_virtual_environment_user.go index b1c6d7f..f2c50ef 100644 --- a/proxmoxtf/resource_virtual_environment_user.go +++ b/proxmoxtf/resource_virtual_environment_user.go @@ -9,8 +9,8 @@ import ( "time" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) const ( diff --git a/proxmoxtf/resource_virtual_environment_user_test.go b/proxmoxtf/resource_virtual_environment_user_test.go index 34e00d7..68b3bdf 100644 --- a/proxmoxtf/resource_virtual_environment_user_test.go +++ b/proxmoxtf/resource_virtual_environment_user_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentUserInstantiation tests whether the ResourceVirtualEnvironmentUser instance can be instantiated. diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index d40eac0..48fba72 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -5,18 +5,21 @@ package proxmoxtf import ( + "errors" "fmt" - "math" + "sort" "strconv" "strings" "time" "github.com/danitso/terraform-provider-proxmox/proxmox" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) const ( + dvResourceVirtualEnvironmentVMRebootAfterCreation = false + dvResourceVirtualEnvironmentVMOnBoot = false dvResourceVirtualEnvironmentVMACPI = true dvResourceVirtualEnvironmentVMAgentEnabled = false dvResourceVirtualEnvironmentVMAgentTimeout = "15m" @@ -31,6 +34,7 @@ const ( dvResourceVirtualEnvironmentVMCloneDatastoreID = "" dvResourceVirtualEnvironmentVMCloneNodeName = "" dvResourceVirtualEnvironmentVMCloneFull = true + dvResourceVirtualEnvironmentVMCloneRetries = 1 dvResourceVirtualEnvironmentVMCPUArchitecture = "x86_64" dvResourceVirtualEnvironmentVMCPUCores = 1 dvResourceVirtualEnvironmentVMCPUHotplugged = 0 @@ -38,6 +42,7 @@ const ( dvResourceVirtualEnvironmentVMCPUType = "qemu64" dvResourceVirtualEnvironmentVMCPUUnits = 1024 dvResourceVirtualEnvironmentVMDescription = "" + dvResourcevirtualEnvironmentVMDiskInterface = "scsi0" dvResourceVirtualEnvironmentVMDiskDatastoreID = "local-lvm" dvResourceVirtualEnvironmentVMDiskFileFormat = "qcow2" dvResourceVirtualEnvironmentVMDiskFileID = "" @@ -55,6 +60,7 @@ const ( dvResourceVirtualEnvironmentVMInitializationIPConfigIPv6Gateway = "" dvResourceVirtualEnvironmentVMInitializationUserAccountPassword = "" dvResourceVirtualEnvironmentVMInitializationUserDataFileID = "" + dvResourceVirtualEnvironmentVMInitializationType = "" dvResourceVirtualEnvironmentVMKeyboardLayout = "en-us" dvResourceVirtualEnvironmentVMMemoryDedicated = 512 dvResourceVirtualEnvironmentVMMemoryFloating = 0 @@ -72,6 +78,12 @@ const ( dvResourceVirtualEnvironmentVMStarted = true dvResourceVirtualEnvironmentVMTabletDevice = true dvResourceVirtualEnvironmentVMTemplate = false + dvResourceVirtualEnvironmentVMTimeoutClone = 1800 + dvResourceVirtualEnvironmentVMTimeoutMoveDisk = 1800 + dvResourceVirtualEnvironmentVMTimeoutReboot = 1800 + dvResourceVirtualEnvironmentVMTimeoutShutdownVM = 1800 + dvResourceVirtualEnvironmentVMTimeoutStartVM = 1800 + dvResourceVirtualEnvironmentVMTimeoutStopVM = 300 dvResourceVirtualEnvironmentVMVGAEnabled = true dvResourceVirtualEnvironmentVMVGAMemory = 16 dvResourceVirtualEnvironmentVMVGAType = "std" @@ -81,6 +93,8 @@ const ( maxResourceVirtualEnvironmentVMNetworkDevices = 8 maxResourceVirtualEnvironmentVMSerialDevices = 4 + mkResourceVirtualEnvironmentVMRebootAfterCreation = "reboot" + mkResourceVirtualEnvironmentVMOnBoot = "on_boot" mkResourceVirtualEnvironmentVMACPI = "acpi" mkResourceVirtualEnvironmentVMAgent = "agent" mkResourceVirtualEnvironmentVMAgentEnabled = "enabled" @@ -96,6 +110,7 @@ const ( mkResourceVirtualEnvironmentVMCDROMEnabled = "enabled" mkResourceVirtualEnvironmentVMCDROMFileID = "file_id" mkResourceVirtualEnvironmentVMClone = "clone" + mkResourceVirtualEnvironmentVMCloneRetries = "retries" mkResourceVirtualEnvironmentVMCloneDatastoreID = "datastore_id" mkResourceVirtualEnvironmentVMCloneNodeName = "node_name" mkResourceVirtualEnvironmentVMCloneVMID = "vm_id" @@ -110,6 +125,7 @@ const ( mkResourceVirtualEnvironmentVMCPUUnits = "units" mkResourceVirtualEnvironmentVMDescription = "description" mkResourceVirtualEnvironmentVMDisk = "disk" + mkResourcevirtualEnvironmentVMDiskInterface = "interface" mkResourceVirtualEnvironmentVMDiskDatastoreID = "datastore_id" mkResourceVirtualEnvironmentVMDiskFileFormat = "file_format" mkResourceVirtualEnvironmentVMDiskFileID = "file_id" @@ -131,6 +147,7 @@ const ( mkResourceVirtualEnvironmentVMInitializationIPConfigIPv6 = "ipv6" mkResourceVirtualEnvironmentVMInitializationIPConfigIPv6Address = "address" mkResourceVirtualEnvironmentVMInitializationIPConfigIPv6Gateway = "gateway" + mkResourceVirtualEnvironmentVMInitializationType = "type" mkResourceVirtualEnvironmentVMInitializationUserAccount = "user_account" mkResourceVirtualEnvironmentVMInitializationUserAccountKeys = "keys" mkResourceVirtualEnvironmentVMInitializationUserAccountPassword = "password" @@ -162,6 +179,12 @@ const ( mkResourceVirtualEnvironmentVMStarted = "started" mkResourceVirtualEnvironmentVMTabletDevice = "tablet_device" mkResourceVirtualEnvironmentVMTemplate = "template" + mkResourceVirtualEnvironmentVMTimeoutClone = "timeout_clone" + mkResourceVirtualEnvironmentVMTimeoutMoveDisk = "timeout_move_disk" + mkResourceVirtualEnvironmentVMTimeoutReboot = "timeout_reboot" + mkResourceVirtualEnvironmentVMTimeoutShutdownVM = "timeout_shutdown_vm" + mkResourceVirtualEnvironmentVMTimeoutStartVM = "timeout_start_vm" + mkResourceVirtualEnvironmentVMTimeoutStopVM = "timeout_stop_vm" mkResourceVirtualEnvironmentVMVGA = "vga" mkResourceVirtualEnvironmentVMVGAEnabled = "enabled" mkResourceVirtualEnvironmentVMVGAMemory = "memory" @@ -172,6 +195,18 @@ const ( func resourceVirtualEnvironmentVM() *schema.Resource { return &schema.Resource{ Schema: map[string]*schema.Schema{ + mkResourceVirtualEnvironmentVMRebootAfterCreation: { + Type: schema.TypeBool, + Description: "Wether to reboot vm after creation", + Optional: true, + Default: dvResourceVirtualEnvironmentVMRebootAfterCreation, + }, + mkResourceVirtualEnvironmentVMOnBoot: { + Type: schema.TypeBool, + Description: "Start VM on Node boot", + Optional: true, + Default: dvResourceVirtualEnvironmentVMOnBoot, + }, mkResourceVirtualEnvironmentVMACPI: { Type: schema.TypeBool, Description: "Whether to enable ACPI", @@ -307,6 +342,13 @@ func resourceVirtualEnvironmentVM() *schema.Resource { }, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + mkResourceVirtualEnvironmentVMCloneRetries: { + Type: schema.TypeInt, + Description: "The number of Retries to create a clone", + Optional: true, + ForceNew: true, + Default: dvResourceVirtualEnvironmentVMCloneRetries, + }, mkResourceVirtualEnvironmentVMCloneDatastoreID: { Type: schema.TypeString, Description: "The ID of the target datastore", @@ -432,17 +474,22 @@ func resourceVirtualEnvironmentVM() *schema.Resource { mkResourceVirtualEnvironmentVMDiskDatastoreID: dvResourceVirtualEnvironmentVMDiskDatastoreID, mkResourceVirtualEnvironmentVMDiskFileFormat: dvResourceVirtualEnvironmentVMDiskFileFormat, mkResourceVirtualEnvironmentVMDiskFileID: dvResourceVirtualEnvironmentVMDiskFileID, + mkResourcevirtualEnvironmentVMDiskInterface: dvResourcevirtualEnvironmentVMDiskInterface, mkResourceVirtualEnvironmentVMDiskSize: dvResourceVirtualEnvironmentVMDiskSize, }, }, nil }, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ + mkResourcevirtualEnvironmentVMDiskInterface: { + Type: schema.TypeString, + Description: "The datastore name", + Required: true, + }, mkResourceVirtualEnvironmentVMDiskDatastoreID: { Type: schema.TypeString, Description: "The datastore id", Optional: true, - ForceNew: true, Default: dvResourceVirtualEnvironmentVMDiskDatastoreID, }, mkResourceVirtualEnvironmentVMDiskFileFormat: { @@ -465,9 +512,8 @@ func resourceVirtualEnvironmentVM() *schema.Resource { Type: schema.TypeInt, Description: "The disk size in gigabytes", Optional: true, - ForceNew: true, Default: dvResourceVirtualEnvironmentVMDiskSize, - ValidateFunc: validation.IntBetween(1, 8192), + ValidateFunc: validation.IntAtLeast(1), }, mkResourceVirtualEnvironmentVMDiskSpeed: { Type: schema.TypeList, @@ -674,6 +720,14 @@ func resourceVirtualEnvironmentVM() *schema.Resource { Default: dvResourceVirtualEnvironmentVMInitializationUserDataFileID, ValidateFunc: getFileIDValidator(), }, + mkResourceVirtualEnvironmentVMInitializationType: { + Type: schema.TypeString, + Description: "The cloud-init configuration format", + Optional: true, + ForceNew: true, + Default: dvResourceVirtualEnvironmentVMInitializationType, + ValidateFunc: getCloudInitTypeValidator(), + }, }, }, MaxItems: 1, @@ -903,6 +957,42 @@ func resourceVirtualEnvironmentVM() *schema.Resource { ForceNew: true, Default: dvResourceVirtualEnvironmentVMTemplate, }, + mkResourceVirtualEnvironmentVMTimeoutClone: { + Type: schema.TypeInt, + Description: "Clone VM timeout", + Optional: true, + Default: dvResourceVirtualEnvironmentVMTimeoutClone, + }, + mkResourceVirtualEnvironmentVMTimeoutMoveDisk: { + Type: schema.TypeInt, + Description: "MoveDisk timeout", + Optional: true, + Default: dvResourceVirtualEnvironmentVMTimeoutMoveDisk, + }, + mkResourceVirtualEnvironmentVMTimeoutReboot: { + Type: schema.TypeInt, + Description: "Reboot timeout", + Optional: true, + Default: dvResourceVirtualEnvironmentVMTimeoutReboot, + }, + mkResourceVirtualEnvironmentVMTimeoutShutdownVM: { + Type: schema.TypeInt, + Description: "Shutdown timeout", + Optional: true, + Default: dvResourceVirtualEnvironmentVMTimeoutShutdownVM, + }, + mkResourceVirtualEnvironmentVMTimeoutStartVM: { + Type: schema.TypeInt, + Description: "Start VM timeout", + Optional: true, + Default: dvResourceVirtualEnvironmentVMTimeoutStartVM, + }, + mkResourceVirtualEnvironmentVMTimeoutStopVM: { + Type: schema.TypeInt, + Description: "Stop VM timeout", + Optional: true, + Default: dvResourceVirtualEnvironmentVMTimeoutStopVM, + }, mkResourceVirtualEnvironmentVMVGA: { Type: schema.TypeList, Description: "The VGA configuration", @@ -979,6 +1069,7 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface clone := d.Get(mkResourceVirtualEnvironmentVMClone).([]interface{}) cloneBlock := clone[0].(map[string]interface{}) + cloneRetries := cloneBlock[mkResourceVirtualEnvironmentVMCloneRetries].(int) cloneDatastoreID := cloneBlock[mkResourceVirtualEnvironmentVMCloneDatastoreID].(string) cloneNodeName := cloneBlock[mkResourceVirtualEnvironmentVMCloneNodeName].(string) cloneVMID := cloneBlock[mkResourceVirtualEnvironmentVMCloneVMID].(int) @@ -1023,12 +1114,14 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface cloneBody.PoolID = &poolID } + cloneTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutClone).(int) + if cloneNodeName != "" && cloneNodeName != nodeName { cloneBody.TargetNodeName = &nodeName - err = veClient.CloneVM(cloneNodeName, cloneVMID, cloneBody) + err = veClient.CloneVM(cloneNodeName, cloneVMID, cloneRetries, cloneBody, cloneTimeout) } else { - err = veClient.CloneVM(nodeName, cloneVMID, cloneBody) + err = veClient.CloneVM(nodeName, cloneVMID, cloneRetries, cloneBody, cloneTimeout) } if err != nil { @@ -1062,7 +1155,7 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface networkDevice := d.Get(mkResourceVirtualEnvironmentVMNetworkDevice).([]interface{}) operatingSystem := d.Get(mkResourceVirtualEnvironmentVMOperatingSystem).([]interface{}) serialDevice := d.Get(mkResourceVirtualEnvironmentVMSerialDevice).([]interface{}) - started := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMStarted).(bool)) + onBoot := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMOnBoot).(bool)) tabletDevice := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTabletDevice).(bool)) template := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool)) vga := d.Get(mkResourceVirtualEnvironmentVMVGA).([]interface{}) @@ -1099,16 +1192,16 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface if len(cdrom) > 0 || len(initialization) > 0 { ideDevices = proxmox.CustomStorageDevices{ - proxmox.CustomStorageDevice{ + "ide0": proxmox.CustomStorageDevice{ Enabled: false, }, - proxmox.CustomStorageDevice{ + "ide1": proxmox.CustomStorageDevice{ Enabled: false, }, - proxmox.CustomStorageDevice{ + "ide2": proxmox.CustomStorageDevice{ Enabled: false, }, - proxmox.CustomStorageDevice{ + "ide3": proxmox.CustomStorageDevice{ Enabled: false, }, } @@ -1126,13 +1219,13 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface cdromMedia := "cdrom" - cdromDevice := proxmox.CustomStorageDevice{ - Enabled: cdromEnabled, - FileVolume: cdromFileID, - Media: &cdromMedia, + ideDevices = proxmox.CustomStorageDevices{ + "ide3": proxmox.CustomStorageDevice{ + Enabled: cdromEnabled, + FileVolume: cdromFileID, + Media: &cdromMedia, + }, } - - ideDevices[3] = cdromDevice } if len(cpu) > 0 { @@ -1178,13 +1271,14 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface cdromCloudInitFileID := fmt.Sprintf("%s:cloudinit", initializationDatastoreID) cdromCloudInitMedia := "cdrom" - cdromCloudInitDevice := proxmox.CustomStorageDevice{ - Enabled: cdromCloudInitEnabled, - FileVolume: cdromCloudInitFileID, - Media: &cdromCloudInitMedia, + ideDevices = proxmox.CustomStorageDevices{ + "ide2": proxmox.CustomStorageDevice{ + Enabled: cdromCloudInitEnabled, + FileVolume: cdromCloudInitFileID, + Media: &cdromCloudInitMedia, + }, } - ideDevices[2] = cdromCloudInitDevice initializationConfig, err := resourceVirtualEnvironmentVMGetCloudInitConfig(d, m) if err != nil { @@ -1259,9 +1353,7 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface } } - if started != dvResourceVirtualEnvironmentVMStarted { - updateBody.StartOnBoot = &started - } + updateBody.StartOnBoot = &onBoot if tabletDevice != dvResourceVirtualEnvironmentVMTabletDevice { updateBody.TabletDeviceEnabled = &tabletDevice @@ -1284,11 +1376,109 @@ func resourceVirtualEnvironmentVMCreateClone(d *schema.ResourceData, m interface updateBody.Delete = delete err = veClient.UpdateVM(nodeName, vmID, updateBody) + if err != nil { + return err + } + + disk := d.Get(mkResourceVirtualEnvironmentVMDisk).([]interface{}) + + vmConfig, err := veClient.GetVM(nodeName, vmID) + + if err != nil { + if strings.Contains(err.Error(), "HTTP 404") || + (strings.Contains(err.Error(), "HTTP 500") && strings.Contains(err.Error(), "does not exist")) { + d.SetId("") + + return nil + } + + return err + } + + allDiskInfo := getDiskInfo(vmConfig) + + diskDeviceObjects, err := resourceVirtualEnvironmentVMGetDiskDeviceObjects(d, m, nil) if err != nil { return err } + for i := range disk { + + diskBlock := disk[i].(map[string]interface{}) + diskInterface := diskBlock[mkResourcevirtualEnvironmentVMDiskInterface].(string) + dataStoreID := diskBlock[mkResourceVirtualEnvironmentVMDiskDatastoreID].(string) + diskSize := diskBlock[mkResourceVirtualEnvironmentVMDiskSize].(int) + + currentDiskInfo := allDiskInfo[diskInterface] + + if currentDiskInfo == nil { + diskUpdateBody := &proxmox.VirtualEnvironmentVMUpdateRequestBody{} + prefix := diskDigitPrefix(diskInterface) + switch prefix { + case "virtio": + if diskUpdateBody.VirtualIODevices == nil { + diskUpdateBody.VirtualIODevices = make(proxmox.CustomStorageDevices) + } + diskUpdateBody.VirtualIODevices[diskInterface] = diskDeviceObjects[prefix][diskInterface] + case "sata": + if diskUpdateBody.SATADevices == nil { + diskUpdateBody.SATADevices = make(proxmox.CustomStorageDevices) + } + diskUpdateBody.SATADevices[diskInterface] = diskDeviceObjects[prefix][diskInterface] + case "scsi": + if diskUpdateBody.SCSIDevices == nil { + diskUpdateBody.SCSIDevices = make(proxmox.CustomStorageDevices) + } + diskUpdateBody.SCSIDevices[diskInterface] = diskDeviceObjects[prefix][diskInterface] + } + + err = veClient.UpdateVM(nodeName, vmID, diskUpdateBody) + if err != nil { + return err + } + + continue + } + + compareNumber, err := parseDiskSize(currentDiskInfo.Size) + + if err != nil { + return err + } + + if diskSize < compareNumber { + return fmt.Errorf("Disk resize fails requests size (%dG) is lower than current size (%s)", diskSize, *currentDiskInfo.Size) + } + + deleteOriginalDisk := proxmox.CustomBool(true) + diskMoveBody := &proxmox.VirtualEnvironmentVMMoveDiskRequestBody{ + DeleteOriginalDisk: &deleteOriginalDisk, + Disk: diskInterface, + TargetStorage: dataStoreID, + } + + diskResizeBody := &proxmox.VirtualEnvironmentVMResizeDiskRequestBody{ + Disk: diskInterface, + Size: fmt.Sprintf("%dG", diskSize), + } + + if dataStoreID != "" { + moveDiskTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutMoveDisk).(int) + err = veClient.MoveVMDisk(nodeName, vmID, diskMoveBody, moveDiskTimeout) + + if err != nil { + return err + } + } + + err = veClient.ResizeVMDisk(nodeName, vmID, diskResizeBody) + + if err != nil { + return err + } + } + return resourceVirtualEnvironmentVMCreateStart(d, m) } @@ -1353,12 +1543,17 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac cpuUnits := cpuBlock[mkResourceVirtualEnvironmentVMCPUUnits].(int) description := d.Get(mkResourceVirtualEnvironmentVMDescription).(string) - diskDeviceObjects, err := resourceVirtualEnvironmentVMGetDiskDeviceObjects(d, m) + diskDeviceObjects, err := resourceVirtualEnvironmentVMGetDiskDeviceObjects(d, m, nil) if err != nil { return err } + virtioDeviceObjects := diskDeviceObjects["virtio"] + scsiDeviceObjects := diskDeviceObjects["scsi"] + //ideDeviceObjects := getOrderedDiskDeviceList(diskDeviceObjects, "ide") + sataDeviceObjects := diskDeviceObjects["sata"] + initializationConfig, err := resourceVirtualEnvironmentVMGetCloudInitConfig(d, m) if err != nil { @@ -1411,7 +1606,7 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac return err } - started := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMStarted).(bool)) + onBoot := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMOnBoot).(bool)) tabletDevice := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTabletDevice).(bool)) template := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool)) @@ -1450,18 +1645,12 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac ideDevice2Media := "cdrom" ideDevices := proxmox.CustomStorageDevices{ - proxmox.CustomStorageDevice{ - Enabled: false, - }, - proxmox.CustomStorageDevice{ - Enabled: false, - }, - proxmox.CustomStorageDevice{ + "ide2": proxmox.CustomStorageDevice{ Enabled: cdromCloudInitEnabled, FileVolume: cdromCloudInitFileID, Media: &ideDevice2Media, }, - proxmox.CustomStorageDevice{ + "ide3": proxmox.CustomStorageDevice{ Enabled: cdromEnabled, FileVolume: cdromFileID, Media: &ideDevice2Media, @@ -1503,18 +1692,28 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac KeyboardLayout: &keyboardLayout, NetworkDevices: networkDeviceObjects, OSType: &operatingSystemType, - PoolID: &poolID, - SCSIDevices: diskDeviceObjects, SCSIHardware: &scsiHardware, SerialDevices: serialDevices, SharedMemory: memorySharedObject, - StartOnBoot: &started, + StartOnBoot: &onBoot, TabletDeviceEnabled: &tabletDevice, Template: &template, VGADevice: vgaDevice, VMID: &vmID, } + if sataDeviceObjects != nil { + createBody.SATADevices = sataDeviceObjects + } + + if scsiDeviceObjects != nil { + createBody.SCSIDevices = scsiDeviceObjects + } + + if virtioDeviceObjects != nil { + createBody.VirtualIODevices = virtioDeviceObjects + } + // Only the root account is allowed to change the CPU architecture, which makes this check necessary. if veClient.Username == proxmox.DefaultRootAccount || cpuArchitecture != dvResourceVirtualEnvironmentVMCPUArchitecture { createBody.CPUArchitecture = &cpuArchitecture @@ -1532,6 +1731,10 @@ func resourceVirtualEnvironmentVMCreateCustom(d *schema.ResourceData, m interfac createBody.Name = &name } + if poolID != "" { + createBody.PoolID = &poolID + } + err = veClient.CreateVM(nodeName, createBody) if err != nil { @@ -1595,6 +1798,7 @@ func resourceVirtualEnvironmentVMCreateCustomDisks(d *schema.ResourceData, m int fileFormat, _ := block[mkResourceVirtualEnvironmentVMDiskFileFormat].(string) size, _ := block[mkResourceVirtualEnvironmentVMDiskSize].(int) speed := block[mkResourceVirtualEnvironmentVMDiskSpeed].([]interface{}) + diskInterface,_ := block[mkResourcevirtualEnvironmentVMDiskInterface].(string) if len(speed) == 0 { diskSpeedDefault, err := diskSpeedResource.DefaultValue() @@ -1650,6 +1854,7 @@ func resourceVirtualEnvironmentVMCreateCustomDisks(d *schema.ResourceData, m int fmt.Sprintf(`disk_index="%d"`, i), fmt.Sprintf(`disk_options="%s"`, diskOptions), fmt.Sprintf(`disk_size="%d"`, size), + fmt.Sprintf(`disk_interface="%s"`, diskInterface), fmt.Sprintf(`file_path="%s"`, filePath), fmt.Sprintf(`file_path_tmp="%s"`, filePathTmp), fmt.Sprintf(`vm_id="%d"`, vmID), @@ -1664,7 +1869,7 @@ func resourceVirtualEnvironmentVMCreateCustomDisks(d *schema.ResourceData, m int `qemu-img resize "$file_path_tmp" "${disk_size}G"`, `qm importdisk "$vm_id" "$file_path_tmp" "$datastore_id_target" -format qcow2`, `disk_id="${datastore_id_target}:$([[ -n "$dsp_target" ]] && echo "${vm_id}/" || echo "")vm-${vm_id}-disk-${disk_count}$([[ -n "$dsp_target" ]] && echo ".qcow2" || echo "")${disk_options}"`, - `qm set "$vm_id" "-scsi${disk_index}" "$disk_id"`, + `qm set "$vm_id" "-${disk_interface}" "$disk_id"`, `rm -f "$file_path_tmp"`, ) @@ -1687,6 +1892,7 @@ func resourceVirtualEnvironmentVMCreateCustomDisks(d *schema.ResourceData, m int func resourceVirtualEnvironmentVMCreateStart(d *schema.ResourceData, m interface{}) error { started := d.Get(mkResourceVirtualEnvironmentVMStarted).(bool) template := d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool) + reboot := d.Get(mkResourceVirtualEnvironmentVMRebootAfterCreation).(bool) if !started || template { return resourceVirtualEnvironmentVMRead(d, m) @@ -1707,16 +1913,23 @@ func resourceVirtualEnvironmentVMCreateStart(d *schema.ResourceData, m interface } // Start the virtual machine and wait for it to reach a running state before continuing. - err = veClient.StartVM(nodeName, vmID) + startVMTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutStartVM).(int) + err = veClient.StartVM(nodeName, vmID, startVMTimeout) if err != nil { return err } - err = veClient.WaitForVMState(nodeName, vmID, "running", 120, 5) + if reboot { + rebootTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutReboot).(int) - if err != nil { - return err + err := veClient.RebootVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMRebootRequestBody{ + Timeout: &rebootTimeout, + }, (rebootTimeout + 30)) + + if err != nil { + return err + } } return resourceVirtualEnvironmentVMRead(d, m) @@ -1854,6 +2067,12 @@ func resourceVirtualEnvironmentVMGetCloudInitConfig(d *schema.ResourceData, m in UserVolume: &initializationUserDataFileID, } } + + initializationType := initializationBlock[mkResourceVirtualEnvironmentVMInitializationType].(string) + + if initializationType != "" { + initializationConfig.Type = &initializationType + } } return initializationConfig, nil @@ -1866,12 +2085,17 @@ func resourceVirtualEnvironmentVMGetCPUArchitectureValidator() schema.SchemaVali }, false) } -func resourceVirtualEnvironmentVMGetDiskDeviceObjects(d *schema.ResourceData, m interface{}) (proxmox.CustomStorageDevices, error) { - diskDevice := d.Get(mkResourceVirtualEnvironmentVMDisk).([]interface{}) - diskDeviceObjects := make(proxmox.CustomStorageDevices, len(diskDevice)) +func resourceVirtualEnvironmentVMGetDiskDeviceObjects(d *schema.ResourceData, m interface{}, disks []interface{}) (map[string]map[string]proxmox.CustomStorageDevice, error) { + var diskDevice []interface{} + if disks != nil { + diskDevice = disks + } else { + diskDevice = d.Get(mkResourceVirtualEnvironmentVMDisk).([]interface{}) + } + diskDeviceObjects := make(map[string]map[string]proxmox.CustomStorageDevice) resource := resourceVirtualEnvironmentVM() - for i, diskEntry := range diskDevice { + for _, diskEntry := range diskDevice { diskDevice := proxmox.CustomStorageDevice{ Enabled: true, } @@ -1880,6 +2104,7 @@ func resourceVirtualEnvironmentVMGetDiskDeviceObjects(d *schema.ResourceData, m datastoreID, _ := block[mkResourceVirtualEnvironmentVMDiskDatastoreID].(string) fileID, _ := block[mkResourceVirtualEnvironmentVMDiskFileID].(string) size, _ := block[mkResourceVirtualEnvironmentVMDiskSize].(int) + diskInterface, _ := block[mkResourcevirtualEnvironmentVMDiskInterface].(string) speedBlock, err := getSchemaBlock(resource, d, m, []string{mkResourceVirtualEnvironmentVMDisk, mkResourceVirtualEnvironmentVMDiskSpeed}, 0, false) @@ -1893,6 +2118,13 @@ func resourceVirtualEnvironmentVMGetDiskDeviceObjects(d *schema.ResourceData, m diskDevice.FileVolume = fmt.Sprintf("%s:%d", datastoreID, size) } + diskDevice.ID = &datastoreID + diskDevice.Interface = &diskInterface + diskDevice.FileID = &fileID + sizeString := fmt.Sprintf("%dG", size) + diskDevice.Size = &sizeString + diskDevice.SizeInt = &size + if len(speedBlock) > 0 { speedLimitRead := speedBlock[mkResourceVirtualEnvironmentVMDiskSpeedRead].(int) speedLimitReadBurstable := speedBlock[mkResourceVirtualEnvironmentVMDiskSpeedReadBurstable].(int) @@ -1916,7 +2148,18 @@ func resourceVirtualEnvironmentVMGetDiskDeviceObjects(d *schema.ResourceData, m } } - diskDeviceObjects[i] = diskDevice + baseDiskInterface := diskDigitPrefix(diskInterface) + + if baseDiskInterface != "virtio" && baseDiskInterface != "scsi" && baseDiskInterface != "sata" { + errorMsg := fmt.Sprintf("Defined disk interface not supported. Interface was %s, but only virtio, sata and scsi are supported", diskInterface) + return diskDeviceObjects, errors.New(errorMsg) + } + + if _, present := diskDeviceObjects[baseDiskInterface]; !present { + diskDeviceObjects[baseDiskInterface] = make(map[string]proxmox.CustomStorageDevice) + } + + diskDeviceObjects[baseDiskInterface][diskInterface] = diskDevice } return diskDeviceObjects, nil @@ -2205,14 +2448,16 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ cdromBlock[mkResourceVirtualEnvironmentVMCDROMEnabled] = vmConfig.IDEDevice3.Enabled cdromBlock[mkResourceVirtualEnvironmentVMCDROMFileID] = vmConfig.IDEDevice3.FileVolume - isCurrentCDROMFileId := currentCDROM[0].(map[string]interface{}) + if len(currentCDROM) > 0 { + isCurrentCDROMFileId := currentCDROM[0].(map[string]interface{}) - if isCurrentCDROMFileId[mkResourceVirtualEnvironmentVMCDROMFileID] == "" { - cdromBlock[mkResourceVirtualEnvironmentVMCDROMFileID] = "" - } + if isCurrentCDROMFileId[mkResourceVirtualEnvironmentVMCDROMFileID] == "" { + cdromBlock[mkResourceVirtualEnvironmentVMCDROMFileID] = "" + } - if isCurrentCDROMFileId[mkResourceVirtualEnvironmentVMCDROMEnabled] == false { - cdromBlock[mkResourceVirtualEnvironmentVMCDROMEnabled] = false + if isCurrentCDROMFileId[mkResourceVirtualEnvironmentVMCDROMEnabled] == false { + cdromBlock[mkResourceVirtualEnvironmentVMCDROMEnabled] = false + } } cdrom[0] = cdromBlock @@ -2304,31 +2549,14 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ d.Set(mkResourceVirtualEnvironmentVMCPU, []interface{}{cpu}) } - // Compare the disks to those stored in the state. - currentDisk := d.Get(mkResourceVirtualEnvironmentVMDisk).([]interface{}) - - diskList := []interface{}{} - diskObjects := []*proxmox.CustomStorageDevice{ - vmConfig.SCSIDevice0, - vmConfig.SCSIDevice1, - vmConfig.SCSIDevice2, - vmConfig.SCSIDevice3, - vmConfig.SCSIDevice4, - vmConfig.SCSIDevice5, - vmConfig.SCSIDevice6, - vmConfig.SCSIDevice7, - vmConfig.SCSIDevice8, - vmConfig.SCSIDevice9, - vmConfig.SCSIDevice10, - vmConfig.SCSIDevice11, - vmConfig.SCSIDevice12, - vmConfig.SCSIDevice13, - } + diskMap := map[string]interface{}{} + orderedDiskList := []interface{}{} + diskObjects := getDiskInfo(vmConfig) for di, dd := range diskObjects { disk := map[string]interface{}{} - if dd == nil { + if dd == nil || strings.HasPrefix(di, "ide") { continue } @@ -2336,43 +2564,21 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ disk[mkResourceVirtualEnvironmentVMDiskDatastoreID] = fileIDParts[0] - if len(currentDisk) > di { - currentDiskEntry := currentDisk[di].(map[string]interface{}) - - disk[mkResourceVirtualEnvironmentVMDiskFileFormat] = currentDiskEntry[mkResourceVirtualEnvironmentVMDiskFileFormat] - disk[mkResourceVirtualEnvironmentVMDiskFileID] = currentDiskEntry[mkResourceVirtualEnvironmentVMDiskFileID] + disk[mkResourceVirtualEnvironmentVMDiskFileID] = dd.FileID + if dd.Format == nil { + disk[mkResourceVirtualEnvironmentVMDiskFileFormat] = "qcow2" + } else { + disk[mkResourceVirtualEnvironmentVMDiskFileFormat] = dd.Format } + disk[mkResourcevirtualEnvironmentVMDiskInterface] = di diskSize := 0 var err error + diskSize, err = parseDiskSize(dd.Size) - if dd.Size != nil { - if strings.HasSuffix(*dd.Size, "T") { - diskSize, err = strconv.Atoi(strings.TrimSuffix(*dd.Size, "T")) - - if err != nil { - return err - } - - diskSize = int(math.Ceil(float64(diskSize) * 1024)) - } else if strings.HasSuffix(*dd.Size, "G") { - diskSize, err = strconv.Atoi(strings.TrimSuffix(*dd.Size, "G")) - - if err != nil { - return err - } - } else if strings.HasSuffix(*dd.Size, "M") { - diskSize, err = strconv.Atoi(strings.TrimSuffix(*dd.Size, "M")) - - if err != nil { - return err - } - - diskSize = int(math.Ceil(float64(diskSize) / 1024)) - } else { - return fmt.Errorf("Cannot parse storage size \"%s\"", *dd.Size) - } + if err != nil { + return err } disk[mkResourceVirtualEnvironmentVMDiskSize] = diskSize @@ -2412,15 +2618,23 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ disk[mkResourceVirtualEnvironmentVMDiskSpeed] = []interface{}{} } - diskList = append(diskList, disk) + diskMap[di] = disk } + keyList := []string{} + for key := range diskMap { + keyList = append(keyList, key) + } + sort.Strings(keyList) + for _, k := range keyList { + orderedDiskList = append(orderedDiskList, diskMap[k]) + } if len(clone) > 0 { - if len(currentDisk) > 0 { - d.Set(mkResourceVirtualEnvironmentVMDisk, diskList) + if len(orderedDiskList) > 0 { + d.Set(mkResourceVirtualEnvironmentVMDisk, orderedDiskList) } - } else if len(currentDisk) > 0 || len(diskList) > 0 { - d.Set(mkResourceVirtualEnvironmentVMDisk, diskList) + } else if len(orderedDiskList) > 0 { + d.Set(mkResourceVirtualEnvironmentVMDisk, orderedDiskList) } // Compare the initialization configuration to the one stored in the state. @@ -2519,7 +2733,9 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ ipConfigList[ipConfigIndex] = ipConfigItem } - initialization[mkResourceVirtualEnvironmentVMInitializationIPConfig] = ipConfigList[:ipConfigLast+1] + if ipConfigLast >= 0 { + initialization[mkResourceVirtualEnvironmentVMInitializationIPConfig] = ipConfigList[:ipConfigLast+1] + } if vmConfig.CloudInitPassword != nil || vmConfig.CloudInitSSHKeys != nil || vmConfig.CloudInitUsername != nil { initializationUserAccount := map[string]interface{}{} @@ -2551,10 +2767,16 @@ func resourceVirtualEnvironmentVMReadCustom(d *schema.ResourceData, m interface{ } else { initialization[mkResourceVirtualEnvironmentVMInitializationUserDataFileID] = "" } - } else { + } else if len(initialization) > 0 { initialization[mkResourceVirtualEnvironmentVMInitializationUserDataFileID] = "" } + if vmConfig.CloudInitType != nil { + initialization[mkResourceVirtualEnvironmentVMInitializationType] = *vmConfig.CloudInitType + } else if len(initialization) > 0 { + initialization[mkResourceVirtualEnvironmentVMInitializationType] = "" + } + currentInitialization := d.Get(mkResourceVirtualEnvironmentVMInitialization).([]interface{}) if len(clone) > 0 { @@ -2915,7 +3137,9 @@ func resourceVirtualEnvironmentVMReadPrimitiveValues(d *schema.ResourceData, m i } } - d.Set(mkResourceVirtualEnvironmentVMStarted, vmStatus.Status == "running") + if d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool) != true { + d.Set(mkResourceVirtualEnvironmentVMStarted, vmStatus.Status == "running") + } currentTabletDevice := d.Get(mkResourceVirtualEnvironmentVMTabletDevice).(bool) @@ -2961,16 +3185,16 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e updateBody := &proxmox.VirtualEnvironmentVMUpdateRequestBody{ IDEDevices: proxmox.CustomStorageDevices{ - proxmox.CustomStorageDevice{ + "ide0": proxmox.CustomStorageDevice{ Enabled: false, }, - proxmox.CustomStorageDevice{ + "ide1": proxmox.CustomStorageDevice{ Enabled: false, }, - proxmox.CustomStorageDevice{ + "ide2": proxmox.CustomStorageDevice{ Enabled: false, }, - proxmox.CustomStorageDevice{ + "ide3": proxmox.CustomStorageDevice{ Enabled: false, }, }, @@ -3011,7 +3235,12 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e } name := d.Get(mkResourceVirtualEnvironmentVMName).(string) - updateBody.Name = &name + + if name == "" { + delete = append(delete, "name") + } else { + updateBody.Name = &name + } if d.HasChange(mkResourceVirtualEnvironmentVMTabletDevice) { tabletDevice := proxmox.CustomBool(d.Get(mkResourceVirtualEnvironmentVMTabletDevice).(bool)) @@ -3089,7 +3318,7 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e cdromMedia := "cdrom" - updateBody.IDEDevices[3] = proxmox.CustomStorageDevice{ + updateBody.IDEDevices["ide3"] = proxmox.CustomStorageDevice{ Enabled: cdromEnabled, FileVolume: cdromFileID, Media: &cdromMedia, @@ -3143,41 +3372,60 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e // Prepare the new disk device configuration. if d.HasChange(mkResourceVirtualEnvironmentVMDisk) { - diskDeviceObjects, err := resourceVirtualEnvironmentVMGetDiskDeviceObjects(d, m) + diskDeviceObjects, err := resourceVirtualEnvironmentVMGetDiskDeviceObjects(d, m, nil) if err != nil { return err } - scsiDevices := []*proxmox.CustomStorageDevice{ - vmConfig.SCSIDevice0, - vmConfig.SCSIDevice1, - vmConfig.SCSIDevice2, - vmConfig.SCSIDevice3, - vmConfig.SCSIDevice4, - vmConfig.SCSIDevice5, - vmConfig.SCSIDevice6, - vmConfig.SCSIDevice7, - vmConfig.SCSIDevice8, - vmConfig.SCSIDevice9, - vmConfig.SCSIDevice10, - vmConfig.SCSIDevice11, - vmConfig.SCSIDevice12, - vmConfig.SCSIDevice13, - } - - updateBody.SCSIDevices = make(proxmox.CustomStorageDevices, len(diskDeviceObjects)) - - for di, do := range diskDeviceObjects { - if scsiDevices[di] == nil { - return fmt.Errorf("Missing SCSI device %d (scsi%d)", di, di) + diskDeviceInfo := getDiskInfo(vmConfig) + + for prefix, diskMap := range diskDeviceObjects { + if diskMap == nil { + continue } - updateBody.SCSIDevices[di] = *scsiDevices[di] - updateBody.SCSIDevices[di].BurstableReadSpeedMbps = do.BurstableReadSpeedMbps - updateBody.SCSIDevices[di].BurstableWriteSpeedMbps = do.BurstableWriteSpeedMbps - updateBody.SCSIDevices[di].MaxReadSpeedMbps = do.MaxReadSpeedMbps - updateBody.SCSIDevices[di].MaxWriteSpeedMbps = do.MaxWriteSpeedMbps + for key, value := range diskMap { + if diskDeviceInfo[key] == nil { + return fmt.Errorf("Missing %s device %s", prefix, key) + } + + tmp := *diskDeviceInfo[key] + tmp.BurstableReadSpeedMbps = value.BurstableReadSpeedMbps + tmp.BurstableWriteSpeedMbps = value.BurstableWriteSpeedMbps + tmp.MaxReadSpeedMbps = value.MaxReadSpeedMbps + tmp.MaxWriteSpeedMbps = value.MaxWriteSpeedMbps + + switch prefix { + case "virtio": + { + if updateBody.VirtualIODevices == nil { + updateBody.VirtualIODevices = make(proxmox.CustomStorageDevices) + } + updateBody.VirtualIODevices[key] = tmp + } + case "sata": + { + if updateBody.SATADevices == nil { + updateBody.SATADevices = make(proxmox.CustomStorageDevices) + } + updateBody.SATADevices[key] = tmp + } + case "scsi": + { + if updateBody.SCSIDevices == nil { + updateBody.SCSIDevices = make(proxmox.CustomStorageDevices) + } + updateBody.SCSIDevices[key] = tmp + } + case "ide": + { + //not sure right now + } + default: + return fmt.Errorf("Device prefix %s not supported", prefix) + } + } } rebootRequired = true @@ -3200,7 +3448,7 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e cdromMedia := "cdrom" - updateBody.IDEDevices[2] = proxmox.CustomStorageDevice{ + updateBody.IDEDevices["ide2"] = proxmox.CustomStorageDevice{ Enabled: true, FileVolume: fmt.Sprintf("%s:cloudinit", initializationDatastoreID), Media: &cdromMedia, @@ -3208,7 +3456,9 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e if vmConfig.IDEDevice2 != nil { if strings.Contains(vmConfig.IDEDevice2.FileVolume, fmt.Sprintf("vm-%d-cloudinit", vmID)) { - updateBody.IDEDevices[2].Enabled = false + var tmp = updateBody.IDEDevices["ide2"] + tmp.Enabled = true + updateBody.IDEDevices["ide2"] = tmp } } } @@ -3319,31 +3569,20 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e if d.HasChange(mkResourceVirtualEnvironmentVMStarted) && !bool(template) { if started { - err = veClient.StartVM(nodeName, vmID) - - if err != nil { - return err - } - - err = veClient.WaitForVMState(nodeName, vmID, "running", 120, 5) + startVMTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutStartVM).(int) + err = veClient.StartVM(nodeName, vmID, startVMTimeout) if err != nil { return err } } else { forceStop := proxmox.CustomBool(true) - shutdownTimeout := 300 + shutdownTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutShutdownVM).(int) err = veClient.ShutdownVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMShutdownRequestBody{ ForceStop: &forceStop, Timeout: &shutdownTimeout, - }) - - if err != nil { - return err - } - - err = veClient.WaitForVMState(nodeName, vmID, "stopped", 30, 5) + }, (shutdownTimeout + 30)) if err != nil { return err @@ -3353,21 +3592,107 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e } } - // Reboot the virtual machine, if required. - if !bool(template) && rebootRequired { - rebootTimeout := 300 + // Change the disk locations and/or sizes, if necessary. + return resourceVirtualEnvironmentVMUpdateDiskLocationAndSize(d, m, vmConfig, !bool(template) && rebootRequired) +} - err = veClient.RebootVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMRebootRequestBody{ - Timeout: &rebootTimeout, - }) +func resourceVirtualEnvironmentVMUpdateDiskLocationAndSize(d *schema.ResourceData, m interface{}, vmConfig *proxmox.VirtualEnvironmentVMGetResponseData, reboot bool) error { + config := m.(providerConfiguration) + veClient, err := config.GetVEClient() + if err != nil { + return err + } + + nodeName := d.Get(mkResourceVirtualEnvironmentVMNodeName).(string) + started := d.Get(mkResourceVirtualEnvironmentVMStarted).(bool) + template := d.Get(mkResourceVirtualEnvironmentVMTemplate).(bool) + vmID, err := strconv.Atoi(d.Id()) + + if err != nil { + return err + } + + // Determine if any of the disks are changing location and/or size, and initiate the necessary actions. + if d.HasChange(mkResourceVirtualEnvironmentVMDisk) { + diskOld, diskNew := d.GetChange(mkResourceVirtualEnvironmentVMDisk) + + diskOldEntries, err := resourceVirtualEnvironmentVMGetDiskDeviceObjects(d, m, diskOld.([]interface{})) if err != nil { return err } - // Wait for the agent to unpublish the network interfaces, if it's enabled. - if vmConfig.Agent != nil && vmConfig.Agent.Enabled != nil && *vmConfig.Agent.Enabled { - err = veClient.WaitForNoNetworkInterfacesFromVMAgent(nodeName, vmID, 300, 5) + diskNewEntries, err := resourceVirtualEnvironmentVMGetDiskDeviceObjects(d, m, diskNew.([]interface{})) + if err != nil { + return err + } + + diskMoveBodies := []*proxmox.VirtualEnvironmentVMMoveDiskRequestBody{} + diskResizeBodies := []*proxmox.VirtualEnvironmentVMResizeDiskRequestBody{} + + for prefix, diskMap := range diskOldEntries { + for oldKey, oldDisk := range diskMap { + if _, present := diskNewEntries[prefix][oldKey]; !present { + return fmt.Errorf("Deletion of disks not supported. Please delete disk by hand. Old Interface was %s", *oldDisk.Interface) + } + + if oldDisk.ID != diskNewEntries[prefix][oldKey].ID { + deleteOriginalDisk := proxmox.CustomBool(true) + + diskMoveBodies = append(diskMoveBodies, &proxmox.VirtualEnvironmentVMMoveDiskRequestBody{ + DeleteOriginalDisk: &deleteOriginalDisk, + Disk: *oldDisk.Interface, + TargetStorage: *diskNewEntries[prefix][oldKey].ID, + }) + } + + if *oldDisk.SizeInt <= *diskNewEntries[prefix][oldKey].SizeInt { + diskResizeBodies = append(diskResizeBodies, &proxmox.VirtualEnvironmentVMResizeDiskRequestBody{ + Disk: *oldDisk.Interface, + Size: *diskNewEntries[prefix][oldKey].Size, + }) + } + } + } + + if len(diskMoveBodies) > 0 || len(diskResizeBodies) > 0 { + if !template { + forceStop := proxmox.CustomBool(true) + shutdownTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutShutdownVM).(int) + + err = veClient.ShutdownVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMShutdownRequestBody{ + ForceStop: &forceStop, + Timeout: &shutdownTimeout, + }, (shutdownTimeout + 30)) + + if err != nil { + return err + } + } + + reboot = false + } + + for _, reqBody := range diskMoveBodies { + moveDiskTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutMoveDisk).(int) + err = veClient.MoveVMDisk(nodeName, vmID, reqBody, moveDiskTimeout) + + if err != nil { + return err + } + } + + for _, reqBody := range diskResizeBodies { + err = veClient.ResizeVMDisk(nodeName, vmID, reqBody) + + if err != nil { + return err + } + } + + if (len(diskMoveBodies) > 0 || len(diskResizeBodies) > 0) && started && !template { + startVMTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutStartVM).(int) + err = veClient.StartVM(nodeName, vmID, startVMTimeout) if err != nil { return err @@ -3375,6 +3700,19 @@ func resourceVirtualEnvironmentVMUpdate(d *schema.ResourceData, m interface{}) e } } + // Perform a regular reboot in case it's necessary and haven't already been done. + if reboot { + rebootTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutReboot).(int) + + err := veClient.RebootVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMRebootRequestBody{ + Timeout: &rebootTimeout, + }, (rebootTimeout + 30)) + + if err != nil { + return err + } + } + return resourceVirtualEnvironmentVMRead(d, m) } @@ -3402,18 +3740,12 @@ func resourceVirtualEnvironmentVMDelete(d *schema.ResourceData, m interface{}) e if status.Status != "stopped" { forceStop := proxmox.CustomBool(true) - shutdownTimeout := 300 + shutdownTimeout := d.Get(mkResourceVirtualEnvironmentVMTimeoutShutdownVM).(int) err = veClient.ShutdownVM(nodeName, vmID, &proxmox.VirtualEnvironmentVMShutdownRequestBody{ ForceStop: &forceStop, Timeout: &shutdownTimeout, - }) - - if err != nil { - return err - } - - err = veClient.WaitForVMState(nodeName, vmID, "stopped", 30, 5) + }, (shutdownTimeout + 30)) if err != nil { return err diff --git a/proxmoxtf/resource_virtual_environment_vm_test.go b/proxmoxtf/resource_virtual_environment_vm_test.go index db0fa21..ddb5a5a 100644 --- a/proxmoxtf/resource_virtual_environment_vm_test.go +++ b/proxmoxtf/resource_virtual_environment_vm_test.go @@ -7,7 +7,7 @@ package proxmoxtf import ( "testing" - "github.com/hashicorp/terraform/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" ) // TestResourceVirtualEnvironmentVMInstantiation tests whether the ResourceVirtualEnvironmentVM instance can be instantiated. diff --git a/proxmoxtf/utils.go b/proxmoxtf/utils.go index c755b9b..5e1024c 100644 --- a/proxmoxtf/utils.go +++ b/proxmoxtf/utils.go @@ -6,12 +6,17 @@ package proxmoxtf import ( "fmt" + "math" "regexp" + "strconv" + "strings" "testing" "time" + "unicode" - "github.com/hashicorp/terraform/helper/schema" - "github.com/hashicorp/terraform/helper/validation" + "github.com/danitso/terraform-provider-proxmox/proxmox" + "github.com/hashicorp/terraform-plugin-sdk/helper/schema" + "github.com/hashicorp/terraform-plugin-sdk/helper/validation" ) func getBIOSValidator() schema.SchemaValidateFunc { @@ -199,6 +204,15 @@ func getKeyboardLayoutValidator() schema.SchemaValidateFunc { }, false) } +func diskDigitPrefix(s string) string { + for i, r := range s { + if unicode.IsDigit(r) { + return s[:i] + } + } + return s +} + func getMACAddressValidator() schema.SchemaValidateFunc { return func(i interface{}, k string) (ws []string, es []error) { v, ok := i.(string) @@ -370,6 +384,101 @@ func getVMIDValidator() schema.SchemaValidateFunc { } } +func getDiskInfo(data *proxmox.VirtualEnvironmentVMGetResponseData) map[string]*proxmox.CustomStorageDevice { + storageDevices := make(map[string]*proxmox.CustomStorageDevice) + storageDevices["ide0"] = data.IDEDevice0 + storageDevices["ide1"] = data.IDEDevice1 + storageDevices["ide2"] = data.IDEDevice2 + + storageDevices["sata0"] = data.SATADevice0 + storageDevices["sata1"] = data.SATADevice1 + storageDevices["sata2"] = data.SATADevice2 + storageDevices["sata3"] = data.SATADevice3 + storageDevices["sata4"] = data.SATADevice4 + storageDevices["sata5"] = data.SATADevice5 + + storageDevices["scsi0"] = data.SCSIDevice0 + storageDevices["scsi1"] = data.SCSIDevice1 + storageDevices["scsi2"] = data.SCSIDevice2 + storageDevices["scsi3"] = data.SCSIDevice3 + storageDevices["scsi4"] = data.SCSIDevice4 + storageDevices["scsi5"] = data.SCSIDevice5 + storageDevices["scsi6"] = data.SCSIDevice6 + storageDevices["scsi7"] = data.SCSIDevice7 + storageDevices["scsi8"] = data.SCSIDevice8 + storageDevices["scsi9"] = data.SCSIDevice9 + storageDevices["scsi10"] = data.SCSIDevice10 + storageDevices["scsi11"] = data.SCSIDevice11 + storageDevices["scsi12"] = data.SCSIDevice12 + storageDevices["scsi13"] = data.SCSIDevice13 + + storageDevices["virtio0"] = data.VirtualIODevice0 + storageDevices["virtio1"] = data.VirtualIODevice1 + storageDevices["virtio2"] = data.VirtualIODevice2 + storageDevices["virtio3"] = data.VirtualIODevice3 + storageDevices["virtio4"] = data.VirtualIODevice4 + storageDevices["virtio5"] = data.VirtualIODevice5 + storageDevices["virtio6"] = data.VirtualIODevice6 + storageDevices["virtio7"] = data.VirtualIODevice7 + storageDevices["virtio8"] = data.VirtualIODevice8 + storageDevices["virtio9"] = data.VirtualIODevice9 + storageDevices["virtio10"] = data.VirtualIODevice10 + storageDevices["virtio11"] = data.VirtualIODevice11 + storageDevices["virtio12"] = data.VirtualIODevice12 + storageDevices["virtio13"] = data.VirtualIODevice13 + storageDevices["virtio14"] = data.VirtualIODevice14 + storageDevices["virtio15"] = data.VirtualIODevice15 + + for key, value := range storageDevices { + if value != nil { + tmpKey := key + value.Interface = &tmpKey + } + } + + return storageDevices +} + +func parseDiskSize(size *string) (int, error) { + var diskSize int + var err error + if size != nil { + if strings.HasSuffix(*size, "T") { + diskSize, err = strconv.Atoi(strings.TrimSuffix(*size, "T")) + + if err != nil { + return -1, err + } + + diskSize = int(math.Ceil(float64(diskSize) * 1024)) + } else if strings.HasSuffix(*size, "G") { + diskSize, err = strconv.Atoi(strings.TrimSuffix(*size, "G")) + + if err != nil { + return -1, err + } + } else if strings.HasSuffix(*size, "M") { + diskSize, err = strconv.Atoi(strings.TrimSuffix(*size, "M")) + + if err != nil { + return -1, err + } + + diskSize = int(math.Ceil(float64(diskSize) / 1024)) + } else { + return -1, fmt.Errorf("Cannot parse storage size \"%s\"", *size) + } + } + return diskSize, err +} + +func getCloudInitTypeValidator() schema.SchemaValidateFunc { + return validation.StringInSlice([]string{ + "configdrive2", + "nocloud", + }, false) +} + func testComputedAttributes(t *testing.T, s *schema.Resource, keys []string) { for _, v := range keys { if s.Schema[v] == nil {