github.com/vmware/govmomi@v0.51.0/vapi/resource.go (about) 1 // © Broadcom. All Rights Reserved. 2 // The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. 3 // SPDX-License-Identifier: Apache-2.0 4 5 package vapi 6 7 import ( 8 "strings" 9 10 "github.com/vmware/govmomi/vim25/types" 11 ) 12 13 const ( 14 // Path is the new-style endpoint for API resources. It supersedes /rest. 15 Path = "/api" 16 ) 17 18 func Task(id string) types.ManagedObjectReference { 19 return types.ManagedObjectReference{ 20 Type: "Task", 21 Value: strings.SplitN(id, ":", 2)[0], 22 } 23 }