Create V2 Namespace Templates
Creates a namespace template on a Supervisor. This release supports creating a single namespace template, and the call fails if there is a request to make another one.
Request
URLURL
Path Parameters
Path Parameters
Identifier for the Supervisor. The parameter must be an identifier for the resource type: com.vmware.vcenter.namespace_management.supervisor.Supervisor.
Header Parameters
Header Parameters
Required session ID, acquired from Create Session API under CIS product
vmware-api-session-id example
"b00db39f948d13ea1e59b4d6fce56389"
Request Body
Specification for setting up the namespace template.
{
"resource_spec": {},
"storage_specs": [
{
"policy": "string"
}
],
"template": "string"
}
Resource quotas that this template defines. Resource quota on the namespace. Refer to com.vmware.vcenter.namespace_management.NamespaceResourceOptions.Info#createResourceQuotaType and use com.vmware.vcenter.namespace_management.NamespaceResourceOptions#get for retrieving the type for the value for this field. For an example of this, see ResourceQuotaOptionsV1.
Storage that this template defines and will be associated with a namespace after namespace realization. This field should not be empty and at least one policy should be supplied. The {link create} throws {term InvalidArgument} exception if this field is set empty.
Identifier of the namespace template. This has DNS_LABEL restrictions as specified in . This name is unique across all namespaces templates in this vCenter server. When clients pass a value of this structure as a parameter, the field must be an identifier for the resource type: ClusterComputeResource. When operations return a value of this structure as a result, the field will be an identifier for the resource type: ClusterComputeResource.
vSphere Networks that this template captures and are associated with the namespace after namespace realization. vSphere Namespaces network objects to be associated with the namespace. The values of this list need to reference names of pre-existing com.vmware.vcenter.namespace_management.Networks.Info structures. The field must be left unset if the cluster hosting the namespace uses NSXT_CONTAINER_PLUGIN as the network provider, since the network(s) for this namespace will be managed by NSX-T Container Plugin. If field is unset when the cluster hosting the namespace uses VSPHERE_NETWORK as its network provider, the namespace will automatically be associated with the cluster’s Supervisor Primary Workload Network. The field currently accepts at most only 1 vSphere Namespaces network object reference. When clients pass a value of this structure as a parameter, the field must contain identifiers for the resource type: com.vmware.vcenter.namespace_management.Network. When operations return a value of this structure as a result, the field will contain identifiers for the resource type: com.vmware.vcenter.namespace_management.Network.
Permissions associated with namespace template. If unset, only users with the Administrator role can use this template; for example, this template is applied to the namespace created by self-service-users with the Administrator role.
VM Service specification to be associated with the namespace template. Namespaces created using this template will have access to the virtual machine classes and Content Libraries specified in the NamespaceTemplates.CreateSpec.vm-service-spec by default. If unset, the namespaces created using this template will not have access to any virtual machine classes and Content Libraries by default.
Authentication
Errors
Errors
com.vmware.vapi.std.errors.invalid_argument : if spec contain any errors, or if {link CreateSpec#storageSpecs} is empty, or if {link CreateSpec#resourceSpec} is not set with {term memory_limit}, {term cpu_limit}, {term storage_request_limit}, or if {link CreateSpec#networks} is not set with networks if the Supervisor hosting the namespaces uses VSPHERE_NETWORK as its network provider, or if {link CreateSpec#networks} is not empty if the Supervisor hosting the namespaces uses NSXT_CONTAINER_PLUGIN as its network provider. | com.vmware.vapi.std.errors.unsupported : if a request arrives to create a second template. | com.vmware.vapi.std.errors.already_exists : if the namespace template with given name already exists.
com.vmware.vapi.std.errors.unauthorized : if the user does not have Namespaces.SelfServiceManage privilege.
com.vmware.vapi.std.errors.error : if the system reports an error while responding to the request.
‘Default’ means this response is used for all HTTP codes that are not covered individually for this operation.
Code Samples
PowerCLI Client SDK Example
PowerCLI Client SDK All Parameters Example
cURL Command
Vendor Extensions
x-vmw-doc-operation: create_v2