Skip to content

Commit

Permalink
#
Browse files Browse the repository at this point in the history
Signed-off-by: abarreiro <[email protected]>
  • Loading branch information
abarreiro committed Nov 20, 2024
1 parent eee1605 commit 8afd278
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions vcd/resource_vcd_tm_content_library_item.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,32 @@ func resourceVcdTmContentLibraryItem() *schema.Resource {
"name": {
Type: schema.TypeString,
Required: true,
ForceNew: true, // TODO: TM: Update not supported yet
Description: fmt.Sprintf("Name of the %s", labelTmContentLibraryItem),
},
"description": {
Type: schema.TypeString,
Optional: true,
ForceNew: true, // TODO: TM: Update not supported yet
Description: fmt.Sprintf("The description of the %s", labelTmContentLibraryItem),
},
"content_library_id": {
Type: schema.TypeString,
Required: true,
ForceNew: true, // TODO: TM: Update not supported yet
Description: fmt.Sprintf("ID of the Content Library that this %s belongs to", labelTmContentLibraryItem),
},
"file_path": {
Type: schema.TypeString,
Optional: true, // Not needed when Importing
ForceNew: true, // TODO: TM: Update not supported yet
Description: fmt.Sprintf("Path to the OVA/ISO to create the %s", labelTmContentLibraryItem),
},
"creation_date": {
Type: schema.TypeString,
Computed: true,
Description: fmt.Sprintf("The ISO-8601 timestamp representing when this %s was created", labelTmContentLibraryItem),
},
"description": {
Type: schema.TypeString,
Computed: true,
Description: fmt.Sprintf("The description of the %s", labelTmContentLibraryItem),
},
"image_identifier": {
Type: schema.TypeString,
Computed: true,
Expand Down Expand Up @@ -111,8 +115,10 @@ func resourceVcdTmContentLibraryItemCreate(ctx context.Context, d *schema.Resour
return createResource(ctx, d, meta, c)
}

func resourceVcdTmContentLibraryItemUpdate(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
vcdClient := meta.(*VCDClient)
func resourceVcdTmContentLibraryItemUpdate(_ context.Context, _ *schema.ResourceData, _ interface{}) diag.Diagnostics {
// TODO: TM: Update is not supported yet
return diag.Errorf("update not supported")
/*vcdClient := meta.(*VCDClient)
clId := d.Get("content_library_id").(string)
cl, err := vcdClient.GetContentLibraryById(clId)
Expand All @@ -127,7 +133,7 @@ func resourceVcdTmContentLibraryItemUpdate(ctx context.Context, d *schema.Resour
resourceReadFunc: resourceVcdTmContentLibraryItemRead,
}
return updateResource(ctx, d, meta, c)
return updateResource(ctx, d, meta, c)*/
}

func resourceVcdTmContentLibraryItemRead(ctx context.Context, d *schema.ResourceData, meta interface{}) diag.Diagnostics {
Expand Down Expand Up @@ -164,7 +170,7 @@ func resourceVcdTmContentLibraryItemDelete(ctx context.Context, d *schema.Resour
return deleteResource(ctx, d, meta, c)
}

func resourceVcdTmContentLibraryItemImport(ctx context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
func resourceVcdTmContentLibraryItemImport(_ context.Context, d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
vcdClient := meta.(*VCDClient)

id := strings.Split(d.Id(), ImportSeparator)
Expand All @@ -187,7 +193,7 @@ func resourceVcdTmContentLibraryItemImport(ctx context.Context, d *schema.Resour
return []*schema.ResourceData{d}, nil
}

func getContentLibraryItemType(vcdClient *VCDClient, d *schema.ResourceData) (*types.ContentLibraryItem, error) {
func getContentLibraryItemType(_ *VCDClient, d *schema.ResourceData) (*types.ContentLibraryItem, error) {
t := &types.ContentLibraryItem{
Name: d.Get("name").(string),
Description: d.Get("description").(string),
Expand Down

0 comments on commit 8afd278

Please sign in to comment.