@POST @Consumes({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @Produces({MediaType.APPLICATION_XML,MediaType.APPLICATION_JSON}) @CheckPermission(roles={Role.SYSTEM_ADMIN,Role.TENANT_ADMIN}) @Path("/{id}/vcenter-data-centers") public VcenterDataCenterRestRep createVcenterDataCenter(@PathParam("id") URI id,VcenterDataCenterCreate createParam) throws DatabaseException {
  Vcenter vcenter=queryObject(Vcenter.class,id,false);
  checkDuplicateChildName(id,VcenterDataCenter.class,DATAOBJECT_NAME_FIELD,"vcenter",createParam.getName(),_dbClient);
  VcenterDataCenter datacenter=new VcenterDataCenter();
  datacenter.setId(URIUtil.createId(VcenterDataCenter.class));
  datacenter.setLabel(createParam.getName());
  datacenter.setVcenter(id);
  if (vcenter.getCascadeTenancy()) {
    datacenter.setTenant(_permissionsHelper.getTenant(vcenter.getAcls()));
  }
 else {
    datacenter.setTenant(NullColumnValueGetter.getNullURI());
  }
  _dbClient.createObject(datacenter);
  auditOp(OperationTypeEnum.CREATE_VCENTER_DATACENTER,true,null,datacenter.auditParameters());
  return map(datacenter);
}

@ POST @ Consumes ( { MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON } ) @ Produces ( { MediaType . APPLICATION_XML , MediaType . APPLICATION_JSON } ) @ CheckPermission ( roles = { Role . SYSTEM_ADMIN , Role . TENANT_ADMIN } ) @ Path ( "/{id}/vcenter-data-centers" ) public VcenterDataCenterRestRep createVcenterDataCenter ( @ PathParam ( "id" ) URI id , VcenterDataCenterCreate createParam ) throws DatabaseException { Vcenter vcenter = queryObject ( Vcenter . class , id , false ) ; checkDuplicateChildName ( id , VcenterDataCenter . class , DATAOBJECT_NAME_FIELD , "vcenter" , createParam . getName ( ) , _dbClient ) ; VcenterDataCenter datacenter = new VcenterDataCenter ( ) ; datacenter . setId ( URIUtil . createId ( VcenterDataCenter . class ) ) ; datacenter . setLabel ( createParam . getName ( ) ) ; datacenter . setVcenter ( id ) ; if ( vcenter . getCascadeTenancy ( ) ) { datacenter . setTenant ( _permissionsHelper . getTenant ( vcenter . getAcls ( ) ) ) ; } else { datacenter . setTenant ( NullColumnValueGetter . getNullURI ( ) ) ; } _dbClient . createObject ( datacenter ) ; auditOp ( OperationTypeEnum . CREATE_VCENTER_DATACENTER , true , null , datacenter . auditParameters ( ) ) ; return map ( datacenter ) ; }
creates a new vcenter data center .
