Unable to destroy vCenter server ContainerView object API endpoint https://{vcenter-host}/sdk/vim25/{release}/ContainerView/{moId}/container/DestroyView using CURL.
search cancel

Unable to destroy vCenter server ContainerView object API endpoint https://{vcenter-host}/sdk/vim25/{release}/ContainerView/{moId}/container/DestroyView using CURL.

book

Article ID: 376428

calendar_today

Updated On:

Products

VMware vCenter Server

Issue/Introduction

When using CURL command to destroy vCenter server ContainerView object API endpoint it will throw the below error.

curl -X POST -https://{vcenter-host}/sdk/vim25/{release}/ContainerView/{moId}/container/DestroyView -H "Accept: application/json" -H "vmware-api-session-id <session-id>"
 
Error:
 {
    "_typeName": "ManagedObjectNotFound",
    "obj": {
        "_typeName": "ManagedObjectReference",
        "value": "#####",
        "type": "ContainerView"
    },
    "faultstring": "The object 'vim.view.ContainerView:######' has already been deleted or has not been completely created"
}
 
##### -->  ContainerView Object ManagedObjectID

Environment

VMware vCenter Server 8.x

Cause

The API endpoint using CURL is failing due to the special characters appended to the view object ID.

Resolution

If we want to destroy the vCenter ContainerView object, we suggest to use one of the followings.

  • Use any of REST API Tool (ex: postman, SoapUI, Apigee etc) and execute the API endpoint.


(or)

  •  Please use "--globoff" flag with the curl command, like below.


curl -X POST -https://{vcenter-host}/sdk/vim25/{release}/ContainerView/{moId}/container/DestroyView -H "Accept: application/json" -H "vmware-api-session-id <session-id>" --globoff