Skip to content

Commit

Permalink
Merge pull request #52 from latitudesh/feat/v3-update
Browse files Browse the repository at this point in the history
feat: API v2023-01-06 support
  • Loading branch information
ynhummel authored Dec 12, 2023
2 parents 20e5746 + 094397c commit a1d2f73
Show file tree
Hide file tree
Showing 12 changed files with 37 additions and 20 deletions.
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ terraform {
required_providers {
latitudesh = {
source = "latitudesh/latitudesh"
version = "~> 0.2.9"
version = "~> 0.3.0"
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion docs/resources/project.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@ resource "latitudesh_project" "project" {

### Required

- `description` (String) The description of the project
- `environment` (String) The name of the project
- `name` (String) The name of the project

### Optional

- `description` (String) The description of the project

### Read-Only

- `created` (String) The timestamp for when the project was created
Expand Down
4 changes: 2 additions & 2 deletions docs/resources/server.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ resource "latitudesh_server" "server" {

### Optional

- `ipxe_url` Public URL for the iPXE script. Required for custom image deployments. Learn more: https://docs.latitude.sh/docs/custom-image-ipxe
- `ipxe_url` (String) Public URL for the iPXE script. Required for custom image deployments. Learn more: https://docs.latitude.sh/docs/custom-image-ipxe
- `raid` (String) RAID mode for the server
- `ssh_keys` (List of String) List of server SSH key ids
- `user_data` (Number) The id of user data to set on the server
- `user_data` (String) The id of user data to set on the server

### Read-Only

Expand Down
9 changes: 8 additions & 1 deletion docs/resources/virtual_network.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,11 @@ resource "latitudesh_virtual_network" "virtual_network" {

- `assignments_count` (Number) Amount of devices assigned to the virtual network
- `id` (String) The ID of this resource.
- `vid` (Number) The vlan ID of the virtual network
- `vid` (Number) The vlan ID of the virtual network

## Import
VirtualNetwork can be imported using the VirtualNetworkID along with the projectID that contains the VirtualNetwork, e.g.,

```sh
$ terraform import latitudesh_virtual_network.virtual_network projectID:VirtualNetworkID
```
13 changes: 10 additions & 3 deletions docs/resources/vlan_assignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ resource "latitudesh_vlan_assignment" "vlan_assignment" {

### Required

- `server_id` (Number) The assignment server ID
- `virtual_network_id` (Number) The virtual network ID
- `server_id` (String) The assignment server ID
- `virtual_network_id` (String) The virtual network ID

### Read-Only

Expand All @@ -33,4 +33,11 @@ resource "latitudesh_vlan_assignment" "vlan_assignment" {
- `server_hostname` (String) The assignment server hostname
- `server_label` (String) The assignment server label
- `status` (String) The assignment status
- `vid` (Number) The vlan ID of the virtual network
- `vid` (Number) The vlan ID of the virtual network

## Import
VlanAssignment can be imported using the VlanAssignmentID along with the projectID that contains the VirtualNetwork, e.g.,

```sh
$ terraform import latitudesh_vlan_assignment.vlan_assignment projectID:VlanAssignmentID
```
2 changes: 1 addition & 1 deletion examples/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
latitudesh = {
source = "latitudesh/latitudesh"
version = "~> 0.2.9"
version = "~> 0.3.0"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ go 1.18
require (
github.com/hashicorp/terraform-plugin-docs v0.13.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.21.0
github.com/latitudesh/latitudesh-go v0.2.6
github.com/latitudesh/latitudesh-go v0.3.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ 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/latitudesh/latitudesh-go v0.2.6 h1:GdSJbRnQ1dNj4nREwgixXV8xOCmEZmVZNJ8+8TiuQHY=
github.com/latitudesh/latitudesh-go v0.2.6/go.mod h1:ZCQD0XkY0AVl37WOfH3H16w+3AGnCfUVKcYmH1ERZpQ=
github.com/latitudesh/latitudesh-go v0.3.0 h1:GQGUqmeDWDqY/dEppWN5j51onvDavjeooRzhv+2/LL0=
github.com/latitudesh/latitudesh-go v0.3.0/go.mod h1:ZCQD0XkY0AVl37WOfH3H16w+3AGnCfUVKcYmH1ERZpQ=
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
Expand Down
2 changes: 1 addition & 1 deletion latitudesh/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const (
userAgentForProvider = "Latitude-Terraform-Provider"
)

var currentVersion = "0.2.9" // update varible when version updated
var currentVersion = "0.3.0" // update varible when version updated

func Provider() *schema.Provider {
return &schema.Provider{
Expand Down
2 changes: 1 addition & 1 deletion latitudesh/resource_project.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func resourceProject() *schema.Resource {
"description": {
Type: schema.TypeString,
Description: "The description of the project",
Required: true,
Optional: true,
},
"environment": {
Type: schema.TypeString,
Expand Down
4 changes: 2 additions & 2 deletions latitudesh/resource_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func resourceServer() *schema.Resource {
},
},
"user_data": {
Type: schema.TypeInt,
Type: schema.TypeString,
Description: "The id of user data to set on the server",
Optional: true,
},
Expand Down Expand Up @@ -109,7 +109,7 @@ func resourceServerCreate(ctx context.Context, d *schema.ResourceData, m interfa
OperatingSystem: d.Get("operating_system").(string),
Hostname: d.Get("hostname").(string),
SSHKeys: ssh_keys_slice,
UserData: d.Get("user_data").(int),
UserData: d.Get("user_data").(string),
Raid: d.Get("raid").(string),
IpxeUrl: d.Get("ipxe_url").(string),
},
Expand Down
8 changes: 4 additions & 4 deletions latitudesh/resource_vlan_assignment.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ func resourceVlanAssignment() *schema.Resource {
DeleteContext: resourceVlanAssignmentDelete,
Schema: map[string]*schema.Schema{
"virtual_network_id": {
Type: schema.TypeInt,
Type: schema.TypeString,
Description: "The virtual network ID",
Required: true,
ForceNew: true,
Expand All @@ -37,7 +37,7 @@ func resourceVlanAssignment() *schema.Resource {
Computed: true,
},
"server_id": {
Type: schema.TypeInt,
Type: schema.TypeString,
Description: "The assignment server ID",
Required: true,
ForceNew: true,
Expand Down Expand Up @@ -67,8 +67,8 @@ func resourceVlanAssignmentCreate(ctx context.Context, d *schema.ResourceData, m
Data: api.VlanAssignData{
Type: "virtual_network_assignment",
Attributes: api.VlanAssignAttributes{
ServerID: d.Get("server_id").(int),
VirtualNetworkID: d.Get("virtual_network_id").(int),
ServerID: d.Get("server_id").(string),
VirtualNetworkID: d.Get("virtual_network_id").(string),
},
},
}
Expand Down

0 comments on commit a1d2f73

Please sign in to comment.