# Managed Object - CustomFieldsManager(vim.CustomFieldsManager)

Property of
  ServiceContent
See also
  CustomFieldDef, ManagedEntity, PrivilegePolicyDef

## Managed Object Description

The CustomFieldsManager object is used to add and remove custom fields to managed entities.

The custom fields values set on managed entities are available through the customValue property and through the summary objects for VirtualMachine and HostSystem. They are not available directly through this managed object.

This functionality is only available through VirtualCenter.

Properties

Name | Type | Description
--- | --- | ---
field* P | CustomFieldDef[] | List of custom fields defined on this server. The fields are sorted by name.

*May not be present P Required privilege: System.View

Methods

Methods defined in this Managed Object
AddCustomFieldDef, RemoveCustomFieldDef, RenameCustomFieldDef, SetField

# AddCustomFieldDef(addFieldDefinition)

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

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the CustomFieldsManager used to make the method call.
name | xsd:string | The name of the field.
moType* | xsd:string | The managed object type to which this field will apply Since VI API 2.5
fieldDefPolicy* | PrivilegePolicyDef | Privilege policy to apply to FieldDef being created Since VI API 2.5
fieldPolicy* | PrivilegePolicyDef | Privilege policy to apply to instances of field Since VI API 2.5

*Need not be set

Return Value

Type | Description
--- | ---
CustomFieldDef |

Faults

Type | Description
--- | ---
DuplicateName | Thrown if a custom field with the name already exists.
InvalidPrivilege | Thrown if a specified privilege is not defined.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="AddCustomFieldDef" type="vsan:AddCustomFieldDefRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="AddCustomFieldDefResponse"> <complexType> <sequence> <element name="returnval" type="vsan:CustomFieldDef"/> </sequence> </complexType> </element>

# RemoveCustomFieldDef(removeFieldDefinition)

Removes a custom field. This also removes all values assigned to this custom field.

Required Privileges
  Global.ManageCustomFields

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the CustomFieldsManager used to make the method call.
key | xsd:int | The unique key for the field definition.

Return Value

Type | Description
--- | ---
None

Faults

Type | Description
--- | ---
InvalidArgument | Thrown if no custom field with that key exists.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="RemoveCustomFieldDef" type="vsan:RemoveCustomFieldDefRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="RemoveCustomFieldDefResponse"> <complexType/> </element>

# RenameCustomFieldDef(renameFieldDefinition)

Renames a custom field.

Required Privileges
  Global.ManageCustomFields

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the CustomFieldsManager used to make the method call.
key | xsd:int | The unique key for the field definition.
name | xsd:string | The new name for the field.

Return Value

Type | Description
--- | ---
None

Faults

Type | Description
--- | ---
DuplicateName | Thrown if a custom field with the name already exists.
InvalidArgument | Thrown if no custom field with that key exists.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="RenameCustomFieldDef" type="vsan:RenameCustomFieldDefRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="RenameCustomFieldDefResponse"> <complexType/> </element>

# SetField(setField)

Assigns a value to a custom field on an entity.

Required Privileges
  None

Parameters

Name | Type | Description
--- | --- | ---
_this | ManagedObjectReference | A reference to the CustomFieldsManager used to make the method call.
entity P | ManagedObjectReference to a ManagedEntity |
key | xsd:int |
value | xsd:string |

P Required privilege: Global.SetCustomField

Return Value

Type | Description
--- | ---
None

Faults

Type | Description
--- | ---
InvalidArgument | Thrown if no custom field with that key exists.
RuntimeFault | Thrown if any type of runtime fault is thrown that is not covered by the other faults; for example, a communication error.

Events

Type
None

Show WSDL type definition
<element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="SetField" type="vsan:SetFieldRequestType"/> <element xmlns="http://www.w3.org/2001/XMLSchema" xmlns:vsan="urn:vsan" name="SetFieldResponse"> <complexType/> </element>