private Command<Void> getCreateCommand(final Map<String, Object> properties) {
    return new Command<Void>() {
      @Override
      public Void invoke() throws AmbariException {
        ViewRegistry       viewRegistry   = ViewRegistry.getInstance();

        ViewURLEntity urlEntity = toEntity(properties);

        ViewInstanceEntity viewInstanceEntity = urlEntity.getViewInstanceEntity();
        ViewEntity viewEntity = viewInstanceEntity.getViewEntity();
        String     viewName   = viewEntity.getCommonName();
        String     version    = viewEntity.getVersion();
        ViewEntity view       = viewRegistry.getDefinition(viewName, version);

        if ( view == null ) {
          throw new IllegalStateException("The view " + viewName + " is not registered.");
        }

        // the view must be in the DEPLOYED state to create an instance
        if (!view.isDeployed()) {
          throw new IllegalStateException("The view " + viewName + " is not loaded.");
        }

        if(viewInstanceEntity.getViewUrl() != null) {
          throw new AmbariException("The view instance selected already has a linked URL");
        }

        if(viewURLDAO.findByName(urlEntity.getUrlName()).isPresent()){
          throw new AmbariException("This view URL name exists, URL names should be unique");
        }

        if (viewURLDAO.findBySuffix(urlEntity.getUrlSuffix()).isPresent()) {
          throw new AmbariException("This view URL suffix has already been recorded, URL suffixes should be unique");
        }

        viewURLDAO.save(urlEntity);
        // Update the view with the URL
        viewInstanceEntity.setViewUrl(urlEntity);
        try {
          viewRegistry.updateViewInstance(viewInstanceEntity);
        } catch (ValidationException e) {
          throw new IllegalArgumentException(e.getMessage(), e);
        } catch (org.apache.ambari.view.SystemException e) {
          throw new AmbariException("Caught exception trying to update view URL.", e);
        }
        viewRegistry.updateView(viewInstanceEntity);
        return null;
      }
    };
  }
Get the command to create the View URL
@param properties
@return A command to create the View URL instance
ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ViewURLResourceProvider.java