Skip to content

Commit

Permalink
Merge pull request #581 from ovh/dev/aamstutz/add-dedicated-server-di…
Browse files Browse the repository at this point in the history
…splay-name

feat: Add display_name to datasource ovh_dedicated_server
  • Loading branch information
amstuta authored Mar 15, 2024
2 parents 5bfc31e + b835cec commit fe66c01
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 15 deletions.
5 changes: 5 additions & 0 deletions ovh/data_dedicated_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ func dataSourceDedicatedServer() *schema.Resource {
Type: schema.TypeString,
Computed: true,
},
"display_name": {
Type: schema.TypeString,
Computed: true,
},
"boot_id": {
Type: schema.TypeInt,
Computed: true,
Expand Down Expand Up @@ -206,6 +210,7 @@ func dataSourceDedicatedServerRead(d *schema.ResourceData, meta interface{}) err

d.SetId(ds.Name)
d.Set("urn", ds.URN)
d.Set("display_name", ds.DisplayName)
d.Set("boot_id", ds.BootId)
d.Set("boot_script", ds.BootScript)
d.Set("commercial_range", ds.CommercialRange)
Expand Down
2 changes: 2 additions & 0 deletions ovh/data_dedicated_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ func TestAccDedicatedServerDataSource_basic(t *testing.T) {
"data.ovh_dedicated_server.server", "boot_script", ""),
resource.TestCheckResourceAttrSet(
"data.ovh_dedicated_server.server", "urn"),
resource.TestCheckResourceAttrSet(
"data.ovh_dedicated_server.server", "display_name"),
),
},
},
Expand Down
31 changes: 16 additions & 15 deletions website/docs/d/dedicated_server.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,27 @@ data "ovh_dedicated_server" "server" {
`id` is set with the service_name of the dedicated server.
In addition, the following attributes are exported:

* `boot_id` - boot id of the server
* `boot_script` - boot script of the server
* `boot_id` - Boot id of the server
* `boot_script` - Boot script of the server
* `urn` - URN of the dedicated server instance
* `commercial_range` - dedicated server commercial range
* `datacenter` - dedicated datacenter localisation (bhs1,bhs2,...)
* `ip` - dedicated server ip (IPv4)
* `ips` - dedicated server ip blocks
* `link_speed` - link speed of the server
* `commercial_range` - Dedicated server commercial range
* `datacenter` - Dedicated datacenter localisation (bhs1,bhs2,...)
* `ip` - Dedicated server ip (IPv4)
* `ips` - Dedicated server ip blocks
* `link_speed` - Link speed of the server
* `monitoring` - Icmp monitoring state
* `name` - dedicated server name
* `name` - Dedicated server name
* `display_name` - Dedicated server display name
* `os` - Operating system
* `professional_use` - Does this server have professional use option
* `rack` - rack id of the server
* `rescue_mail` - rescue mail of the server
* `reverse` - dedicated server reverse
* `root_device` - root device of the server
* `server_id` - your server id
* `state` - error, hacked, hackedBlocked, ok
* `rack` - Rack id of the server
* `rescue_mail` - Rescue mail of the server
* `reverse` - Dedicated server reverse
* `root_device` - Root device of the server
* `server_id` - Server id
* `state` - Error, hacked, hackedBlocked, ok
* `support_level` - Dedicated server support level (critical, fastpath, gs, pro)
* `vnis` - the list of Virtualnetworkinterface assiociated with this server
* `vnis` - The list of Virtualnetworkinterface associated with this server
* `enabled` - VirtualNetworkInterface activation state
* `mode` - VirtualNetworkInterface mode (public,vrack,vrack_aggregation)
* `name` - User defined VirtualNetworkInterface name
Expand Down

0 comments on commit fe66c01

Please sign in to comment.