Compare commits
No commits in common. 'main' and '4.6.4' have entirely different histories.
@ -1,32 +1,5 @@
|
||||
## Version 4.8.1
|
||||
## Version 4.6.4
|
||||
|
||||
### Добавлено
|
||||
### Bugfix
|
||||
- Fix bug that network reconnects to the compute if the weight field was not specified
|
||||
|
||||
#### kvmvm
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BATF-692 | Опциональное поле `preferred_cpu`в resources `decort_kvmvm, decort_cb_kvmvm` в cloudapi/kvmvm и cloudbroker/kvmvm |
|
||||
| BATF-692 | Вычисляемое поле `preferred_cpu`в data_sources `decort_kvmvm, decort_kvmvm_list, decort_kvmvm_list_deleted, decort_cb_kvmvm, decort_cb_kvmvm_list, decort_cb_kvmvm_list_deleted ` в cloudapi/kvmvm и cloudbroker/kvmvm |
|
||||
|
||||
#### node
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BATF-686 | Вычисляемые поля `dpdk, uefi_firmware_file`в data_source `decort_cb_node_list` в cloudbroker/node |
|
||||
| BATF-687 | Вычисляемые поля `dpdk, network_mode, to_active, to_installing, to_maintenance, to_restricted` в data_source `decort_cb_node` в cloudbroker/node |
|
||||
|
||||
#### sep
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BATF-689 | Вычисляемое поле `multipath_num` в resource `decort_cb_sep` и data_sources `decort_cb_sep, decort_cb_sep_list` в cloudbroker/kvmvm |
|
||||
|
||||
#### vins
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BATF-678 | Вычисляемое поле `account_id` в блоке `reservations` в resource `decort_cb_vins` и data source `decort_cb_vins` в cloudbroker/vins |
|
||||
|
||||
### Удалено
|
||||
|
||||
#### sep
|
||||
| Идентификатор<br>задачи | Описание |
|
||||
| --- | --- |
|
||||
| BATF-688 | Вычисляемые поля `ckey,meta` в resource `decort_cb_sep` и data_sources `decort_cb_sep, decort_cb_sep_list` в cloudbroker/kvmvm |
|
@ -0,0 +1,168 @@
|
||||
# terraform-provider-decort
|
||||
|
||||
Terraform provider for Digital Energy Cloud Orchestration Technology (DECORT) platform
|
||||
|
||||
## Mapping of platform versions with provider versions
|
||||
|
||||
| DECORT API version | Terraform provider version |
|
||||
| ------ | ------ |
|
||||
| 3.8.5 | 3.4.x |
|
||||
| 3.8.0 - 3.8.4 | 3.3.1 |
|
||||
| 3.7.x | rc-1.25 |
|
||||
| 3.6.x | rc-1.10 |
|
||||
| до 3.6.0 | [terraform-provider-decs](https://github.com/rudecs/terraform-provider-decs) |
|
||||
|
||||
## Working modes
|
||||
|
||||
The provider support two working modes:
|
||||
|
||||
- User mode,
|
||||
- Administator mode.
|
||||
Use flag DECORT_ADMIN_MODE for swithcing beetwen modes.
|
||||
See user guide at https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
|
||||
|
||||
## Features
|
||||
|
||||
- Work with Compute instances,
|
||||
- Work with disks,
|
||||
- Work with k8s,
|
||||
- Work with image,
|
||||
- Work with reource groups,
|
||||
- Work with VINS,
|
||||
- Work with pfw,
|
||||
- Work with accounts,
|
||||
- Work with snapshots,
|
||||
- Work with pcidevice.
|
||||
- Work with sep,
|
||||
- Work with vgpu,
|
||||
- Work with bservice,
|
||||
- Work with extnets,
|
||||
- Work with locations,
|
||||
- Work with load balancers.
|
||||
|
||||
This provider supports Import operations on pre-existing resources.
|
||||
|
||||
See user guide at https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
|
||||
|
||||
## Get Started
|
||||
|
||||
Two ways for starting:
|
||||
|
||||
1. Installing via binary packages
|
||||
2. Manual installing
|
||||
|
||||
### Installing via binary packages
|
||||
|
||||
1. Download and install terraform: https://learn.hashicorp.com/tutorials/terraform/install-cli?in=terraform/aws-get-started
|
||||
2. Create a file `main.tf` and add to it next section.
|
||||
|
||||
```terraform
|
||||
provider "decort" {
|
||||
authenticator = "decs3o"
|
||||
#controller_url = <DECORT_CONTROLLER_URL>
|
||||
controller_url = "https://ds1.digitalenergy.online"
|
||||
#oauth2_url = <DECORT_SSO_URL>
|
||||
oauth2_url = "https://sso.digitalenergy.online"
|
||||
allow_unverified_ssl = true
|
||||
}
|
||||
```
|
||||
|
||||
3. Execute next command
|
||||
|
||||
```
|
||||
terraform init
|
||||
```
|
||||
|
||||
The Provider will automatically install on your computer from the terrafrom registry.
|
||||
|
||||
### Manual installing
|
||||
|
||||
1. Download and install Go Programming Language: https://go.dev/dl/
|
||||
2. Download and install terraform: https://learn.hashicorp.com/tutorials/terraform/install-cli?in=terraform/aws-get-started
|
||||
3. Clone provider's repo:
|
||||
|
||||
```bash
|
||||
git clone https://github.com/rudecs/terraform-provider-decort.git
|
||||
```
|
||||
|
||||
4. Change directory to clone provider's and execute next command
|
||||
|
||||
```bash
|
||||
go build -o terraform-provider-decort
|
||||
```
|
||||
|
||||
If you have experience with _makefile_, you can change `Makefile`'s paramters and execute next command
|
||||
|
||||
```bash
|
||||
make build
|
||||
```
|
||||
|
||||
5. Now move compilled file to:
|
||||
Linux:
|
||||
|
||||
```bash
|
||||
~/.terraform.d/plugins/${host_name}/${namespace}/${type}/${version}/${target}
|
||||
```
|
||||
|
||||
Windows:
|
||||
|
||||
```powershell
|
||||
%APPDATA%\terraform.d\plugins\${host_name}/${namespace}/${type}/${version}/${target}
|
||||
```
|
||||
|
||||
NOTE: for Windows OS `%APP_DATA%` is a cataloge, where will place terraform files.
|
||||
Example:
|
||||
|
||||
- host_name - digitalenergy.online
|
||||
- namespace - decort
|
||||
- type - decort
|
||||
- version - 1.2
|
||||
- target - windows_amd64
|
||||
|
||||
6. After all, create a file `main.tf`.
|
||||
7. Add to the file next code section
|
||||
|
||||
```terraform
|
||||
terraform {
|
||||
required_providers {
|
||||
decort = {
|
||||
version = "1.2"
|
||||
source = "digitalenergy.online/decort/decort"
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
`version`- field for provider's version
|
||||
Required
|
||||
String
|
||||
Note: Versions in code section and in a repository must be equal!
|
||||
|
||||
`source` - path to repository with provider's version
|
||||
|
||||
```bash
|
||||
${host_name}/${namespace}/${type}
|
||||
```
|
||||
|
||||
NOTE: all paramters must be equal to the repository path!
|
||||
|
||||
8. Execute command in your terminal
|
||||
|
||||
```bash
|
||||
terraform init
|
||||
```
|
||||
|
||||
9. If everything all right - you got green message in your terminal!
|
||||
|
||||
More details about the provider's building process: https://learn.hashicorp.com/tutorials/terraform/provider-use?in=terraform/providers
|
||||
|
||||
## Examples and Samples
|
||||
|
||||
- Examples: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
|
||||
- Samples: see in repository `samples`
|
||||
|
||||
Terraform schemas in:
|
||||
|
||||
- See in repository `docs`
|
||||
|
||||
Good work!
|
@ -1,48 +0,0 @@
|
||||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "decort_audit Data Source - terraform-provider-decort"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
|
||||
---
|
||||
|
||||
# decort_audit (Data Source)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `audit_guid` (String) audit guid
|
||||
|
||||
### Optional
|
||||
|
||||
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `args` (String)
|
||||
- `call` (String)
|
||||
- `guid` (String)
|
||||
- `id` (String) The ID of this resource.
|
||||
- `kwargs` (String)
|
||||
- `remote_addr` (String)
|
||||
- `responsetime` (Number)
|
||||
- `result` (String)
|
||||
- `status_code` (Number)
|
||||
- `tags` (String)
|
||||
- `timestamp` (Number)
|
||||
- `timestamp_end` (Number)
|
||||
- `user` (String)
|
||||
|
||||
<a id="nestedblock--timeouts"></a>
|
||||
### Nested Schema for `timeouts`
|
||||
|
||||
Optional:
|
||||
|
||||
- `default` (String)
|
||||
- `read` (String)
|
@ -1,48 +0,0 @@
|
||||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "decort_cb_dpdknet Data Source - terraform-provider-decort"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
|
||||
---
|
||||
|
||||
# decort_cb_dpdknet (Data Source)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `dpdk_id` (Number) The unique ID of the subscriber-owner of the DPDK network
|
||||
|
||||
### Optional
|
||||
|
||||
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `account_access` (List of Number) List of accounts with access
|
||||
- `compute_ids` (List of Number) Compute IDs which uses this DPDK network
|
||||
- `created_time` (Number) Created time
|
||||
- `desc` (String) Description of DPDK network
|
||||
- `gid` (Number) ID of the grid (platform)
|
||||
- `guid` (Number) DPDK network ID on the storage side
|
||||
- `id` (String) The ID of this resource.
|
||||
- `name` (String) Name of network
|
||||
- `ovs_bridge` (String) OVS bridge in which interfaces for computers created
|
||||
- `rg_access` (List of Number) List of resource groups with access
|
||||
- `status` (String) DPDK network status
|
||||
- `updated_time` (Number) Updated time
|
||||
- `vlan_id` (Number) vlan ID
|
||||
|
||||
<a id="nestedblock--timeouts"></a>
|
||||
### Nested Schema for `timeouts`
|
||||
|
||||
Optional:
|
||||
|
||||
- `default` (String)
|
||||
- `read` (String)
|
@ -1,63 +0,0 @@
|
||||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "decort_cb_dpdknet_list Data Source - terraform-provider-decort"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
|
||||
---
|
||||
|
||||
# decort_cb_dpdknet_list (Data Source)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Optional
|
||||
|
||||
- `by_id` (Number) Find by ID
|
||||
- `compute_ids` (List of Number) Find by compute IDs
|
||||
- `desc` (String) Find by description
|
||||
- `gid` (Number) Find by GID
|
||||
- `name` (String) Find by name
|
||||
- `page` (Number) Page number
|
||||
- `size` (Number) Page size
|
||||
- `sort_by` (String) sort by one of supported fields, format +|-(field)
|
||||
- `status` (String) Find by status
|
||||
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `entry_count` (Number)
|
||||
- `id` (String) The ID of this resource.
|
||||
- `items` (List of Object) (see [below for nested schema](#nestedatt--items))
|
||||
|
||||
<a id="nestedblock--timeouts"></a>
|
||||
### Nested Schema for `timeouts`
|
||||
|
||||
Optional:
|
||||
|
||||
- `default` (String)
|
||||
- `read` (String)
|
||||
|
||||
|
||||
<a id="nestedatt--items"></a>
|
||||
### Nested Schema for `items`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `account_access` (List of Number)
|
||||
- `compute_ids` (List of Number)
|
||||
- `created_time` (Number)
|
||||
- `desc` (String)
|
||||
- `dpdk_id` (Number)
|
||||
- `gid` (Number)
|
||||
- `guid` (Number)
|
||||
- `name` (String)
|
||||
- `ovs_bridge` (String)
|
||||
- `rg_access` (List of Number)
|
||||
- `status` (String)
|
||||
- `updated_time` (Number)
|
||||
- `vlan_id` (Number)
|
@ -1,61 +0,0 @@
|
||||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "decort_cb_extnet_reserved_ip_list Data Source - terraform-provider-decort"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
|
||||
---
|
||||
|
||||
# decort_cb_extnet_reserved_ip_list (Data Source)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `account_id` (Number)
|
||||
|
||||
### Optional
|
||||
|
||||
- `extnet_id` (Number)
|
||||
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) The ID of this resource.
|
||||
- `items` (List of Object) (see [below for nested schema](#nestedatt--items))
|
||||
|
||||
<a id="nestedblock--timeouts"></a>
|
||||
### Nested Schema for `timeouts`
|
||||
|
||||
Optional:
|
||||
|
||||
- `default` (String)
|
||||
- `read` (String)
|
||||
|
||||
|
||||
<a id="nestedatt--items"></a>
|
||||
### Nested Schema for `items`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `extnet_id` (Number)
|
||||
- `reservations` (List of Object) (see [below for nested schema](#nestedobjatt--items--reservations))
|
||||
|
||||
<a id="nestedobjatt--items--reservations"></a>
|
||||
### Nested Schema for `items.reservations`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `account_id` (Number)
|
||||
- `client_type` (String)
|
||||
- `domain_name` (String)
|
||||
- `hostname` (String)
|
||||
- `ip` (String)
|
||||
- `mac` (String)
|
||||
- `type` (String)
|
||||
- `vm_id` (Number)
|
@ -1,114 +0,0 @@
|
||||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "decort_cb_grid_get_settings Data Source - terraform-provider-decort"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
|
||||
---
|
||||
|
||||
# decort_cb_grid_get_settings (Data Source)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `grid_id` (Number) grid (platform) ID
|
||||
|
||||
### Optional
|
||||
|
||||
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `allowed_ports` (List of Number)
|
||||
- `cleanup_retention_period` (Number)
|
||||
- `docker_registry` (List of Object) (see [below for nested schema](#nestedatt--docker_registry))
|
||||
- `enable_uptime_monitor` (Boolean)
|
||||
- `extnet_max_pre_reservations_num` (Number)
|
||||
- `healthcheck_notifications` (List of Object) (see [below for nested schema](#nestedatt--healthcheck_notifications))
|
||||
- `id` (String) The ID of this resource.
|
||||
- `k8s_cleanup_enabled` (Boolean)
|
||||
- `limits` (String)
|
||||
- `location_url` (String)
|
||||
- `net_qos` (List of Object) (see [below for nested schema](#nestedatt--net_qos))
|
||||
- `networks` (String)
|
||||
- `prometheus` (List of Object) (see [below for nested schema](#nestedatt--prometheus))
|
||||
- `vins_max_pre_reservations_num` (Number)
|
||||
- `vnfdev_mgmt_net_range` (String)
|
||||
|
||||
<a id="nestedblock--timeouts"></a>
|
||||
### Nested Schema for `timeouts`
|
||||
|
||||
Optional:
|
||||
|
||||
- `default` (String)
|
||||
- `read` (String)
|
||||
|
||||
|
||||
<a id="nestedatt--docker_registry"></a>
|
||||
### Nested Schema for `docker_registry`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `password` (String)
|
||||
- `server` (String)
|
||||
- `username` (String)
|
||||
|
||||
|
||||
<a id="nestedatt--healthcheck_notifications"></a>
|
||||
### Nested Schema for `healthcheck_notifications`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `emails` (List of Object) (see [below for nested schema](#nestedobjatt--healthcheck_notifications--emails))
|
||||
|
||||
<a id="nestedobjatt--healthcheck_notifications--emails"></a>
|
||||
### Nested Schema for `healthcheck_notifications.emails`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `address` (String)
|
||||
- `enabled` (Boolean)
|
||||
|
||||
|
||||
|
||||
<a id="nestedatt--net_qos"></a>
|
||||
### Nested Schema for `net_qos`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `extnet` (List of Object) (see [below for nested schema](#nestedobjatt--net_qos--extnet))
|
||||
- `vins` (List of Object) (see [below for nested schema](#nestedobjatt--net_qos--vins))
|
||||
|
||||
<a id="nestedobjatt--net_qos--extnet"></a>
|
||||
### Nested Schema for `net_qos.extnet`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `e_rate` (Number)
|
||||
- `in_burst` (Number)
|
||||
- `in_rate` (Number)
|
||||
|
||||
|
||||
<a id="nestedobjatt--net_qos--vins"></a>
|
||||
### Nested Schema for `net_qos.vins`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `e_rate` (Number)
|
||||
- `in_burst` (Number)
|
||||
- `in_rate` (Number)
|
||||
|
||||
|
||||
|
||||
<a id="nestedatt--prometheus"></a>
|
||||
### Nested Schema for `prometheus`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `scrape_interval` (Number)
|
@ -1,48 +0,0 @@
|
||||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "decort_dpdknet Data Source - terraform-provider-decort"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
|
||||
---
|
||||
|
||||
# decort_dpdknet (Data Source)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `dpdk_id` (Number) The unique ID of the subscriber-owner of the DPDK network
|
||||
|
||||
### Optional
|
||||
|
||||
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `account_access` (List of Number) List of accounts with access
|
||||
- `compute_ids` (List of Number) Compute IDs which uses this DPDK network
|
||||
- `created_time` (Number) Created time
|
||||
- `desc` (String) Description of DPDK network
|
||||
- `gid` (Number) ID of the grid (platform)
|
||||
- `guid` (Number) DPDK network ID on the storage side
|
||||
- `id` (String) The ID of this resource.
|
||||
- `name` (String) Name of network
|
||||
- `ovs_bridge` (String) OVS bridge in which interfaces for computers created
|
||||
- `rg_access` (List of Number) List of resource groups with access
|
||||
- `status` (String) DPDK network status
|
||||
- `updated_time` (Number) Updated time
|
||||
- `vlan_id` (Number) vlan ID
|
||||
|
||||
<a id="nestedblock--timeouts"></a>
|
||||
### Nested Schema for `timeouts`
|
||||
|
||||
Optional:
|
||||
|
||||
- `default` (String)
|
||||
- `read` (String)
|
@ -1,63 +0,0 @@
|
||||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "decort_dpdknet_list Data Source - terraform-provider-decort"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
|
||||
---
|
||||
|
||||
# decort_dpdknet_list (Data Source)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Optional
|
||||
|
||||
- `by_id` (Number) Find by ID
|
||||
- `compute_ids` (List of Number) Find by compute IDs
|
||||
- `desc` (String) Find by description
|
||||
- `gid` (Number) Find by GID
|
||||
- `name` (String) Find by name
|
||||
- `page` (Number) Page number
|
||||
- `size` (Number) Page size
|
||||
- `sort_by` (String) sort by one of supported fields, format +|-(field)
|
||||
- `status` (String) Find by status
|
||||
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `entry_count` (Number)
|
||||
- `id` (String) The ID of this resource.
|
||||
- `items` (List of Object) (see [below for nested schema](#nestedatt--items))
|
||||
|
||||
<a id="nestedblock--timeouts"></a>
|
||||
### Nested Schema for `timeouts`
|
||||
|
||||
Optional:
|
||||
|
||||
- `default` (String)
|
||||
- `read` (String)
|
||||
|
||||
|
||||
<a id="nestedatt--items"></a>
|
||||
### Nested Schema for `items`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `account_access` (List of Number)
|
||||
- `compute_ids` (List of Number)
|
||||
- `created_time` (Number)
|
||||
- `desc` (String)
|
||||
- `dpdk_id` (Number)
|
||||
- `gid` (Number)
|
||||
- `guid` (Number)
|
||||
- `name` (String)
|
||||
- `ovs_bridge` (String)
|
||||
- `rg_access` (List of Number)
|
||||
- `status` (String)
|
||||
- `updated_time` (Number)
|
||||
- `vlan_id` (Number)
|
@ -1,61 +0,0 @@
|
||||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "decort_extnet_reserved_ip_list Data Source - terraform-provider-decort"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
|
||||
---
|
||||
|
||||
# decort_extnet_reserved_ip_list (Data Source)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `account_id` (Number)
|
||||
|
||||
### Optional
|
||||
|
||||
- `extnet_id` (Number)
|
||||
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `id` (String) The ID of this resource.
|
||||
- `items` (List of Object) (see [below for nested schema](#nestedatt--items))
|
||||
|
||||
<a id="nestedblock--timeouts"></a>
|
||||
### Nested Schema for `timeouts`
|
||||
|
||||
Optional:
|
||||
|
||||
- `default` (String)
|
||||
- `read` (String)
|
||||
|
||||
|
||||
<a id="nestedatt--items"></a>
|
||||
### Nested Schema for `items`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `extnet_id` (Number)
|
||||
- `reservations` (List of Object) (see [below for nested schema](#nestedobjatt--items--reservations))
|
||||
|
||||
<a id="nestedobjatt--items--reservations"></a>
|
||||
### Nested Schema for `items.reservations`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `account_id` (Number)
|
||||
- `client_type` (String)
|
||||
- `domain_name` (String)
|
||||
- `hostname` (String)
|
||||
- `ip` (String)
|
||||
- `mac` (String)
|
||||
- `type` (String)
|
||||
- `vm_id` (Number)
|
@ -0,0 +1,148 @@
|
||||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "decort_cb_disk_replication Resource - terraform-provider-decort"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
|
||||
---
|
||||
|
||||
# decort_cb_disk_replication (Resource)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `disk_id` (Number) Id of primary disk
|
||||
- `disk_name` (String) Name of disk replica
|
||||
- `pool_name` (String) Pool for disk location
|
||||
- `sep_id` (Number) Storage endpoint provider ID to create disk replica
|
||||
|
||||
### Optional
|
||||
|
||||
- `detach` (Boolean) Detach disk from machine first
|
||||
- `pause` (Boolean) Resume replication
|
||||
- `permanently` (Boolean) Delete disk permanently
|
||||
- `reason` (String) Reason for disk deletion
|
||||
- `reverse` (Boolean) Reverse replication
|
||||
- `start` (Boolean) Start/Stop replication
|
||||
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `account_id` (Number)
|
||||
- `account_name` (String)
|
||||
- `acl` (String)
|
||||
- `boot_partition` (Number)
|
||||
- `computes` (List of Object) (see [below for nested schema](#nestedatt--computes))
|
||||
- `created_time` (Number)
|
||||
- `deleted_time` (Number)
|
||||
- `desc` (String)
|
||||
- `destruction_time` (Number)
|
||||
- `devicename` (String)
|
||||
- `disk_path` (String)
|
||||
- `gid` (Number)
|
||||
- `guid` (Number)
|
||||
- `id` (String) The ID of this resource.
|
||||
- `image_id` (Number)
|
||||
- `images` (List of Number)
|
||||
- `iotune` (List of Object) (see [below for nested schema](#nestedatt--iotune))
|
||||
- `iqn` (String)
|
||||
- `login` (String)
|
||||
- `milestones` (Number)
|
||||
- `order` (Number)
|
||||
- `params` (String)
|
||||
- `parent_id` (Number)
|
||||
- `passwd` (String)
|
||||
- `pci_slot` (Number)
|
||||
- `present_to` (List of Number)
|
||||
- `purge_attempts` (Number)
|
||||
- `purge_time` (Number)
|
||||
- `reality_device_number` (Number)
|
||||
- `reference_id` (String)
|
||||
- `replica_disk_id` (Number) Id of replica disk
|
||||
- `replication` (List of Object) Replication status (see [below for nested schema](#nestedatt--replication))
|
||||
- `res_id` (String)
|
||||
- `res_name` (String)
|
||||
- `role` (String)
|
||||
- `sep_type` (String)
|
||||
- `shareable` (Boolean)
|
||||
- `size_max` (Number)
|
||||
- `size_used` (Number)
|
||||
- `snapshots` (List of Object) (see [below for nested schema](#nestedatt--snapshots))
|
||||
- `status` (String)
|
||||
- `status_replication` (String) Status of replication
|
||||
- `tech_status` (String)
|
||||
- `type` (String)
|
||||
- `vmid` (Number)
|
||||
|
||||
<a id="nestedblock--timeouts"></a>
|
||||
### Nested Schema for `timeouts`
|
||||
|
||||
Optional:
|
||||
|
||||
- `create` (String)
|
||||
- `default` (String)
|
||||
- `delete` (String)
|
||||
- `read` (String)
|
||||
- `update` (String)
|
||||
|
||||
|
||||
<a id="nestedatt--computes"></a>
|
||||
### Nested Schema for `computes`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `compute_id` (String)
|
||||
- `compute_name` (String)
|
||||
|
||||
|
||||
<a id="nestedatt--iotune"></a>
|
||||
### Nested Schema for `iotune`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `read_bytes_sec` (Number)
|
||||
- `read_bytes_sec_max` (Number)
|
||||
- `read_iops_sec` (Number)
|
||||
- `read_iops_sec_max` (Number)
|
||||
- `size_iops_sec` (Number)
|
||||
- `total_bytes_sec` (Number)
|
||||
- `total_bytes_sec_max` (Number)
|
||||
- `total_iops_sec` (Number)
|
||||
- `total_iops_sec_max` (Number)
|
||||
- `write_bytes_sec` (Number)
|
||||
- `write_bytes_sec_max` (Number)
|
||||
- `write_iops_sec` (Number)
|
||||
- `write_iops_sec_max` (Number)
|
||||
|
||||
|
||||
<a id="nestedatt--replication"></a>
|
||||
### Nested Schema for `replication`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `disk_id` (Number)
|
||||
- `pool_id` (String)
|
||||
- `role` (String)
|
||||
- `self_volume_id` (String)
|
||||
- `storage_id` (String)
|
||||
- `volume_id` (String)
|
||||
|
||||
|
||||
<a id="nestedatt--snapshots"></a>
|
||||
### Nested Schema for `snapshots`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `guid` (String)
|
||||
- `label` (String)
|
||||
- `reference_id` (String)
|
||||
- `res_id` (String)
|
||||
- `snap_set_guid` (String)
|
||||
- `snap_set_time` (Number)
|
||||
- `timestamp` (Number)
|
@ -1,52 +0,0 @@
|
||||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "decort_cb_dpdknet Resource - terraform-provider-decort"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
|
||||
---
|
||||
|
||||
# decort_cb_dpdknet (Resource)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `gid` (Number) ID of the grid (platform)
|
||||
- `name` (String) Name of network
|
||||
- `ovs_bridge` (String) OVS bridge in which interfaces for computers created
|
||||
- `vlan_id` (Number) vlan ID
|
||||
|
||||
### Optional
|
||||
|
||||
- `account_access` (List of Number) List of accounts with access
|
||||
- `desc` (String) Description of DPDK network
|
||||
- `enabled` (Boolean) Enabled or disabled DPDK network
|
||||
- `rg_access` (List of Number) List of resource groups with access
|
||||
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `compute_ids` (List of Number) Compute IDs which uses this DPDK network
|
||||
- `created_time` (Number) Created time
|
||||
- `dpdk_id` (Number) The unique ID of the subscriber-owner of the DPDK network
|
||||
- `guid` (Number) DPDK network ID on the storage side
|
||||
- `id` (String) The ID of this resource.
|
||||
- `status` (String) DPDK network status
|
||||
- `updated_time` (Number) Updated time
|
||||
|
||||
<a id="nestedblock--timeouts"></a>
|
||||
### Nested Schema for `timeouts`
|
||||
|
||||
Optional:
|
||||
|
||||
- `create` (String)
|
||||
- `default` (String)
|
||||
- `delete` (String)
|
||||
- `read` (String)
|
||||
- `update` (String)
|
@ -0,0 +1,137 @@
|
||||
---
|
||||
# generated by https://github.com/hashicorp/terraform-plugin-docs
|
||||
page_title: "decort_disk_replication Resource - terraform-provider-decort"
|
||||
subcategory: ""
|
||||
description: |-
|
||||
|
||||
---
|
||||
|
||||
# decort_disk_replication (Resource)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- schema generated by tfplugindocs -->
|
||||
## Schema
|
||||
|
||||
### Required
|
||||
|
||||
- `disk_id` (Number) Id of primary disk
|
||||
- `disk_name` (String) Name of disk replica
|
||||
- `pool_name` (String) Pool for disk location
|
||||
- `sep_id` (Number) Storage endpoint provider ID to create disk replica
|
||||
|
||||
### Optional
|
||||
|
||||
- `detach` (Boolean) Detach disk from machine first
|
||||
- `pause` (Boolean) Resume replication
|
||||
- `permanently` (Boolean) Delete disk permanently
|
||||
- `reason` (String) Reason for disk deletion
|
||||
- `reverse` (Boolean) Reverse replication
|
||||
- `start` (Boolean) Start/Stop replication
|
||||
- `timeouts` (Block, Optional) (see [below for nested schema](#nestedblock--timeouts))
|
||||
|
||||
### Read-Only
|
||||
|
||||
- `account_id` (Number) The unique ID of the subscriber-owner of the disk
|
||||
- `account_name` (String) The name of the subscriber '(account') to whom this disk belongs
|
||||
- `acl` (String)
|
||||
- `computes` (List of Object) (see [below for nested schema](#nestedatt--computes))
|
||||
- `created_time` (Number) Created time
|
||||
- `deleted_time` (Number) Deleted time
|
||||
- `desc` (String) Description of disk
|
||||
- `destruction_time` (Number) Time of final deletion
|
||||
- `devicename` (String) Name of the device
|
||||
- `gid` (Number) ID of the grid (platform)
|
||||
- `id` (String) The ID of this resource.
|
||||
- `image_id` (Number) Image ID
|
||||
- `images` (List of String) IDs of images using the disk
|
||||
- `iotune` (List of Object) (see [below for nested schema](#nestedatt--iotune))
|
||||
- `order` (Number) Disk order
|
||||
- `params` (String) Disk params
|
||||
- `parent_id` (Number) ID of the parent disk
|
||||
- `pci_slot` (Number) ID of the pci slot to which the disk is connected
|
||||
- `present_to` (List of Number)
|
||||
- `purge_time` (Number) Time of the last deletion attempt
|
||||
- `replica_disk_id` (Number) Id of replica disk
|
||||
- `replication` (List of Object) Replication status (see [below for nested schema](#nestedatt--replication))
|
||||
- `res_id` (String) Resource ID
|
||||
- `res_name` (String) Name of the resource
|
||||
- `role` (String) Disk role
|
||||
- `sep_type` (String) Type SEP. Defines the type of storage system and contains one of the values set in the cloud platform
|
||||
- `shareable` (Boolean)
|
||||
- `size_max` (Number) Size in GB
|
||||
- `size_used` (Number) Number of used space, in GB
|
||||
- `snapshots` (List of Object) (see [below for nested schema](#nestedatt--snapshots))
|
||||
- `status` (String) Disk status
|
||||
- `status_replication` (String) Status of replication
|
||||
- `tech_status` (String) Technical status of the disk
|
||||
- `type` (String) The type of disk in terms of its role in compute: 'B=Boot, D=Data, T=Temp'
|
||||
- `vmid` (Number) Virtual Machine ID (Deprecated)
|
||||
|
||||
<a id="nestedblock--timeouts"></a>
|
||||
### Nested Schema for `timeouts`
|
||||
|
||||
Optional:
|
||||
|
||||
- `create` (String)
|
||||
- `default` (String)
|
||||
- `delete` (String)
|
||||
- `read` (String)
|
||||
- `update` (String)
|
||||
|
||||
|
||||
<a id="nestedatt--computes"></a>
|
||||
### Nested Schema for `computes`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `compute_id` (String)
|
||||
- `compute_name` (String)
|
||||
|
||||
|
||||
<a id="nestedatt--iotune"></a>
|
||||
### Nested Schema for `iotune`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `read_bytes_sec` (Number)
|
||||
- `read_bytes_sec_max` (Number)
|
||||
- `read_iops_sec` (Number)
|
||||
- `read_iops_sec_max` (Number)
|
||||
- `size_iops_sec` (Number)
|
||||
- `total_bytes_sec` (Number)
|
||||
- `total_bytes_sec_max` (Number)
|
||||
- `total_iops_sec` (Number)
|
||||
- `total_iops_sec_max` (Number)
|
||||
- `write_bytes_sec` (Number)
|
||||
- `write_bytes_sec_max` (Number)
|
||||
- `write_iops_sec` (Number)
|
||||
- `write_iops_sec_max` (Number)
|
||||
|
||||
|
||||
<a id="nestedatt--replication"></a>
|
||||
### Nested Schema for `replication`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `disk_id` (Number)
|
||||
- `pool_id` (String)
|
||||
- `role` (String)
|
||||
- `self_volume_id` (String)
|
||||
- `storage_id` (String)
|
||||
- `volume_id` (String)
|
||||
|
||||
|
||||
<a id="nestedatt--snapshots"></a>
|
||||
### Nested Schema for `snapshots`
|
||||
|
||||
Read-Only:
|
||||
|
||||
- `guid` (String)
|
||||
- `label` (String)
|
||||
- `res_id` (String)
|
||||
- `snap_set_guid` (String)
|
||||
- `snap_set_time` (Number)
|
||||
- `timestamp` (Number)
|
@ -1,128 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2019-2023 Digital Energy Cloud Solutions LLC. All Rights Reserved.
|
||||
Authors:
|
||||
Petr Krutov, <petr.krutov@digitalenergy.online>
|
||||
Stanislav Solovev, <spsolovev@digitalenergy.online>
|
||||
Sergey Kisil, <svkisil@digitalenergy.online>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
|
||||
Orchestration Technology) with Terraform by Hashicorp.
|
||||
|
||||
Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
|
||||
|
||||
Please see README.md to learn where to place source code so that it
|
||||
builds seamlessly.
|
||||
|
||||
Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
|
||||
*/
|
||||
|
||||
package audit
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/constants"
|
||||
)
|
||||
|
||||
func dataSourceAuditRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
||||
auditRec, err := utilityAuditCheckPresence(ctx, d, m)
|
||||
if err != nil {
|
||||
d.SetId("") // ensure ID is empty in this case
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
|
||||
flattenAudit(d, auditRec)
|
||||
d.SetId(d.Get("audit_guid").(string))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func DataSourceAudit() *schema.Resource {
|
||||
return &schema.Resource{
|
||||
SchemaVersion: 1,
|
||||
|
||||
ReadContext: dataSourceAuditRead,
|
||||
|
||||
Timeouts: &schema.ResourceTimeout{
|
||||
Read: &constants.Timeout30s,
|
||||
Default: &constants.Timeout60s,
|
||||
},
|
||||
|
||||
Schema: dataSourceAuditSchemaMake(),
|
||||
}
|
||||
}
|
||||
|
||||
func dataSourceAuditSchemaMake() map[string]*schema.Schema {
|
||||
return map[string]*schema.Schema{
|
||||
"audit_guid": {
|
||||
Type: schema.TypeString,
|
||||
Required: true,
|
||||
Description: "audit guid",
|
||||
},
|
||||
|
||||
"args": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"call": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"guid": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"kwargs": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"remote_addr": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"responsetime": {
|
||||
Type: schema.TypeFloat,
|
||||
Computed: true,
|
||||
},
|
||||
"result": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"status_code": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
"tags": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"timestamp": {
|
||||
Type: schema.TypeFloat,
|
||||
Computed: true,
|
||||
},
|
||||
"timestamp_end": {
|
||||
Type: schema.TypeFloat,
|
||||
Computed: true,
|
||||
},
|
||||
"user": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
}
|
@ -1,56 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2019-2023 Digital Energy Cloud Solutions LLC. All Rights Reserved.
|
||||
Authors:
|
||||
Petr Krutov, <petr.krutov@digitalenergy.online>
|
||||
Stanislav Solovev, <spsolovev@digitalenergy.online>
|
||||
Sergey Kisil, <svkisil@digitalenergy.online>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
|
||||
Orchestration Technology) with Terraform by Hashicorp.
|
||||
|
||||
Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
|
||||
|
||||
Please see README.md to learn where to place source code so that it
|
||||
builds seamlessly.
|
||||
|
||||
Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
|
||||
*/
|
||||
|
||||
package audit
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
log "github.com/sirupsen/logrus"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/audit"
|
||||
)
|
||||
|
||||
func flattenAudit(d *schema.ResourceData, au *audit.RecordAudit) {
|
||||
log.Debugf("flattenAudit: decoded audit guid %s", d.Get("audit_guid").(string))
|
||||
|
||||
d.Set("args", au.Arguments)
|
||||
d.Set("call", au.Call)
|
||||
d.Set("guid", au.GUID)
|
||||
d.Set("kwargs", au.Kwargs)
|
||||
d.Set("remote_addr", au.RemoteAddr)
|
||||
d.Set("responsetime", au.ResponseTime)
|
||||
d.Set("result", au.Result)
|
||||
d.Set("status_code", au.StatusCode)
|
||||
d.Set("tags", au.Tags)
|
||||
d.Set("timestamp", au.Timestamp)
|
||||
d.Set("timestamp_end", au.TimestampEnd)
|
||||
d.Set("user", au.User)
|
||||
}
|
@ -1,62 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2019-2023 Digital Energy Cloud Solutions LLC. All Rights Reserved.
|
||||
Authors:
|
||||
Petr Krutov, <petr.krutov@digitalenergy.online>
|
||||
Stanislav Solovev, <spsolovev@digitalenergy.online>
|
||||
Sergey Kisil, <svkisil@digitalenergy.online>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
|
||||
Orchestration Technology) with Terraform by Hashicorp.
|
||||
|
||||
Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
|
||||
|
||||
Please see README.md to learn where to place source code so that it
|
||||
builds seamlessly.
|
||||
|
||||
Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
|
||||
*/
|
||||
|
||||
package audit
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
"repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/audit"
|
||||
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
)
|
||||
|
||||
func utilityAuditCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*audit.RecordAudit, error) {
|
||||
c := m.(*controller.ControllerCfg)
|
||||
req := audit.GetRequest{}
|
||||
|
||||
if d.Id() != "" {
|
||||
req.AuditGuid = d.Id()
|
||||
} else {
|
||||
req.AuditGuid = d.Get("audit_guid").(string)
|
||||
}
|
||||
|
||||
log.Debugf("utilityStackCheckPresence: load audit")
|
||||
auditInfo, err := c.CloudAPI().Audit().Get(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return auditInfo, nil
|
||||
}
|
@ -1,153 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2019-2022 Digital Energy Cloud Solutions LLC. All Rights Reserved.
|
||||
Authors:
|
||||
Petr Krutov, <petr.krutov@digitalenergy.online>
|
||||
Stanislav Solovev, <spsolovev@digitalenergy.online>
|
||||
Kasim Baybikov, <kmbaybikov@basistech.ru>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
|
||||
Orchestration Technology) with Terraform by Hashicorp.
|
||||
|
||||
Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
|
||||
|
||||
Please see README.md to learn where to place source code so that it
|
||||
builds seamlessly.
|
||||
|
||||
Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
|
||||
*/
|
||||
|
||||
package dpdknet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/constants"
|
||||
)
|
||||
|
||||
func dataSourceDPDKNetRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
||||
dpdk, err := utilityDPDKNetCheckPresence(ctx, d, m)
|
||||
if err != nil {
|
||||
d.SetId("")
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
|
||||
id := uuid.New()
|
||||
d.SetId(id.String())
|
||||
|
||||
flattenDPDKNet(d, dpdk)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func dataSourceDPDKNetSchemaMake() map[string]*schema.Schema {
|
||||
res := map[string]*schema.Schema{
|
||||
"dpdk_id": {
|
||||
Type: schema.TypeInt,
|
||||
Required: true,
|
||||
Description: "The unique ID of the subscriber-owner of the DPDK network",
|
||||
},
|
||||
"account_access": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Elem: &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
},
|
||||
Description: "List of accounts with access",
|
||||
},
|
||||
"created_time": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
Description: "Created time",
|
||||
},
|
||||
"desc": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Description: "Description of DPDK network",
|
||||
},
|
||||
"gid": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
Description: "ID of the grid (platform)",
|
||||
},
|
||||
"guid": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
Description: "DPDK network ID on the storage side",
|
||||
},
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Description: "Name of network",
|
||||
},
|
||||
"rg_access": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Elem: &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
},
|
||||
Description: "List of resource groups with access",
|
||||
},
|
||||
"status": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Description: "DPDK network status",
|
||||
},
|
||||
"ovs_bridge": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Description: "OVS bridge in which interfaces for computers created",
|
||||
},
|
||||
"vlan_id": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
Description: "vlan ID",
|
||||
},
|
||||
"compute_ids": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Elem: &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
},
|
||||
Description: "Compute IDs which uses this DPDK network",
|
||||
},
|
||||
"updated_time": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
Description: "Updated time",
|
||||
},
|
||||
}
|
||||
|
||||
return res
|
||||
}
|
||||
|
||||
func DataSourceDPDKNet() *schema.Resource {
|
||||
return &schema.Resource{
|
||||
SchemaVersion: 1,
|
||||
|
||||
ReadContext: dataSourceDPDKNetRead,
|
||||
|
||||
Timeouts: &schema.ResourceTimeout{
|
||||
Read: &constants.Timeout30s,
|
||||
Default: &constants.Timeout60s,
|
||||
},
|
||||
|
||||
Schema: dataSourceDPDKNetSchemaMake(),
|
||||
}
|
||||
}
|
@ -1,212 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2019-2022 Digital Energy Cloud Solutions LLC. All Rights Reserved.
|
||||
Authors:
|
||||
Petr Krutov, <petr.krutov@digitalenergy.online>
|
||||
Stanislav Solovev, <spsolovev@digitalenergy.online>
|
||||
Kasim Baybikov, <kmbaybikov@basistech.ru>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
|
||||
Orchestration Technology) with Terraform by Hashicorp.
|
||||
|
||||
Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
|
||||
|
||||
Please see README.md to learn where to place source code so that it
|
||||
builds seamlessly.
|
||||
|
||||
Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
|
||||
*/
|
||||
|
||||
package dpdknet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/constants"
|
||||
)
|
||||
|
||||
func dataSourceDPDKNetListRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
||||
dpdkList, err := utilityDPDKNetListCheckPresence(ctx, d, m)
|
||||
if err != nil {
|
||||
d.SetId("")
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
|
||||
id := uuid.New()
|
||||
d.SetId(id.String())
|
||||
d.Set("items", flattenDPDKNetList(dpdkList))
|
||||
d.Set("entry_count", dpdkList.EntryCount)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func dataSourceDPDKNetListSchemaMake() map[string]*schema.Schema {
|
||||
res := map[string]*schema.Schema{
|
||||
"by_id": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "Find by ID",
|
||||
},
|
||||
"gid": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "Find by GID",
|
||||
},
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "Find by name",
|
||||
},
|
||||
"desc": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "Find by description",
|
||||
},
|
||||
"status": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "Find by status",
|
||||
},
|
||||
"compute_ids": {
|
||||
Type: schema.TypeList,
|
||||
Optional: true,
|
||||
Elem: &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
},
|
||||
Description: "Find by compute IDs",
|
||||
},
|
||||
"sort_by": {
|
||||
Type: schema.TypeString,
|
||||
Optional: true,
|
||||
Description: "sort by one of supported fields, format +|-(field)",
|
||||
},
|
||||
"page": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "Page number",
|
||||
},
|
||||
"size": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
Description: "Page size",
|
||||
},
|
||||
"items": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"dpdk_id": {
|
||||
Type: schema.TypeInt,
|
||||
Required: true,
|
||||
Description: "The unique ID of the subscriber-owner of the DPDK network",
|
||||
},
|
||||
"account_access": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Elem: &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
},
|
||||
Description: "List of accounts with access",
|
||||
},
|
||||
"created_time": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
Description: "Created time",
|
||||
},
|
||||
"desc": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Description: "Description of DPDK network",
|
||||
},
|
||||
"gid": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
Description: "ID of the grid (platform)",
|
||||
},
|
||||
"guid": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
Description: "DPDK network ID on the storage side",
|
||||
},
|
||||
"name": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Description: "Name of network",
|
||||
},
|
||||
"rg_access": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Elem: &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
},
|
||||
Description: "List of resource groups with access",
|
||||
},
|
||||
"status": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Description: "DPDK network status",
|
||||
},
|
||||
"ovs_bridge": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
Description: "OVS bridge in which interfaces for computers created",
|
||||
},
|
||||
"vlan_id": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
Description: "vlan ID",
|
||||
},
|
||||
"compute_ids": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Elem: &schema.Schema{
|
||||
Type: schema.TypeInt,
|
||||
},
|
||||
Description: "Compute IDs which uses this DPDK network",
|
||||
},
|
||||
"updated_time": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
Description: "Updated time",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
"entry_count": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func DataSourceDPDKNetList() *schema.Resource {
|
||||
return &schema.Resource{
|
||||
SchemaVersion: 1,
|
||||
|
||||
ReadContext: dataSourceDPDKNetListRead,
|
||||
|
||||
Timeouts: &schema.ResourceTimeout{
|
||||
Read: &constants.Timeout30s,
|
||||
Default: &constants.Timeout60s,
|
||||
},
|
||||
|
||||
Schema: dataSourceDPDKNetListSchemaMake(),
|
||||
}
|
||||
}
|
@ -1,44 +0,0 @@
|
||||
package dpdknet
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
dpdk "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/dpdknet"
|
||||
)
|
||||
|
||||
func flattenDPDKNet(d *schema.ResourceData, dpdk *dpdk.RecordDPDKNet) {
|
||||
d.Set("dpdk_id", dpdk.ID)
|
||||
d.Set("account_access", dpdk.AccountAccess)
|
||||
d.Set("created_time", dpdk.CreatedTime)
|
||||
d.Set("desc", dpdk.Description)
|
||||
d.Set("gid", dpdk.GID)
|
||||
d.Set("guid", dpdk.GUID)
|
||||
d.Set("name", dpdk.Name)
|
||||
d.Set("rg_access", dpdk.RGAccess)
|
||||
d.Set("status", dpdk.Status)
|
||||
d.Set("ovs_bridge", dpdk.OVSBridge)
|
||||
d.Set("vlan_id", dpdk.VlanID)
|
||||
d.Set("compute_ids", dpdk.ComputeIDs)
|
||||
d.Set("updated_time", dpdk.UpdatedTime)
|
||||
}
|
||||
|
||||
func flattenDPDKNetList(list *dpdk.ListDPDKNet) []map[string]interface{} {
|
||||
res := make([]map[string]interface{}, 0, len(list.Data))
|
||||
for _, dpdk := range list.Data {
|
||||
temp := map[string]interface{}{
|
||||
"dpdk_id": dpdk.ID,
|
||||
"account_access": dpdk.AccountAccess,
|
||||
"desc": dpdk.Description,
|
||||
"gid": dpdk.GID,
|
||||
"guid": dpdk.GUID,
|
||||
"name": dpdk.Name,
|
||||
"rg_access": dpdk.RGAccess,
|
||||
"status": dpdk.Status,
|
||||
"ovs_bridge": dpdk.OVSBridge,
|
||||
"vlan_id": dpdk.VlanID,
|
||||
"compute_ids": dpdk.ComputeIDs,
|
||||
"updated_time": dpdk.UpdatedTime,
|
||||
}
|
||||
res = append(res, temp)
|
||||
}
|
||||
return res
|
||||
}
|
@ -1,68 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2019-2022 Digital Energy Cloud Solutions LLC. All Rights Reserved.
|
||||
Authors:
|
||||
Petr Krutov, <petr.krutov@digitalenergy.online>
|
||||
Stanislav Solovev, <spsolovev@digitalenergy.online>
|
||||
Kasim Baybikov, <kmbaybikov@basistech.ru>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
|
||||
Orchestration Technology) with Terraform by Hashicorp.
|
||||
|
||||
Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
|
||||
|
||||
Please see README.md to learn where to place source code so that it
|
||||
builds seamlessly.
|
||||
|
||||
Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
|
||||
*/
|
||||
|
||||
package dpdknet
|
||||
|
||||
import (
|
||||
"context"
|
||||
"strconv"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
log "github.com/sirupsen/logrus"
|
||||
dpdk "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/dpdknet"
|
||||
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller"
|
||||
)
|
||||
|
||||
func utilityDPDKNetCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*dpdk.RecordDPDKNet, error) {
|
||||
c := m.(*controller.ControllerCfg)
|
||||
req := dpdk.GetRequest{}
|
||||
|
||||
if d.Get("dpdk_id") != nil {
|
||||
if d.Get("dpdk_id").(int) == 0 {
|
||||
id, _ := strconv.ParseUint(d.Id(), 10, 64)
|
||||
req.DPDKID = id
|
||||
} else {
|
||||
req.DPDKID = uint64(d.Get("dpdk_id").(int))
|
||||
}
|
||||
} else {
|
||||
id, _ := strconv.ParseUint(d.Id(), 10, 64)
|
||||
req.DPDKID = id
|
||||
}
|
||||
|
||||
log.Debugf("utilityDPDKCheckPresence: get DPDK network")
|
||||
dpdk, err := c.CloudAPI().DPDKNet().Get(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return dpdk, nil
|
||||
}
|
@ -1,87 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2019-2022 Digital Energy Cloud Solutions LLC. All Rights Reserved.
|
||||
Authors:
|
||||
Petr Krutov, <petr.krutov@digitalenergy.online>
|
||||
Stanislav Solovev, <spsolovev@digitalenergy.online>
|
||||
Kasim Baybikov, <kmbaybikov@basistech.ru>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
|
||||
Orchestration Technology) with Terraform by Hashicorp.
|
||||
|
||||
Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
|
||||
|
||||
Please see README.md to learn where to place source code so that it
|
||||
builds seamlessly.
|
||||
|
||||
Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
|
||||
*/
|
||||
|
||||
package dpdknet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
log "github.com/sirupsen/logrus"
|
||||
dpdk "repository.basistech.ru/BASIS/decort-golang-sdk/pkg/cloudapi/dpdknet"
|
||||
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/controller"
|
||||
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
)
|
||||
|
||||
func utilityDPDKNetListCheckPresence(ctx context.Context, d *schema.ResourceData, m interface{}) (*dpdk.ListDPDKNet, error) {
|
||||
c := m.(*controller.ControllerCfg)
|
||||
req := dpdk.ListRequest{}
|
||||
|
||||
if byID, ok := d.GetOk("by_id"); ok {
|
||||
req.ByID = uint64(byID.(int))
|
||||
}
|
||||
if GID, ok := d.GetOk("gid"); ok {
|
||||
req.GID = uint64(GID.(int))
|
||||
}
|
||||
if name, ok := d.GetOk("name"); ok {
|
||||
req.Name = name.(string)
|
||||
}
|
||||
if desc, ok := d.GetOk("description"); ok {
|
||||
req.Description = desc.(string)
|
||||
}
|
||||
if status, ok := d.GetOk("status"); ok {
|
||||
req.Status = status.(string)
|
||||
}
|
||||
if computeIDs, ok := d.GetOk("compute_ids"); ok {
|
||||
IDs := computeIDs.([]interface{})
|
||||
for _, ID := range IDs {
|
||||
req.ComputeIDs = append(req.ComputeIDs, uint64(ID.(int)))
|
||||
}
|
||||
}
|
||||
if sortBy, ok := d.GetOk("sort_by"); ok {
|
||||
req.SortBy = sortBy.(string)
|
||||
}
|
||||
if page, ok := d.GetOk("page"); ok {
|
||||
req.Page = uint64(page.(int))
|
||||
}
|
||||
if size, ok := d.GetOk("size"); ok {
|
||||
req.Size = uint64(size.(int))
|
||||
}
|
||||
|
||||
log.Debugf("utilityDPDKListCheckPresence: load DPDK network list")
|
||||
dpdkList, err := c.CloudAPI().DPDKNet().List(ctx, req)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return dpdkList, nil
|
||||
}
|
@ -1,137 +0,0 @@
|
||||
/*
|
||||
Copyright (c) 2019-2022 Digital Energy Cloud Solutions LLC. All Rights Reserved.
|
||||
Authors:
|
||||
Petr Krutov, <petr.krutov@digitalenergy.online>
|
||||
Stanislav Solovev, <spsolovev@digitalenergy.online>
|
||||
Kasim Baybikov, <kmbaybikov@basistech.ru>
|
||||
Tim Tkachev, <tvtkachev@basistech.ru>
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
/*
|
||||
Terraform DECORT provider - manage resources provided by DECORT (Digital Energy Cloud
|
||||
Orchestration Technology) with Terraform by Hashicorp.
|
||||
|
||||
Source code: https://repository.basistech.ru/BASIS/terraform-provider-decort
|
||||
|
||||
Please see README.md to learn where to place source code so that it
|
||||
builds seamlessly.
|
||||
|
||||
Documentation: https://repository.basistech.ru/BASIS/terraform-provider-decort/wiki
|
||||
*/
|
||||
|
||||
package extnet
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/diag"
|
||||
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
|
||||
"repository.basistech.ru/BASIS/terraform-provider-decort/internal/constants"
|
||||
)
|
||||
|
||||
func dataSourceExtnetReservedIpRead(ctx context.Context, d *schema.ResourceData, m interface{}) diag.Diagnostics {
|
||||
reservedList, err := utilityExtnetReservedIpCheckPresence(ctx, d, m)
|
||||
if err != nil {
|
||||
return diag.FromErr(err)
|
||||
}
|
||||
|
||||
id := uuid.New()
|
||||
d.SetId(id.String())
|
||||
d.Set("items", flattenExtnetReservedIp(reservedList))
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func dataSourceExtnetReservedIpSchemaMake() map[string]*schema.Schema {
|
||||
res := map[string]*schema.Schema{
|
||||
"account_id": {
|
||||
Type: schema.TypeInt,
|
||||
Required: true,
|
||||
},
|
||||
"extnet_id": {
|
||||
Type: schema.TypeInt,
|
||||
Optional: true,
|
||||
},
|
||||
"items": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"extnet_id": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
"reservations": {
|
||||
Type: schema.TypeList,
|
||||
Computed: true,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"account_id": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
"client_type": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"domain_name": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"hostname": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"ip": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"mac": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"type": {
|
||||
Type: schema.TypeString,
|
||||
Computed: true,
|
||||
},
|
||||
"vm_id": {
|
||||
Type: schema.TypeInt,
|
||||
Computed: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
||||
func DataSourceExtnetReservedIp() *schema.Resource {
|
||||
return &schema.Resource{
|
||||
SchemaVersion: 1,
|
||||
|
||||
ReadContext: dataSourceExtnetReservedIpRead,
|
||||
|
||||
Timeouts: &schema.ResourceTimeout{
|
||||
Read: &constants.Timeout30s,
|
||||
Default: &constants.Timeout60s,
|
||||
},
|
||||
|
||||
Schema: dataSourceExtnetReservedIpSchemaMake(),
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue