private Response createOrUpdate(final NamespacesInstanceModel model, final UriInfo uriInfo,
    final Admin admin, final boolean updateExisting) {
    NamespaceDescriptor.Builder builder = NamespaceDescriptor.create(namespace);
    builder.addConfiguration(model.getProperties());
    if (model.getProperties().size() > 0) {
      builder.addConfiguration(model.getProperties());
    }
    NamespaceDescriptor nsd = builder.build();

    try {
      if (updateExisting) {
        admin.modifyNamespace(nsd);
      } else {
        admin.createNamespace(nsd);
      }
    } catch (IOException e) {
      servlet.getMetrics().incrementFailedPutRequests(1);
      return processException(e);
    }

    servlet.getMetrics().incrementSucessfulPutRequests(1);

    return updateExisting
      ? Response.ok(uriInfo.getAbsolutePath()).build()
      : Response.created(uriInfo.getAbsolutePath()).build();
  }
Build a response for POST create namespace with properties specified.
@param model   properties used for create.
@param uriInfo (JAX-RS context variable) request URL
@return response code.
hbase-rest/src/main/java/org/apache/hadoop/hbase/rest/NamespacesInstanceResource.java