apollo-openapi/src/main/java/com/ctrip/framework/apollo/openapi/client/service/NamespaceOpenApiService.java/NamespaceOpenApiService/createAppNamespace
class NamespaceOpenApiService:  @Override
  public OpenAppNamespaceDTO createAppNamespace(OpenAppNamespaceDTO appNamespaceDTO) {
    checkNotEmpty(appNamespaceDTO.getAppId(), "App id");
    checkNotEmpty(appNamespaceDTO.getName(), "Name");
    checkNotEmpty(appNamespaceDTO.getDataChangeCreatedBy(), "Created by");

    if (Strings.isNullOrEmpty(appNamespaceDTO.getFormat())) {
      appNamespaceDTO.setFormat(ConfigFileFormat.Properties.getValue());
    }

    OpenApiPathBuilder pathBuilder = OpenApiPathBuilder.newBuilder()
        .appsPathVal(appNamespaceDTO.getAppId())
        .customResource("appnamespaces");

    try (CloseableHttpResponse response = post(pathBuilder, appNamespaceDTO)) {
      return gson.fromJson(EntityUtils.toString(response.getEntity()), OpenAppNamespaceDTO.class);
    } catch (Throwable ex) {
      throw new RuntimeException(String
          .format("Create app namespace: %s for appId: %s, format: %s failed", appNamespaceDTO.getName(),
              appNamespaceDTO.getAppId(), appNamespaceDTO.getFormat()), ex);
    }
  }