http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/controller/ExtensionLinkResponse.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/ExtensionLinkResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/ExtensionLinkResponse.java index 99c9ce9..c4f3941 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/ExtensionLinkResponse.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/ExtensionLinkResponse.java @@ -24,80 +24,32 @@ import java.util.Set; import org.apache.ambari.server.stack.Validable; +import io.swagger.annotations.ApiModelProperty; + /** * An extension version is like a stack version but it contains custom services. Linking an extension * version to the current stack version allows the cluster to install the custom services contained in * the extension version. */ -public class ExtensionLinkResponse implements Validable { - - private String linkId; - - private String stackName; - - private String stackVersion; - - private String extensionName; - - private String extensionVersion; +public class ExtensionLinkResponse implements Validable, ApiModel { + private ExtensionLinkResponseInfo extensionLinkResponseInfo; private boolean valid; - private Set<String> errorSet = new HashSet<>(); public ExtensionLinkResponse(String linkId, String stackName, String stackVersion, String extensionName, - String extensionVersion, boolean valid, Collection<String> errorSet) { - - setLinkId(linkId); - setStackName(stackName); - setStackVersion(stackVersion); - setExtensionName(extensionName); - setExtensionVersion(extensionVersion); - setValid(valid); - addErrors(errorSet); - } - - public String getLinkId() { - return linkId; - } - - public void setLinkId(String linkId) { - this.linkId = linkId; - } - - public String getStackName() { - return stackName; - } - - public void setStackName(String stackName) { - this.stackName = stackName; - } - - public String getStackVersion() { - return stackVersion; - } - - public void setStackVersion(String stackVersion) { - this.stackVersion = stackVersion; - } - - public String getExtensionName() { - return extensionName; + String extensionVersion, boolean valid, Collection<String> errorSet) { + extensionLinkResponseInfo = new ExtensionLinkResponseInfo(linkId, stackName, stackVersion, extensionName, + extensionVersion, valid, errorSet); } - public void setExtensionName(String extensionName) { - this.extensionName = extensionName; - } - - public String getExtensionVersion() { - return extensionVersion; - } - - public void setExtensionVersion(String extensionVersion) { - this.extensionVersion = extensionVersion; + @ApiModelProperty(name = "ExtensionLink") + public ExtensionLinkResponseInfo getExtensionLinkResponseInfo() { + return extensionLinkResponseInfo; } @Override + @ApiModelProperty(hidden = true) public boolean isValid() { return valid; } @@ -113,6 +65,7 @@ public class ExtensionLinkResponse implements Validable { } @Override + @ApiModelProperty(hidden = true) public Collection<String> getErrors() { return errorSet; } @@ -121,4 +74,70 @@ public class ExtensionLinkResponse implements Validable { public void addErrors(Collection<String> errors) { this.errorSet.addAll(errors); } + + public class ExtensionLinkResponseInfo { + public ExtensionLinkResponseInfo(String linkId, String stackName, String stackVersion, String extensionName, + String extensionVersion, boolean valid, Collection<String> errorSet) { + + setLinkId(linkId); + setStackName(stackName); + setStackVersion(stackVersion); + setExtensionName(extensionName); + setExtensionVersion(extensionVersion); + setValid(valid); + addErrors(errorSet); + } + + private String linkId; + private String stackName; + private String stackVersion; + private String extensionName; + private String extensionVersion; + + @ApiModelProperty(name = "link_id") + public String getLinkId() { + return linkId; + } + + public void setLinkId(String linkId) { + this.linkId = linkId; + } + + @ApiModelProperty(name = "stack_name") + public String getStackName() { + return stackName; + } + + public void setStackName(String stackName) { + this.stackName = stackName; + } + + @ApiModelProperty(name = "stack_version") + public String getStackVersion() { + return stackVersion; + } + + public void setStackVersion(String stackVersion) { + this.stackVersion = stackVersion; + } + + @ApiModelProperty(name = "extension_name") + public String getExtensionName() { + return extensionName; + } + + public void setExtensionName(String extensionName) { + this.extensionName = extensionName; + } + + @ApiModelProperty(name = "extension_version") + public String getExtensionVersion() { + return extensionVersion; + } + + public void setExtensionVersion(String extensionVersion) { + this.extensionVersion = extensionVersion; + } + + } }
http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/controller/QuickLinksResponse.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/QuickLinksResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/QuickLinksResponse.java new file mode 100644 index 0000000..c5eb4fd --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/QuickLinksResponse.java @@ -0,0 +1,56 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.controller; + +import org.apache.ambari.server.state.quicklinks.QuickLinksConfiguration; + +import io.swagger.annotations.ApiModelProperty; + +/** + * Response schema for endpoint {@link org.apache.ambari.server.api.services.StacksService#getStackServiceQuickLinksConfiguration( + * String, javax.ws.rs.core.HttpHeaders, javax.ws.rs.core.UriInfo, String, String, String, String)} + + * The interface is not actually implemented, it only carries swagger annotations. + */ +public interface QuickLinksResponse extends ApiModel { + + @ApiModelProperty(name = "QuickLinkInfo") + public QuickLinksResponseInfo getQuickLinksResponseInfo(); + + public interface QuickLinksResponseInfo { + @ApiModelProperty(name = "file_name") + String getFileName(); + + @ApiModelProperty(name = "service_name") + String getServiceName(); + + @ApiModelProperty(name = "stack_name") + String getStackName(); + + @ApiModelProperty(name = "stack_version") + String getStackVersion(); + + @ApiModelProperty(name = "default") + boolean isDefault(); + + @ApiModelProperty(name = "quicklink_data") + QuickLinksConfiguration getQuickLinkData(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/controller/StackArtifactResponse.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackArtifactResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackArtifactResponse.java new file mode 100644 index 0000000..279798e --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackArtifactResponse.java @@ -0,0 +1,52 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.controller; + +import java.util.Map; + +import io.swagger.annotations.ApiModelProperty; + +/** + * Response schema for endpoint {@link org.apache.ambari.server.api.services.StacksService#getStackArtifact} + * + * The interface is not actually implemented, it only carries swagger annotations. + */ +public interface StackArtifactResponse extends ApiModel { + + @ApiModelProperty(name = "Artifacts") + Artifacts getArtifacts(); + + @ApiModelProperty(name = "artifact_data") + Map<String, Object> getArtifactData(); + + interface Artifacts { + @ApiModelProperty(name = "artifact_name") + String getArtifactName(); + + @ApiModelProperty(name = "service_name") + String getServiceName(); + + @ApiModelProperty(name = "stack_name") + String getStackName(); + + @ApiModelProperty(name = "stack_version") + String getStackVersion(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationDependencyResponse.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationDependencyResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationDependencyResponse.java index 14aab3b..7bea5e2 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationDependencyResponse.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationDependencyResponse.java @@ -19,6 +19,8 @@ package org.apache.ambari.server.controller; +import io.swagger.annotations.ApiModelProperty; + public class StackConfigurationDependencyResponse { private String stackName; @@ -40,6 +42,7 @@ public class StackConfigurationDependencyResponse { this.dependencyType = dependencyType; } + @ApiModelProperty(name = "stack_name") public String getStackName() { return stackName; } @@ -48,6 +51,7 @@ public class StackConfigurationDependencyResponse { this.stackName = stackName; } + @ApiModelProperty(name = "stack_version") public String getStackVersion() { return stackVersion; } @@ -56,6 +60,7 @@ public class StackConfigurationDependencyResponse { this.stackVersion = stackVersion; } + @ApiModelProperty(name = "service_name") public String getServiceName() { return serviceName; } @@ -64,6 +69,7 @@ public class StackConfigurationDependencyResponse { this.serviceName = serviceName; } + @ApiModelProperty(name = "property_name") public String getPropertyName() { return propertyName; } @@ -72,6 +78,7 @@ public class StackConfigurationDependencyResponse { this.propertyName = propertyName; } + @ApiModelProperty(name = "dependency_name") public String getDependencyName() { return dependencyName; } @@ -80,6 +87,7 @@ public class StackConfigurationDependencyResponse { this.dependencyName = dependencyName; } + @ApiModelProperty(name = "dependency_type") public String getDependencyType() { return dependencyType; } @@ -87,4 +95,13 @@ public class StackConfigurationDependencyResponse { public void setDependencyType(String dependencyType) { this.dependencyType = dependencyType; } + + /** + * Interface to help correct Swagger documentation generation + */ + public interface StackConfigurationDependencyResponseSwagger extends ApiModel { + @ApiModelProperty(name = "StackConfigurationDependency") + public StackConfigurationDependencyResponse getStackConfigurationDependencyResponse(); + } + } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationResponse.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationResponse.java index 0338ed9..7954192 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationResponse.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackConfigurationResponse.java @@ -26,6 +26,9 @@ import org.apache.ambari.server.state.PropertyDependencyInfo; import org.apache.ambari.server.state.PropertyInfo.PropertyType; import org.apache.ambari.server.state.ValueAttributesInfo; +import io.swagger.annotations.ApiModelProperty; + + public class StackConfigurationResponse { /** @@ -90,6 +93,7 @@ public class StackConfigurationResponse { private Boolean isRequired; private Set<PropertyType> propertyTypes; + @ApiModelProperty(name = "stack_name") public String getStackName() { return stackName; } @@ -98,6 +102,7 @@ public class StackConfigurationResponse { this.stackName = stackName; } + @ApiModelProperty(name = "stack_version") public String getStackVersion() { return stackVersion; } @@ -106,6 +111,7 @@ public class StackConfigurationResponse { this.stackVersion = stackVersion; } + @ApiModelProperty(name = "service_name") public String getServiceName() { return serviceName; } @@ -114,6 +120,7 @@ public class StackConfigurationResponse { this.serviceName = serviceName; } + @ApiModelProperty(name = "property_name") public String getPropertyName() { return propertyName; } @@ -122,6 +129,7 @@ public class StackConfigurationResponse { this.propertyName = propertyName; } + @ApiModelProperty(name = "property_value") public String getPropertyValue() { return propertyValue; } @@ -130,6 +138,7 @@ public class StackConfigurationResponse { this.propertyValue = propertyValue; } + @ApiModelProperty(name = "property_description") public String getPropertyDescription() { return propertyDescription; } @@ -138,6 +147,7 @@ public class StackConfigurationResponse { this.propertyDescription = propertyDescription; } + @ApiModelProperty(name = "property_display_name") public String getPropertyDisplayName() { return propertyDisplayName; } @@ -153,7 +163,8 @@ public class StackConfigurationResponse { public String getType() { return type; } - + + @ApiModelProperty(name = "type") public void setType(String type) { this.type = type; } @@ -163,6 +174,7 @@ public class StackConfigurationResponse { * * @return Map of attribute name to attribute value */ + @ApiModelProperty(hidden = true) public Map<String, String> getPropertyAttributes() { return propertyAttributes; } @@ -181,6 +193,7 @@ public class StackConfigurationResponse { * * @return value attributes */ + @ApiModelProperty(name = "property_value_attributes") public ValueAttributesInfo getPropertyValueAttributes() { return propertyValueAttributes; } @@ -199,6 +212,7 @@ public class StackConfigurationResponse { * * @return depends on properties set */ + @ApiModelProperty(name = "dependencies") public Set<PropertyDependencyInfo> getDependsOnProperties() { return dependsOnProperties; } @@ -216,6 +230,7 @@ public class StackConfigurationResponse { * Is property a isRequired property * @return True/False */ + @ApiModelProperty(hidden = true) public Boolean isRequired() { return isRequired; } @@ -232,6 +247,7 @@ public class StackConfigurationResponse { * Get type of property as set in the stack definition. * @return Property type. */ + @ApiModelProperty(name = "property_type") public Set<PropertyType> getPropertyType() { return propertyTypes; } @@ -239,4 +255,12 @@ public class StackConfigurationResponse { public void setPropertyType(Set<PropertyType> propertyTypes) { this.propertyTypes = propertyTypes; } + + /** + * Interface to help correct Swagger documentation generation + */ + public interface StackConfigurationResponseSwagger extends ApiModel { + @ApiModelProperty(name = "StackConfigurations") + public StackConfigurationResponse getStackConfigurationResponse(); + } } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/controller/StackResponse.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackResponse.java index 1901337..56f5904 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackResponse.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackResponse.java @@ -19,6 +19,8 @@ package org.apache.ambari.server.controller; +import io.swagger.annotations.ApiModelProperty; + public class StackResponse { private String stackName; @@ -27,6 +29,7 @@ public class StackResponse { setStackName(stackName); } + @ApiModelProperty(name = "stack_name") public String getStackName() { return stackName; } @@ -54,4 +57,13 @@ public class StackResponse { return getStackName().equals(stackResponse.getStackName()); } + /** + * Interface to help correct Swagger documentation generation + */ + public interface StackResponseSwagger extends ApiModel { + @ApiModelProperty(name = "Stacks") + public StackResponse getStackResponse(); + } + } + http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceArtifactResponse.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceArtifactResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceArtifactResponse.java new file mode 100644 index 0000000..0a531a7 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceArtifactResponse.java @@ -0,0 +1,53 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.controller; + +import java.util.Map; + +import io.swagger.annotations.ApiModelProperty; + +/** + * Response schema for endpoint {@link org.apache.ambari.server.api.services.StacksService#getStackServiceArtifact( + * String, javax.ws.rs.core.HttpHeaders, javax.ws.rs.core.UriInfo, String, String, String, String)} + * + * The interface is not actually implemented, it only carries swagger annotations. + */ +public interface StackServiceArtifactResponse extends ApiModel { + + @ApiModelProperty(name = "Artifacts") + Artifacts getArtifacts(); + + @ApiModelProperty(name = "artifact_data") + Map<String, Object> getArtifactData(); + + interface Artifacts { + @ApiModelProperty(name = "artifact_name") + String getArtifactName(); + + @ApiModelProperty(name = "service_name") + String getServiceName(); + + @ApiModelProperty(name = "stack_name") + String getStackName(); + + @ApiModelProperty(name = "stack_version") + String getStackVersion(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceComponentResponse.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceComponentResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceComponentResponse.java index b48fad3..d1dea0d 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceComponentResponse.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceComponentResponse.java @@ -27,6 +27,8 @@ import org.apache.ambari.server.state.BulkCommandDefinition; import org.apache.ambari.server.state.ComponentInfo; import org.apache.ambari.server.state.CustomCommandDefinition; +import io.swagger.annotations.ApiModelProperty; + /** * Stack service component response. */ @@ -197,6 +199,7 @@ public class StackServiceComponentResponse { * * @return stack name */ + @ApiModelProperty(name = "stack_name") public String getStackName() { return stackName; } @@ -215,6 +218,7 @@ public class StackServiceComponentResponse { * * @return stack version */ + @ApiModelProperty(name = "stack_version") public String getStackVersion() { return stackVersion; } @@ -233,6 +237,7 @@ public class StackServiceComponentResponse { * * @return service name */ + @ApiModelProperty(name = "service_name") public String getServiceName() { return serviceName; } @@ -251,6 +256,7 @@ public class StackServiceComponentResponse { * * @return component name */ + @ApiModelProperty(name = "component_name") public String getComponentName() { return componentName; } @@ -270,6 +276,7 @@ public class StackServiceComponentResponse { * @return component display name */ + @ApiModelProperty(name = "display_name") public String getComponentDisplayName() { return componentDisplayName; } @@ -288,6 +295,7 @@ public class StackServiceComponentResponse { * * @return component category */ + @ApiModelProperty(name = "component_category") public String getComponentCategory() { return componentCategory; } @@ -306,6 +314,7 @@ public class StackServiceComponentResponse { * * @return whether the component is a client component */ + @ApiModelProperty(name = "is_client") public boolean isClient() { return isClient; } @@ -324,6 +333,7 @@ public class StackServiceComponentResponse { * * @return whether the component is a master component */ + @ApiModelProperty(name = "is_master") public boolean isMaster() { return isMaster; } @@ -342,6 +352,7 @@ public class StackServiceComponentResponse { * * @return component cardinality requirement */ + @ApiModelProperty(name = "cardinality") public String getCardinality() { return cardinality; } @@ -361,6 +372,7 @@ public class StackServiceComponentResponse { * * @return Whether the components needs to advertise a version */ + @ApiModelProperty(name = "advertise_version") public boolean isVersionAdvertised() { return versionAdvertised; } @@ -379,6 +391,7 @@ public class StackServiceComponentResponse { * * @return Whether the components can be decommissioned */ + @ApiModelProperty(name = "decommission_allowed") public boolean isDecommissionAlllowed() { if (decommissionAllowed != null && decommissionAllowed.equals("true")) { return true; @@ -401,6 +414,7 @@ public class StackServiceComponentResponse { * * @return Whether the components can be reassigned */ + @ApiModelProperty(name = "reassign_allowed") public boolean isReassignAlllowed() { if (reassignAllowed != null && reassignAllowed.equals("true")) { return true; @@ -423,6 +437,7 @@ public class StackServiceComponentResponse { * * @return True or false. */ + @ApiModelProperty(name = "recovery_enabled") public boolean isRecoveryEnabled() { return recoveryEnabled; } @@ -442,6 +457,7 @@ public class StackServiceComponentResponse { * * @return auto deploy information */ + @ApiModelProperty(hidden = true) public AutoDeployInfo getAutoDeploy() { return autoDeploy; } @@ -460,10 +476,12 @@ public class StackServiceComponentResponse { * * @return the commands or an empty list (never {@code null}). */ + @ApiModelProperty(name = "custom_commands") public List<String> getCustomCommands() { return customCommands; } + @ApiModelProperty(name = "has_bulk_commands_definition") public boolean hasBulkCommands(){ return hasBulkCommands; } @@ -472,7 +490,16 @@ public class StackServiceComponentResponse { return bulkCommandsDisplayName == null ? "":bulkCommandsDisplayName; } + @ApiModelProperty(name = "bulk_commands_master_component_namen") public String getBulkCommandsMasterComponentName(){ return bulkCommandMasterComponentName == null ? "":bulkCommandMasterComponentName; } + + /** + * Interface to help correct Swagger documentation generation + */ + public interface StackServiceComponentResponseSwagger extends ApiModel { + @ApiModelProperty(name = "StackServiceComponents") + public StackServiceComponentResponse getStackServiceComponentResponse(); + } } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java index 8e4200d..c3e10d9 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackServiceResponse.java @@ -28,6 +28,8 @@ import java.util.Set; import org.apache.ambari.server.state.CustomCommandDefinition; import org.apache.ambari.server.state.ServiceInfo; +import io.swagger.annotations.ApiModelProperty; + public class StackServiceResponse { private String stackName; @@ -108,16 +110,13 @@ public class StackServiceResponse { } kerberosDescriptorFile = service.getKerberosDescriptorFile(); - serviceProperties = service.getServiceProperties(); - credentialStoreSupported = service.isCredentialStoreSupported(); - credentialStoreEnabled = service.isCredentialStoreEnabled(); - isSupportDeleteViaUI = service.isSupportDeleteViaUI(); } + @ApiModelProperty(name = "selection") public ServiceInfo.Selection getSelection() { return selection; } @@ -126,6 +125,7 @@ public class StackServiceResponse { this.selection = selection; } + @ApiModelProperty(name = "stack_name") public String getStackName() { return stackName; } @@ -134,6 +134,7 @@ public class StackServiceResponse { this.stackName = stackName; } + @ApiModelProperty(name = "stack_version") public String getStackVersion() { return stackVersion; } @@ -142,6 +143,7 @@ public class StackServiceResponse { this.stackVersion = stackVersion; } + @ApiModelProperty(name = "service_name") public String getServiceName() { return serviceName; } @@ -150,6 +152,7 @@ public class StackServiceResponse { this.serviceName = serviceName; } + @ApiModelProperty(name = "service_type") public String getServiceType() { return serviceType; } @@ -158,6 +161,7 @@ public class StackServiceResponse { this.serviceType = serviceType; } + @ApiModelProperty(name = "display_name") public String getServiceDisplayName() { return serviceDisplayName; } @@ -166,6 +170,7 @@ public class StackServiceResponse { this.serviceDisplayName = serviceDisplayName; } + @ApiModelProperty(name = "user_name") public String getUserName() { return userName; } @@ -174,6 +179,7 @@ public class StackServiceResponse { this.userName = userName; } + @ApiModelProperty(name = "comments") public String getComments() { return comments; } @@ -182,6 +188,7 @@ public class StackServiceResponse { this.comments = comments; } + @ApiModelProperty(name = "service_version") public String getServiceVersion() { return serviceVersion; } @@ -190,14 +197,17 @@ public class StackServiceResponse { this.serviceVersion = serviceVersion; } + @ApiModelProperty(name = "config_types") public Map<String, Map<String, Map<String, String>>> getConfigTypes() { return configTypes; } + @ApiModelProperty(hidden = true) public Set<String> getExcludedConfigTypes() { return excludedConfigTypes; } + @ApiModelProperty(name = "required_services") public List<String> getRequiredServices() { return requiredServices; } @@ -212,6 +222,7 @@ public class StackServiceResponse { * @return a File pointing to the service-level Kerberos descriptor, or null if no relevant file is * available */ + @ApiModelProperty(hidden = true) public File getKerberosDescriptorFile() { return kerberosDescriptorFile; } @@ -235,6 +246,7 @@ public class StackServiceResponse { * {@code false} otherwise. * */ + @ApiModelProperty(name = "service_check_supported") public boolean isServiceCheckSupported() { return serviceCheckSupported; } @@ -244,6 +256,7 @@ public class StackServiceResponse { * * @return the commands or an empty list (never {@code null}). */ + @ApiModelProperty(name = "custom_commands") public List<String> getCustomCommands() { return customCommands; } @@ -252,6 +265,7 @@ public class StackServiceResponse { * Get the service properties of this service. * @return the properties or an empty map (never {@code null}). */ + @ApiModelProperty(name = "properties") public Map<String, String> getServiceProperties() { return serviceProperties; } @@ -261,6 +275,7 @@ public class StackServiceResponse { * * @return true or false. */ + @ApiModelProperty(name = "credential_store_supported") public boolean isCredentialStoreSupported() { return credentialStoreSupported; } @@ -279,6 +294,7 @@ public class StackServiceResponse { * * @return true or false */ + @ApiModelProperty(name = "credential_store_enabled") public boolean isCredentialStoreEnabled() { return credentialStoreEnabled; } @@ -297,6 +313,7 @@ public class StackServiceResponse { * * @return true or false */ + @ApiModelProperty(name = "credential_store_required") public boolean isCredentialStoreRequired() { return credentialStoreRequired; } @@ -310,7 +327,13 @@ public class StackServiceResponse { this.credentialStoreRequired = credentialStoreRequired; } + @ApiModelProperty(hidden = true) public boolean isSupportDeleteViaUI(){ return isSupportDeleteViaUI; } + + public interface StackServiceResponseSwagger extends ApiModel { + @ApiModelProperty(name = "StackServices") + public StackServiceResponse getStackServiceResponse(); + } } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/controller/StackVersionResponse.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackVersionResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackVersionResponse.java index 3c65d05..584944e 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/StackVersionResponse.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/StackVersionResponse.java @@ -27,28 +27,12 @@ import java.util.Set; import org.apache.ambari.server.stack.Validable; +import io.swagger.annotations.ApiModelProperty; public class StackVersionResponse implements Validable{ private String minJdk; private String maxJdk; - - public String getMinJdk() { - return minJdk; - } - - public void setMinJdk(String minJdk) { - this.minJdk = minJdk; - } - - public String getMaxJdk() { - return maxJdk; - } - - public void setMaxJdk(String maxJdk) { - this.maxJdk = maxJdk; - } - private String stackName; private String stackVersion; private String minUpgradeVersion; @@ -93,6 +77,7 @@ public class StackVersionResponse implements Validable{ } @Override + @ApiModelProperty(name = "valid") public boolean isValid() { return valid; } @@ -110,6 +95,7 @@ public class StackVersionResponse implements Validable{ } @Override + @ApiModelProperty(name = "stack-errors") public Collection<String> getErrors() { return errorSet; } @@ -117,8 +103,25 @@ public class StackVersionResponse implements Validable{ @Override public void addErrors(Collection<String> errors) { this.errorSet.addAll(errors); - } - + } + + @ApiModelProperty(name = "min_jdk") + public String getMinJdk() { return minJdk; } + + public void setMinJdk(String minJdk) { + this.minJdk = minJdk; + } + + @ApiModelProperty(name = "max_jdk") + public String getMaxJdk() { + return maxJdk; + } + + public void setMaxJdk(String maxJdk) { + this.maxJdk = maxJdk; + } + + @ApiModelProperty(name = "stack_name") public String getStackName() { return stackName; } @@ -127,6 +130,7 @@ public class StackVersionResponse implements Validable{ this.stackName = stackName; } + @ApiModelProperty(name = "stack_version") public String getStackVersion() { return stackVersion; } @@ -135,6 +139,7 @@ public class StackVersionResponse implements Validable{ this.stackVersion = stackVersion; } + @ApiModelProperty(name = "min_upgrade_version") public String getMinUpgradeVersion() { return minUpgradeVersion; } @@ -143,6 +148,7 @@ public class StackVersionResponse implements Validable{ this.minUpgradeVersion = minUpgradeVersion; } + @ApiModelProperty(name = "active") public boolean isActive() { return active; } @@ -151,6 +157,7 @@ public class StackVersionResponse implements Validable{ this.active = active; } + @ApiModelProperty(name = "parent_stack_version") public String getParentVersion() { return parentVersion; } @@ -158,6 +165,8 @@ public class StackVersionResponse implements Validable{ public void setParentVersion(String parentVersion) { this.parentVersion = parentVersion; } + + @ApiModelProperty(name = "config_types") public Map<String, Map<String, Map<String, String>>> getConfigTypes() { return configTypes; } @@ -172,6 +181,7 @@ public class StackVersionResponse implements Validable{ * @return a File pointing to the stack-level Kerberos descriptor, or null if no relevant file is * available */ + @ApiModelProperty(hidden = true) public File getStackKerberosDescriptorFile() { return stackKerberosDescriptorFile; } @@ -192,6 +202,7 @@ public class StackVersionResponse implements Validable{ * @return a Collection of Files pointing to the stack-specific service-level Kerberos descriptor * files, or null if no relevant files are available */ + @ApiModelProperty(hidden = true) public Collection<File> getServiceKerberosDescriptorFiles() { return serviceKerberosDescriptorFiles; } @@ -216,7 +227,17 @@ public class StackVersionResponse implements Validable{ /** * @return the upgrade pack names for the stack version */ + @ApiModelProperty(name = "upgrade_packs") public Set<String> getUpgradePacks() { return upgradePacks; } + + + /** + * Interface to help correct Swagger documentation generation + */ + public interface StackVersionResponseSwagger extends ApiModel { + @ApiModelProperty(name = "Versions") + public StackVersionResponse getStackVersionResponse(); + } } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/controller/ThemeResponse.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/ThemeResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/ThemeResponse.java new file mode 100644 index 0000000..5822b58 --- /dev/null +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/ThemeResponse.java @@ -0,0 +1,56 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * <p> + * http://www.apache.org/licenses/LICENSE-2.0 + * <p> + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.ambari.server.controller; + + +import org.apache.ambari.server.state.theme.Theme; + +import io.swagger.annotations.ApiModelProperty; + +/** + * Response schema for endpoint {@link org.apache.ambari.server.api.services.StacksService#getStackService(String, + * javax.ws.rs.core.HttpHeaders, javax.ws.rs.core.UriInfo, String, String, String)} + */ +public interface ThemeResponse extends ApiModel { + + @ApiModelProperty(name = "ThemeInfo") + ThemeInfoResponse getThemeInfo(); + + + interface ThemeInfoResponse { + @ApiModelProperty(name = "default") + boolean isDefault(); + + @ApiModelProperty(name = "file_name") + String getFileName(); + + @ApiModelProperty(name = "service_name") + String getServiceName(); + + @ApiModelProperty(name = "stack_name") + String getStackName(); + + @ApiModelProperty(name = "stack_version") + String getStackVersion(); + + @ApiModelProperty(name = "theme_data") + Theme getThemeData(); + } + +} http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/controller/ViewInstanceResponse.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/ViewInstanceResponse.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/ViewInstanceResponse.java index d0a5206..b17d7d5 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/ViewInstanceResponse.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/ViewInstanceResponse.java @@ -1,4 +1,4 @@ -/** + /** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/QuickLinksConfigurationInfo.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/QuickLinksConfigurationInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/QuickLinksConfigurationInfo.java index d4bdce8..dfcb91c 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/QuickLinksConfigurationInfo.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/QuickLinksConfigurationInfo.java @@ -24,13 +24,16 @@ import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlTransient; +import org.apache.ambari.server.controller.ApiModel; import org.apache.ambari.server.state.quicklinks.QuickLinks; +import io.swagger.annotations.ApiModelProperty; + /** * Wrapper for quickLinksConfiguration description */ @XmlAccessorType(XmlAccessType.FIELD) -public class QuickLinksConfigurationInfo { +public class QuickLinksConfigurationInfo implements ApiModel { private String fileName; @XmlElement(name = "default") @@ -61,6 +64,7 @@ public class QuickLinksConfigurationInfo { '}'; } + @ApiModelProperty(name = "file_name") public String getFileName() { return fileName; } @@ -69,6 +73,7 @@ public class QuickLinksConfigurationInfo { this.fileName = fileName; } + @ApiModelProperty(name = "default") public Boolean getIsDefault() { return isDefault; } @@ -77,6 +82,7 @@ public class QuickLinksConfigurationInfo { this.isDefault = isDefault; } + @ApiModelProperty(hidden = true) public Boolean isDeleted() { return deleted; } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java index 353dd86..24c2d94 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/StackInfo.java @@ -41,7 +41,7 @@ import com.google.common.collect.ListMultimap; import com.google.common.collect.Multimaps; import com.google.common.io.Files; -public class StackInfo implements Comparable<StackInfo>, Validable{ +public class StackInfo implements Comparable<StackInfo>, Validable { private String minJdk; private String maxJdk; private String name; http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/ValueAttributesInfo.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ValueAttributesInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ValueAttributesInfo.java index c41cd9a..f5387a0 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/ValueAttributesInfo.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ValueAttributesInfo.java @@ -26,12 +26,29 @@ import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElementWrapper; import javax.xml.bind.annotation.XmlElements; +import org.apache.ambari.server.controller.ApiModel; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; + @XmlAccessorType(XmlAccessType.FIELD) @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) -public class ValueAttributesInfo { +public class ValueAttributesInfo implements ApiModel { + public static final String EMPTY_VALUE_VALID = "empty-value-valid"; + public static final String UI_ONLY_PROPERTY = "ui-only-property"; + public static final String READ_ONLY = "read-only"; + public static final String EDITABLE_ONLY_AT_INSTALL = "editable-only-at-install"; + public static final String SHOW_PROPERTY_NAME = "show-property-name"; + public static final String INCREMENT_STEP = "increment-step"; + public static final String SELECTION_CARDINALITY = "selection_cardinality"; + public static final String PROPERTY_FILE_NAME = "property-file-name"; + public static final String PROPERTY_FILE_TYPE = "property-file-type"; + public static final String ENTRIES = "entries"; + public static final String HIDDEN = "hidden"; + public static final String ENTRIES_EDITABLE = "entries_editable"; + public static final String USER_GROUPS = "user-groups"; + public static final String KEYSTORE = "keystore"; private String type; private String maximum; private String minimum; @@ -41,63 +58,64 @@ public class ValueAttributesInfo { private Boolean overridable; private String copy; - @XmlElement(name = "empty-value-valid") - @JsonProperty("empty_value_valid") + @XmlElement(name = EMPTY_VALUE_VALID) + @JsonProperty(EMPTY_VALUE_VALID) private Boolean emptyValueValid; - @XmlElement(name = "ui-only-property") - @JsonProperty("ui_only_property") + @XmlElement(name = UI_ONLY_PROPERTY) + @JsonProperty(UI_ONLY_PROPERTY) private Boolean uiOnlyProperty; - @XmlElement(name = "read-only") - @JsonProperty("read_only") + @XmlElement(name = READ_ONLY) + @JsonProperty(READ_ONLY) private Boolean readOnly; - @XmlElement(name = "editable-only-at-install") - @JsonProperty("editable_only_at_install") + @XmlElement(name = EDITABLE_ONLY_AT_INSTALL) + @JsonProperty(EDITABLE_ONLY_AT_INSTALL) private Boolean editableOnlyAtInstall; - @XmlElement(name = "show-property-name") - @JsonProperty("show_property_name") + @XmlElement(name = SHOW_PROPERTY_NAME) + @JsonProperty(SHOW_PROPERTY_NAME) private Boolean showPropertyName; - @XmlElement(name = "increment-step") - @JsonProperty("increment_step") + @XmlElement(name = INCREMENT_STEP) + @JsonProperty(INCREMENT_STEP) private String incrementStep; - @XmlElementWrapper(name = "entries") + @XmlElementWrapper(name = ENTRIES) @XmlElements(@XmlElement(name = "entry")) private Collection<ValueEntryInfo> entries; - @XmlElement(name = "hidden") + @XmlElement(name = HIDDEN) private String hidden; - @XmlElement(name = "entries_editable") + @XmlElement(name = ENTRIES_EDITABLE) private Boolean entriesEditable; - @XmlElement(name = "selection-cardinality") - @JsonProperty("selection_cardinality") + @XmlElement(name = SELECTION_CARDINALITY) + @JsonProperty(SELECTION_CARDINALITY) private String selectionCardinality; - @XmlElement(name = "property-file-name") - @JsonProperty("property-file-name") + @XmlElement(name = PROPERTY_FILE_NAME) + @JsonProperty(PROPERTY_FILE_NAME) private String propertyFileName; - @XmlElement(name = "property-file-type") - @JsonProperty("property-file-type") + @XmlElement(name = PROPERTY_FILE_TYPE) + @JsonProperty(PROPERTY_FILE_TYPE) private String propertyFileType; - @XmlElementWrapper(name = "user-groups") + @XmlElementWrapper(name = USER_GROUPS) @XmlElements(@XmlElement(name = "property")) private Collection<UserGroupInfo> userGroupEntries; - @XmlElement(name = "keystore") + @XmlElement(name = KEYSTORE) private boolean keyStore; public ValueAttributesInfo() { } + @ApiModelProperty(name = "type") public String getType() { return type; } @@ -106,6 +124,7 @@ public class ValueAttributesInfo { this.type = type; } + @ApiModelProperty(name = "maximum") public String getMaximum() { return maximum; } @@ -114,6 +133,7 @@ public class ValueAttributesInfo { this.maximum = maximum; } + @ApiModelProperty(name = "minimum") public String getMinimum() { return minimum; } @@ -122,6 +142,7 @@ public class ValueAttributesInfo { this.minimum = minimum; } + @ApiModelProperty(name = "unit") public String getUnit() { return unit; } @@ -130,6 +151,7 @@ public class ValueAttributesInfo { this.unit = unit; } + @ApiModelProperty(name = ENTRIES) public Collection<ValueEntryInfo> getEntries() { return entries; } @@ -138,6 +160,7 @@ public class ValueAttributesInfo { this.entries = entries; } + @ApiModelProperty(name = "user-group-entries") public Collection<UserGroupInfo> getUserGroupEntries() { return userGroupEntries; } @@ -146,6 +169,7 @@ public class ValueAttributesInfo { this.userGroupEntries = userGroupEntries; } + @ApiModelProperty(name = HIDDEN) public String getHidden() { return hidden; } @@ -154,6 +178,7 @@ public class ValueAttributesInfo { this.hidden = hidden; } + @ApiModelProperty(name = ENTRIES_EDITABLE) public Boolean getEntriesEditable() { return entriesEditable; } @@ -162,6 +187,7 @@ public class ValueAttributesInfo { this.entriesEditable = entriesEditable; } + @ApiModelProperty(name = SELECTION_CARDINALITY) public String getSelectionCardinality() { return selectionCardinality; } @@ -170,6 +196,7 @@ public class ValueAttributesInfo { this.selectionCardinality = selectionCardinality; } + @ApiModelProperty(name = PROPERTY_FILE_NAME) public String getPropertyFileName() { return propertyFileName; } @@ -178,6 +205,7 @@ public class ValueAttributesInfo { this.propertyFileName = propertyFileName; } + @ApiModelProperty(name = PROPERTY_FILE_TYPE) public String getPropertyFileType() { return propertyFileType; } @@ -186,6 +214,7 @@ public class ValueAttributesInfo { this.propertyFileType = propertyFileType; } + @ApiModelProperty(name = INCREMENT_STEP) public String getIncrementStep() { return incrementStep; } @@ -194,6 +223,7 @@ public class ValueAttributesInfo { this.incrementStep = incrementStep; } + @ApiModelProperty(name = "delete") public String getDelete() { return delete; } @@ -202,6 +232,7 @@ public class ValueAttributesInfo { this.delete = delete; } + @ApiModelProperty(name = EMPTY_VALUE_VALID) public Boolean getEmptyValueValid() { return emptyValueValid; } @@ -210,6 +241,7 @@ public class ValueAttributesInfo { this.emptyValueValid = isEmptyValueValid; } + @ApiModelProperty(name = "visible") public Boolean getVisible() { return visible; } @@ -218,6 +250,7 @@ public class ValueAttributesInfo { this.visible = isVisible; } + @ApiModelProperty(name = READ_ONLY) public Boolean getReadOnly() { return readOnly; } @@ -226,6 +259,7 @@ public class ValueAttributesInfo { this.readOnly = isReadOnly; } + @ApiModelProperty(name = EDITABLE_ONLY_AT_INSTALL) public Boolean getEditableOnlyAtInstall() { return editableOnlyAtInstall; } @@ -234,6 +268,7 @@ public class ValueAttributesInfo { this.editableOnlyAtInstall = isEditableOnlyAtInstall; } + @ApiModelProperty(name = "overridable") public Boolean getOverridable() { return overridable; } @@ -242,6 +277,7 @@ public class ValueAttributesInfo { this.overridable = isOverridable; } + @ApiModelProperty(name = SHOW_PROPERTY_NAME) public Boolean getShowPropertyName() { return showPropertyName; } @@ -250,6 +286,7 @@ public class ValueAttributesInfo { this.showPropertyName = isPropertyNameVisible; } + @ApiModelProperty(name = UI_ONLY_PROPERTY) public Boolean getUiOnlyProperty() { return uiOnlyProperty; } @@ -258,6 +295,7 @@ public class ValueAttributesInfo { this.uiOnlyProperty = isUiOnlyProperty; } + @ApiModelProperty(name = "copy") public String getCopy() { return copy; } @@ -273,6 +311,7 @@ public class ValueAttributesInfo { * * @return "true", "false" */ + @ApiModelProperty(name = KEYSTORE) public boolean isKeyStore() { return keyStore; } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/ValueEntryInfo.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/ValueEntryInfo.java b/ambari-server/src/main/java/org/apache/ambari/server/state/ValueEntryInfo.java index 7824933..5974529 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/ValueEntryInfo.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/ValueEntryInfo.java @@ -21,16 +21,20 @@ package org.apache.ambari.server.state; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; +import org.apache.ambari.server.controller.ApiModel; import org.codehaus.jackson.map.annotate.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; + @XmlAccessorType(XmlAccessType.FIELD) @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) -public class ValueEntryInfo { +public class ValueEntryInfo implements ApiModel { private String value; private String label; private String description; + @ApiModelProperty(name = "value") public String getValue() { return value; } @@ -39,6 +43,7 @@ public class ValueEntryInfo { this.value = value; } + @ApiModelProperty(name = "label") public String getLabel() { return label; } @@ -47,6 +52,7 @@ public class ValueEntryInfo { this.label = label; } + @ApiModelProperty(name = "description") public String getDescription() { return description; } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ConfigCondition.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ConfigCondition.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ConfigCondition.java index a28d149..b47dfcc 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ConfigCondition.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ConfigCondition.java @@ -20,14 +20,17 @@ package org.apache.ambari.server.state.theme; import java.util.List; +import org.apache.ambari.server.controller.ApiModel; import org.apache.ambari.server.state.ValueAttributesInfo; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; + @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class ConfigCondition { +public class ConfigCondition implements ApiModel { @JsonProperty("configs") private List<String> configs; @JsonProperty("resource") @@ -39,6 +42,7 @@ public class ConfigCondition { @JsonProperty("else") private ConfigConditionResult elseLabel; + @ApiModelProperty( name = "configs") public List<String> getConfigs() { return configs; } @@ -47,6 +51,7 @@ public class ConfigCondition { this.configs = configs; } + @ApiModelProperty( name = "if") public String getIfLabel() { return ifLabel; } @@ -55,6 +60,7 @@ public class ConfigCondition { this.ifLabel = ifLabel; } + @ApiModelProperty( name = "then") public ConfigConditionResult getThen() { return then; } @@ -63,6 +69,7 @@ public class ConfigCondition { this.then = then; } + @ApiModelProperty( name = "else") public ConfigConditionResult getElseLabel() { return elseLabel; } @@ -72,6 +79,7 @@ public class ConfigCondition { } + @ApiModelProperty( name = "resource") public String getResource() { return resource; } @@ -82,10 +90,11 @@ public class ConfigCondition { @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) - public static class ConfigConditionResult { + public static class ConfigConditionResult implements ApiModel { @JsonProperty("property_value_attributes") private ValueAttributesInfo propertyValueAttributes; + @ApiModelProperty( name = "property_value_attributes") public ValueAttributesInfo getPropertyValueAttributes() { return propertyValueAttributes; } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ConfigPlacement.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ConfigPlacement.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ConfigPlacement.java index 3bb8c77..94db995 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ConfigPlacement.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ConfigPlacement.java @@ -25,23 +25,31 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; + @JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public class ConfigPlacement { - @JsonProperty("config") + private static final String PROPERTY_VALUE_ATTRIBUTES = "property_value_attributes"; + private static final String CONFIG = "config"; + private static final String SUBSECTION_NAME = "subsection-name"; + private static final String SUBSECTION_TAB_NAME = "subsection-tab-name"; + private static final String DEPENDS_ON = "depends-on"; + + @JsonProperty(CONFIG) private String config; - @JsonProperty("subsection-name") + @JsonProperty(SUBSECTION_NAME) private String subsectionName; - @JsonProperty("subsection-tab-name") + @JsonProperty(SUBSECTION_TAB_NAME) private String subsectionTabName; - @JsonProperty("property_value_attributes") + @JsonProperty(PROPERTY_VALUE_ATTRIBUTES) private ValueAttributesInfo propertyValueAttributes; - @JsonProperty("depends-on") + @JsonProperty(DEPENDS_ON) private List<ConfigCondition> dependsOn; - + @ApiModelProperty(name = CONFIG) public String getConfig() { return config; } @@ -50,6 +58,7 @@ public class ConfigPlacement { this.config = config; } + @ApiModelProperty(name = SUBSECTION_NAME) public String getSubsectionName() { return subsectionName; } @@ -58,6 +67,7 @@ public class ConfigPlacement { this.subsectionName = subsectionName; } + @ApiModelProperty(name = SUBSECTION_TAB_NAME) public String getSubsectionTabName() { return subsectionTabName; } @@ -66,6 +76,7 @@ public class ConfigPlacement { this.subsectionTabName = subsectionTabName; } + @ApiModelProperty(name = PROPERTY_VALUE_ATTRIBUTES) public ValueAttributesInfo getPropertyValueAttributes() { return propertyValueAttributes; } @@ -74,6 +85,7 @@ public class ConfigPlacement { this.propertyValueAttributes = propertyValueAttributes; } + @ApiModelProperty(name = DEPENDS_ON) public List<ConfigCondition> getDependsOn() { return dependsOn; } @@ -82,6 +94,7 @@ public class ConfigPlacement { this.dependsOn = dependsOn; } + @ApiModelProperty(name = "removed") public boolean isRemoved() { return subsectionName == null; } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Layout.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Layout.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Layout.java index 840dbf0..672b540 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Layout.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Layout.java @@ -28,15 +28,19 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; @JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public class Layout{ + @JsonProperty("name") private String name; + @JsonProperty("tabs") private List<Tab> tabs; + @ApiModelProperty(name = "name") public String getName() { return name; } @@ -45,6 +49,7 @@ public class Layout{ this.name = name; } + @ApiModelProperty(name = "tabs") public List<Tab> getTabs() { return tabs; } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Section.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Section.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Section.java index 43d2170..cfc5396 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Section.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Section.java @@ -24,33 +24,45 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import org.apache.ambari.server.controller.ApiModel; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; @JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class Section { +public class Section implements ApiModel { + @JsonProperty("subsections") private List<Subsection> subsections; + @JsonProperty("display-name") private String displayName; + @JsonProperty("row-index") private String rowIndex; + @JsonProperty("section-rows") private String sectionRows; + @JsonProperty("name") private String name; + @JsonProperty("column-span") private String columnSpan; + @JsonProperty("section-columns") private String sectionColumns; + @JsonProperty("column-index") private String columnIndex; + @JsonProperty("row-span") private String rowSpan; + @ApiModelProperty(name = "subsections") public List<Subsection> getSubsections() { return subsections; } @@ -59,6 +71,7 @@ public class Section { this.subsections = subsections; } + @ApiModelProperty(name = "display-name") public String getDisplayName() { return displayName; } @@ -67,6 +80,7 @@ public class Section { this.displayName = displayName; } + @ApiModelProperty(name = "row-index") public String getRowIndex() { return rowIndex; } @@ -75,6 +89,7 @@ public class Section { this.rowIndex = rowIndex; } + @ApiModelProperty(name = "section-rows") public String getSectionRows() { return sectionRows; } @@ -83,6 +98,7 @@ public class Section { this.sectionRows = sectionRows; } + @ApiModelProperty(name = "name") public String getName() { return name; } @@ -91,6 +107,7 @@ public class Section { this.name = name; } + @ApiModelProperty(name = "column-span") public String getColumnSpan() { return columnSpan; } @@ -103,10 +120,12 @@ public class Section { return sectionColumns; } + @ApiModelProperty(name = "section-columns") public void setSectionColumns(String sectionColumns) { this.sectionColumns = sectionColumns; } + @ApiModelProperty(name = "column-index") public String getColumnIndex() { return columnIndex; } @@ -115,6 +134,7 @@ public class Section { this.columnIndex = columnIndex; } + @ApiModelProperty(name = "row-span") public String getRowSpan() { return rowSpan; } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java index 62fbfc1..eb94f57 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Subsection.java @@ -18,13 +18,13 @@ package org.apache.ambari.server.state.theme; - import java.util.List; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; @JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) @@ -51,6 +51,7 @@ public class Subsection { private List<SubsectionTab> subsectionTabs; + @ApiModelProperty( name = "row-index") public String getRowIndex() { return rowIndex; } @@ -59,6 +60,7 @@ public class Subsection { this.rowIndex = rowIndex; } + @ApiModelProperty( name = "name") public String getName() { return name; } @@ -67,6 +69,7 @@ public class Subsection { this.name = name; } + @ApiModelProperty( name = "column-span") public String getColumnSpan() { return columnSpan; } @@ -75,6 +78,7 @@ public class Subsection { this.columnSpan = columnSpan; } + @ApiModelProperty( name = "row-span") public String getRowSpan() { return rowSpan; } @@ -83,6 +87,7 @@ public class Subsection { this.rowSpan = rowSpan; } + @ApiModelProperty( name = "column-index") public String getColumnIndex() { return columnIndex; } @@ -91,6 +96,7 @@ public class Subsection { this.columnIndex = columnIndex; } + @ApiModelProperty( name = "display-name") public String getDisplayName() { return displayName; } @@ -99,6 +105,7 @@ public class Subsection { this.displayName = displayName; } + @ApiModelProperty( name = "border") public String getBorder() { return border; } @@ -107,6 +114,7 @@ public class Subsection { this.border = border; } + @ApiModelProperty( name = "left-vertical-splitter") public Boolean getLeftVerticalSplitter() { return leftVerticalSplitter; } @@ -115,6 +123,7 @@ public class Subsection { this.leftVerticalSplitter = leftVerticalSplitter; } + @ApiModelProperty( name = "depends-on") public List<ConfigCondition> getDependsOn() { return dependsOn; } @@ -123,6 +132,7 @@ public class Subsection { this.dependsOn = dependsOn; } + @ApiModelProperty( name = "subsection-tab") public List<SubsectionTab> getSubsectionTabs() { return subsectionTabs; } @@ -131,6 +141,7 @@ public class Subsection { this.subsectionTabs = subsectionTabs; } + @ApiModelProperty( name = "removed") public boolean isRemoved() { return rowIndex == null && rowSpan == null && columnIndex == null && columnSpan == null && dependsOn == null && subsectionTabs == null; } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Tab.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Tab.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Tab.java index b949a12..1d1d60c 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Tab.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Tab.java @@ -18,23 +18,27 @@ package org.apache.ambari.server.state.theme; - - +import org.apache.ambari.server.controller.ApiModel; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; @JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class Tab { +public class Tab implements ApiModel { + @JsonProperty("display-name") private String displayName; + @JsonProperty("name") private String name; + @JsonProperty("layout") private TabLayout tabLayout; + @ApiModelProperty(name = "display-name") public String getDisplayName() { return displayName; } @@ -43,6 +47,7 @@ public class Tab { this.displayName = displayName; } + @ApiModelProperty(name = "name") public String getName() { return name; } @@ -51,6 +56,7 @@ public class Tab { this.name = name; } + @ApiModelProperty(name = "layout") public TabLayout getTabLayout() { return tabLayout; } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java index f7d4187..bbf8bb8 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/TabLayout.java @@ -18,7 +18,6 @@ package org.apache.ambari.server.state.theme; - import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -28,17 +27,22 @@ import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; @JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) public class TabLayout { + @JsonProperty("tab-rows") private String tabRows; + @JsonProperty("sections") private List<Section> sections; + @JsonProperty("tab-columns") private String tabColumns; + @ApiModelProperty(name = "tab-rows") public String getTabRows() { return tabRows; } @@ -47,6 +51,7 @@ public class TabLayout { this.tabRows = tabRows; } + @ApiModelProperty(name = "sections") public List<Section> getSections() { return sections; } @@ -55,6 +60,7 @@ public class TabLayout { this.sections = sections; } + @ApiModelProperty(name = "tab-columns") public String getTabColumns() { return tabColumns; } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Theme.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Theme.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Theme.java index 96d2fc0..1217230 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Theme.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Theme.java @@ -18,14 +18,16 @@ package org.apache.ambari.server.state.theme; - +import org.apache.ambari.server.controller.ApiModel; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; + @JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class Theme{ +public class Theme implements ApiModel{ @JsonProperty("description") private String description; @JsonProperty("name") @@ -33,6 +35,7 @@ public class Theme{ @JsonProperty("configuration") private ThemeConfiguration themeConfiguration; + @ApiModelProperty(name = "description") public String getDescription() { return description; } @@ -41,6 +44,7 @@ public class Theme{ this.description = description; } + @ApiModelProperty(name = "name") public String getName() { return name; } @@ -49,6 +53,7 @@ public class Theme{ this.name = name; } + @ApiModelProperty(name ="configuration") public ThemeConfiguration getThemeConfiguration() { return themeConfiguration; } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ThemeConfiguration.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ThemeConfiguration.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ThemeConfiguration.java index 58fe942..f264b0a 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ThemeConfiguration.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/ThemeConfiguration.java @@ -18,27 +18,31 @@ package org.apache.ambari.server.state.theme; - import java.util.ArrayList; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; +import org.apache.ambari.server.controller.ApiModel; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; @JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class ThemeConfiguration{ +public class ThemeConfiguration implements ApiModel { @JsonProperty("placement") private Placement placement; + @JsonProperty("widgets") private List<WidgetEntry> widgets; + @JsonProperty("layouts") private List<Layout> layouts; + @ApiModelProperty(name = "placement") public Placement getPlacement() { return placement; } @@ -47,6 +51,7 @@ public class ThemeConfiguration{ this.placement = placement; } + @ApiModelProperty(name = "widgets") public List<WidgetEntry> getWidgets() { return widgets; } @@ -55,6 +60,7 @@ public class ThemeConfiguration{ this.widgets = widgets; } + @ApiModelProperty(name = "layouts") public List<Layout> getLayouts() { return layouts; } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Unit.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Unit.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Unit.java index 7bd058c..953939c 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Unit.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Unit.java @@ -18,18 +18,21 @@ package org.apache.ambari.server.state.theme; - +import org.apache.ambari.server.controller.ApiModel; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; @JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class Unit { +public class Unit implements ApiModel { + @JsonProperty("unit-name") private String unitName; + @ApiModelProperty(name = "unit-name") public String getUnitName() { return unitName; } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Widget.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Widget.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Widget.java index 1f38d8e..73bd138 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Widget.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/Widget.java @@ -18,27 +18,32 @@ package org.apache.ambari.server.state.theme; - import java.util.List; import java.util.Map; +import org.apache.ambari.server.controller.ApiModel; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; @JsonSerialize(include=JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class Widget{ +public class Widget implements ApiModel { @JsonProperty("type") private String type; + @JsonProperty("units") private List<Unit> units; + @JsonProperty("required-properties") private Map<String,String> requiredProperties; + @JsonProperty("display-name") private String displayName; + @ApiModelProperty(name = "type") public String getType() { return type; } @@ -47,6 +52,7 @@ public class Widget{ this.type = type; } + @ApiModelProperty(name = "units") public List<Unit> getUnits() { return units; } @@ -55,6 +61,7 @@ public class Widget{ this.units = units; } + @ApiModelProperty(name = "required-properties") public Map<String, String> getRequiredProperties() { return requiredProperties; } @@ -63,6 +70,7 @@ public class Widget{ this.requiredProperties = requiredProperties; } + @ApiModelProperty(name = "display-name") public String getDisplayName() { return displayName; } http://git-wip-us.apache.org/repos/asf/ambari/blob/54983ee3/ambari-server/src/main/java/org/apache/ambari/server/state/theme/WidgetEntry.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/WidgetEntry.java b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/WidgetEntry.java index 9e9c068..6aac03f 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/theme/WidgetEntry.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/state/theme/WidgetEntry.java @@ -18,21 +18,23 @@ package org.apache.ambari.server.state.theme; - - +import org.apache.ambari.server.controller.ApiModel; import org.codehaus.jackson.annotate.JsonIgnoreProperties; import org.codehaus.jackson.annotate.JsonProperty; import org.codehaus.jackson.map.annotate.JsonSerialize; +import io.swagger.annotations.ApiModelProperty; @JsonSerialize(include= JsonSerialize.Inclusion.NON_NULL) @JsonIgnoreProperties(ignoreUnknown = true) -public class WidgetEntry { +public class WidgetEntry implements ApiModel { @JsonProperty("config") private String config; + @JsonProperty("widget") private Widget widget; + @ApiModelProperty(name = "config") public String getConfig() { return config; } @@ -41,6 +43,7 @@ public class WidgetEntry { this.config = config; } + @ApiModelProperty(name = "widget") public Widget getWidget() { return widget; }