Skip to content

Commit

Permalink
Add type to content library data source.
Browse files Browse the repository at this point in the history
  • Loading branch information
bill-rich committed Sep 2, 2020
1 parent da81642 commit 4bd409e
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
9 changes: 8 additions & 1 deletion vsphere/data_source_vsphere_content_library_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,13 @@ func dataSourceVSphereContentLibraryItem() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: "ID of the content library to contain item",
Description: "ID of the content library to contain item.",
},
"type": {
Type: schema.TypeString,
Required: true,
ForceNew: true,
Description: "Type of content library item.",
},
},
}
Expand All @@ -33,6 +39,7 @@ func dataSourceVSphereContentLibraryItemRead(d *schema.ResourceData, meta interf
if err != nil {
return provider.ProviderError(d.Get("name").(string), "dataSourceVSphereContentLibraryItemRead", err)
}
d.Set("type", item.Type)
d.SetId(item.ID)
return nil
}
5 changes: 2 additions & 3 deletions website/docs/d/content_library_item.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,5 @@ The following arguments are supported:

## Attribute Reference

The only attribute this resource exports is the `id` of the resource, which is
a combination of the [managed object reference ID][docs-about-morefs] of the
cluster, and the name of the virtual machine group.
* `id` - The UUID of the Content Library item.
* `type` - The Content Library type. Can be ovf, iso, or vm-template.
6 changes: 6 additions & 0 deletions website/vsphere.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
<li<%= sidebar_current("docs-vsphere-data-source-compute-cluster.html") %>>
<a href="/docs/providers/vsphere/d/compute_cluster.html">vsphere_compute_cluster</a>
</li>
<li<%= sidebar_current("docs-vsphere-data-source-content-library.html") %>>
<a href="/docs/providers/vsphere/d/compute_cluster.html">vsphere_content_library</a>
</li>
<li<%= sidebar_current("docs-vsphere-data-source-content-library-item.html") %>>
<a href="/docs/providers/vsphere/d/compute_cluster.html">vsphere_content_library_item</a>
</li>
<li<%= sidebar_current("docs-vsphere-data-source-custom-attribute") %>>
<a href="/docs/providers/vsphere/d/custom_attribute.html">vsphere_custom_attribute</a>
</li>
Expand Down

0 comments on commit 4bd409e

Please # to comment.