Custom Fields Manager Add Custom Field Def

Custom Fields Manager Add Custom Field Def

Creates a new custom field.

If the moType is specified, the field will only be available for that type of managed object.

Required privileges: Global.ManageCustomFields

Request
URI
POST
https://{vcenter-host}/sdk/vim25/{release}/CustomFieldsManager/{moId}/AddCustomFieldDef
COPY
Path Parameters
string
moId
Required

The unique identifier for the managed object to which the method attaches; the serialized managed object reference for a request has the form moType/moId, in this case CustomFieldsManager/{moId}.

string
release
Required

The vSphere release schema. The current specification covers vSphere 8.0.2.0 APIs.


Request Body
AddCustomFieldDefRequestType of type(s) application/json
Required
{
    "name": "string",
    "moType": "string",
    "fieldDefPolicy": {
        "_typeName": "string",
        "createPrivilege": "string",
        "readPrivilege": "string",
        "updatePrivilege": "string",
        "deletePrivilege": "string"
    },
    "fieldPolicy": {
        "_typeName": "string",
        "createPrivilege": "string",
        "readPrivilege": "string",
        "updatePrivilege": "string",
        "deletePrivilege": "string"
    }
}
string
name
Required

The name of the field.

string
moType
Optional

The managed object type to which this field will apply

fieldDefPolicy
Optional

Describes a basic privilege policy.

fieldPolicy
Optional

Describes a basic privilege policy.

Authentication
This operation uses the following authentication methods.
Responses
200

OK

Returns CustomFieldDef of type(s) application/json
This response body class contains all of the following: DataObject
{
    "_typeName": "string",
    "key": 0,
    "name": "string",
    "type": "string",
    "managedObjectType": "string",
    "fieldDefPrivileges": {
        "_typeName": "string",
        "createPrivilege": "string",
        "readPrivilege": "string",
        "updatePrivilege": "string",
        "deletePrivilege": "string"
    },
    "fieldInstancePrivileges": {
        "_typeName": "string",
        "createPrivilege": "string",
        "readPrivilege": "string",
        "updatePrivilege": "string",
        "deletePrivilege": "string"
    }
}
integer As int32 As int32
key
Required

A unique ID used to reference this custom field in assignments.

This ID is unique for the lifetime of the field (even across rename operations).

string
name
Required

Name of the field.

string
type
Required

Type of the field.

string
managedObjectType
Optional

Type of object for which the field is valid.

If not specified, the field is valid for all managed objects.

fieldDefPrivileges
Optional

Describes a basic privilege policy.

fieldInstancePrivileges
Optional

Describes a basic privilege policy.


500

DuplicateName: if a custom field with the name already exists.

InvalidPrivilege: if a specified privilege is not defined.

Returns VimFault of type(s) application/json
This response body class contains all of the following: MethodFault
{
    "_typeName": "string",
    "faultCause": "MethodFault Object",
    "faultMessage": [
        {
            "_typeName": "string",
            "key": "string",
            "arg": [
                {
                    "_typeName": "string",
                    "key": "string",
                    "value": {
                        "_typeName": "string"
                    }
                }
            ],
            "message": "string"
        }
    ]
}