Remove swagger and minor feature extensions and bug fixes
- Various Bug fixes and improvements - Management API extended - Swagger removed - Guava Upgraded to 19
This commit is contained in:
4
hawkbit-rest-api/pom.xml
Executable file → Normal file
4
hawkbit-rest-api/pom.xml
Executable file → Normal file
@@ -34,9 +34,5 @@
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.swagger</groupId>
|
||||
<artifactId>swagger-annotations</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</project>
|
||||
@@ -0,0 +1,182 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource;
|
||||
|
||||
/**
|
||||
* Constants for RESTful API.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class RestConstants {
|
||||
|
||||
/**
|
||||
* API version definition. We are using only major versions.
|
||||
*/
|
||||
public static final String API_VERSION = "v1";
|
||||
|
||||
/**
|
||||
* The base URL mapping for the spring acuator management context path.
|
||||
*/
|
||||
public static final String BASE_SYSTEM_MAPPING = "/system";
|
||||
|
||||
/**
|
||||
* URL mapping for system admin operations.
|
||||
*/
|
||||
public static final String SYSTEM_ADMIN_MAPPING = BASE_SYSTEM_MAPPING + "/admin";
|
||||
|
||||
/**
|
||||
* The base URL mapping of the SP rest resources.
|
||||
*/
|
||||
public static final String BASE_V1_REQUEST_MAPPING = "/rest/v1";
|
||||
|
||||
/**
|
||||
* The default limit parameter in case the limit parameter is not present in
|
||||
* the request.
|
||||
*
|
||||
* @see #REQUEST_PARAMETER_PAGING_LIMIT
|
||||
*/
|
||||
public static final int REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE = 50;
|
||||
|
||||
/**
|
||||
* String representation of
|
||||
* {@link #REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT_VALUE}.
|
||||
*/
|
||||
public static final String REQUEST_PARAMETER_PAGING_DEFAULT_LIMIT = "50";
|
||||
|
||||
/**
|
||||
* The default offset parameter in case the offset parameter is not present
|
||||
* in the request.
|
||||
*
|
||||
* @see #REQUEST_PARAMETER_PAGING_OFFSET
|
||||
*/
|
||||
public static final String REQUEST_PARAMETER_PAGING_DEFAULT_OFFSET = "0";
|
||||
|
||||
/**
|
||||
* Limit http parameter for the limitation of returned values for a paged
|
||||
* request.
|
||||
*/
|
||||
public static final String REQUEST_PARAMETER_PAGING_LIMIT = "limit";
|
||||
/**
|
||||
* The maximum limit of entities returned by rest resources.
|
||||
*/
|
||||
public static final int REQUEST_PARAMETER_PAGING_MAX_LIMIT = 500;
|
||||
|
||||
/**
|
||||
* Paging http parameter for the offset for a paged request.
|
||||
*/
|
||||
public static final String REQUEST_PARAMETER_PAGING_OFFSET = "offset";
|
||||
|
||||
/**
|
||||
* The request parameter for sorting. The value of the sort parameter must
|
||||
* be in the following pattern. Example:
|
||||
* http://www.bosch.com/iap/sp/rest/targets?sort=field_1:ASC,field_2:DESC,
|
||||
* field_3:ASC
|
||||
*/
|
||||
public static final String REQUEST_PARAMETER_SORTING = "sort";
|
||||
|
||||
/**
|
||||
* The request parameter for searching. The value of the search parameter
|
||||
* must be in the FIQL syntax.
|
||||
*/
|
||||
public static final String REQUEST_PARAMETER_SEARCH = "q";
|
||||
|
||||
/**
|
||||
* The target URL mapping, href link for assigned distribution set.
|
||||
*/
|
||||
public static final String TARGET_V1_ASSIGNED_DISTRIBUTION_SET = "assignedDS";
|
||||
/**
|
||||
* The target URL mapping, href link for installed distribution set.
|
||||
*/
|
||||
public static final String TARGET_V1_INSTALLED_DISTRIBUTION_SET = "installedDS";
|
||||
/**
|
||||
* The target URL mapping, href link for target attributes.
|
||||
*/
|
||||
public static final String TARGET_V1_ATTRIBUTES = "attributes";
|
||||
/**
|
||||
* The target URL mapping, href link for target actions.
|
||||
*/
|
||||
public static final String TARGET_V1_ACTIONS = "actions";
|
||||
/**
|
||||
* The target URL mapping, href link for canceled actions.
|
||||
*/
|
||||
public static final String TARGET_V1_CANCELED_ACTION = "canceledaction";
|
||||
/**
|
||||
* The target URL mapping, href link for canceled actions.
|
||||
*/
|
||||
public static final String TARGET_V1_ACTION_STATUS = "status";
|
||||
|
||||
/**
|
||||
* The target URL mapping rest resource.
|
||||
*/
|
||||
public static final String TARGET_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targets";
|
||||
/**
|
||||
* The software module URL mapping rest resource.
|
||||
*/
|
||||
public static final String SOFTWAREMODULE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/softwaremodules";
|
||||
|
||||
/**
|
||||
* The tag URL mapping rest resource.
|
||||
*/
|
||||
public static final String TARGET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/targettags";
|
||||
/**
|
||||
* The tag URL mapping rest resource.
|
||||
*/
|
||||
public static final String TARGET_TAG_TAGERTS_REQUEST_MAPPING = "/{targetTagId}/targets";
|
||||
|
||||
/**
|
||||
* The tag URL mapping rest resource.
|
||||
*/
|
||||
public static final String DISTRIBUTIONSET_TAG_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING
|
||||
+ "/distributionsettags";
|
||||
|
||||
/**
|
||||
* The tag URL mapping rest resource.
|
||||
*/
|
||||
public static final String DISTRIBUTIONSET_REQUEST_MAPPING = "/{distributionsetTagId}/distributionsets";
|
||||
|
||||
/**
|
||||
* The software module type URL mapping rest resource.
|
||||
*/
|
||||
public static final String SOFTWAREMODULETYPE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/softwaremoduletypes";
|
||||
|
||||
public static final String DISTRIBUTIONSETTYPE_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING
|
||||
+ "/distributionsettypes";
|
||||
|
||||
/**
|
||||
* The software module URL mapping rest resource.
|
||||
*/
|
||||
public static final String DISTRIBUTIONSET_V1_REQUEST_MAPPING = BASE_V1_REQUEST_MAPPING + "/distributionsets";
|
||||
|
||||
/**
|
||||
* The target URL mapping, href link for artifact download.
|
||||
*/
|
||||
public static final String SOFTWAREMODULE_V1_ARTIFACT = "artifacts";
|
||||
|
||||
/**
|
||||
* The target URL mapping, href link for type information.
|
||||
*/
|
||||
public static final String SOFTWAREMODULE_V1_TYPE = "type";
|
||||
|
||||
public static final String DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULES = "optionalmodules";
|
||||
|
||||
public static final String DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULES = "mandatorymodules";
|
||||
|
||||
public static final String DISTRIBUTIONSETTYPE_V1_OPTIONAL_MODULE_TYPES = "optionalmoduletypes";
|
||||
|
||||
public static final String DISTRIBUTIONSETTYPE_V1_MANDATORY_MODULE_TYPES = "mandatorymoduletypes";
|
||||
|
||||
public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING_BASE = "/api/" + API_VERSION + "/downloadserver/";
|
||||
public static final String DOWNLOAD_ID_V1_REQUEST_MAPPING = "downloadId/{downloadId}";
|
||||
|
||||
// constant class, private constructor.
|
||||
private RestConstants() {
|
||||
|
||||
}
|
||||
}
|
||||
10
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/BaseEntityRest.java
Executable file → Normal file
10
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/BaseEntityRest.java
Executable file → Normal file
@@ -8,36 +8,26 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
import org.springframework.hateoas.ResourceSupport;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A json annotated rest model for BaseEntity to RESTful API representation.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public abstract class BaseEntityRest extends ResourceSupport {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.CREATED_BY)
|
||||
@JsonProperty
|
||||
private String createdBy;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.CREATED_AT)
|
||||
@JsonProperty
|
||||
private Long createdAt;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.LAST_MODIFIED_BY)
|
||||
@JsonProperty
|
||||
private String lastModifiedBy;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.LAST_MODIFIED_AT)
|
||||
@JsonProperty
|
||||
private Long lastModifiedAt;
|
||||
|
||||
|
||||
10
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/ExceptionInfo.java
Executable file → Normal file
10
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/ExceptionInfo.java
Executable file → Normal file
@@ -13,27 +13,17 @@ import java.util.List;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A exception model rest representation with JSON annotations for response
|
||||
* bodies in case of RESTful exception occurrence.
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_EMPTY)
|
||||
@ApiModel(value = "ExceptionInfo")
|
||||
public class ExceptionInfo {
|
||||
|
||||
@ApiModelProperty(required = true, value = "The exception class name")
|
||||
private String exceptionClass;
|
||||
@ApiModelProperty(required = true, value = "The exception error code")
|
||||
private String errorCode;
|
||||
@ApiModelProperty(required = false, value = "The exception human readable message")
|
||||
private String message;
|
||||
@ApiModelProperty(required = false, value = "The exception message parameters")
|
||||
private List<String> parameters;
|
||||
|
||||
/**
|
||||
|
||||
8
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/IdRest.java
Executable file → Normal file
8
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/IdRest.java
Executable file → Normal file
@@ -8,26 +8,18 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A generic abstract rest model which contains only a ID for use-case e.g.
|
||||
* which allows only posting or putting an ID into the request body, e.g. for
|
||||
* assignments.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class IdRest {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ITEM_ID)
|
||||
@JsonProperty
|
||||
private Long id;
|
||||
|
||||
|
||||
11
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/MetadataRest.java
Executable file → Normal file
11
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/MetadataRest.java
Executable file → Normal file
@@ -8,32 +8,21 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* The representation of an meta data in the REST API.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ApiModel(ApiModelProperties.META_DATA)
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class MetadataRest {
|
||||
|
||||
@ApiModelProperty(required = true, value = "The key of the meta data")
|
||||
@JsonProperty(required = true)
|
||||
private String key;
|
||||
@ApiModelProperty(required = false, value = "The value of the meta data")
|
||||
@JsonProperty
|
||||
private String value;
|
||||
|
||||
|
||||
6
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/MetadataRestPageList.java
Executable file → Normal file
6
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/MetadataRestPageList.java
Executable file → Normal file
@@ -10,18 +10,12 @@ package org.eclipse.hawkbit.rest.resource.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* The rest model for a paged meta data list.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class MetadataRestPageList extends PagedList<MetadataRest> {
|
||||
|
||||
@ApiModelProperty(value = "a list of meta data", required = true)
|
||||
private final List<MetadataRest> content;
|
||||
|
||||
/**
|
||||
|
||||
9
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/NamedEntityRest.java
Executable file → Normal file
9
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/NamedEntityRest.java
Executable file → Normal file
@@ -8,26 +8,17 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A json annotated rest model for NamedEntity to RESTful API representation.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public abstract class NamedEntityRest extends BaseEntityRest {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.NAME, required = true)
|
||||
@JsonProperty(required = true)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DESCRPTION)
|
||||
@JsonProperty
|
||||
private String description;
|
||||
|
||||
|
||||
8
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/PagedList.java
Executable file → Normal file
8
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/PagedList.java
Executable file → Normal file
@@ -12,15 +12,12 @@ import java.util.List;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
import org.springframework.hateoas.ResourceSupport;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A list representation with meta data for pagination, e.g. containing the
|
||||
* total elements. The content of the acutal list is stored in the
|
||||
@@ -36,16 +33,13 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
public class PagedList<T> extends ResourceSupport {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.TOTAL_ELEMENTS, required = false)
|
||||
private final long totalElements;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.SIZE, required = true)
|
||||
private final int size;
|
||||
|
||||
/**
|
||||
* creates a new paged list with the given {@code content} and {@code total}
|
||||
* .
|
||||
*
|
||||
*
|
||||
* @param content
|
||||
* the actual content of the list
|
||||
* @param total
|
||||
|
||||
11
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/PollStatusRest.java
Executable file → Normal file
11
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/PollStatusRest.java
Executable file → Normal file
@@ -8,37 +8,28 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A json annotated rest model for PollStatus to RESTful API representation.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("Target Poll Status")
|
||||
public class PollStatusRest {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.POLL_LAST_REQUEST_AT)
|
||||
@JsonProperty
|
||||
private Long lastRequestAt;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.POLL_NEXT_EXPECTED_REQUEST_AT)
|
||||
@JsonProperty
|
||||
private Long nextExpectedRequestAt;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.POLL_OVERDUE)
|
||||
@JsonProperty
|
||||
private boolean overdue;
|
||||
|
||||
|
||||
9
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionPagedList.java
Executable file → Normal file
9
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionPagedList.java
Executable file → Normal file
@@ -12,22 +12,13 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.PagedList;
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Paged list rest model for {@link Action} to RESTful API representation.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ApiModel("Paged list of actions")
|
||||
public class ActionPagedList extends PagedList<ActionRest> {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ACTION_LIST)
|
||||
private final List<ActionRest> content;
|
||||
|
||||
/**
|
||||
|
||||
9
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionRest.java
Executable file → Normal file
9
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionRest.java
Executable file → Normal file
@@ -9,16 +9,12 @@
|
||||
package org.eclipse.hawkbit.rest.resource.model.action;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.BaseEntityRest;
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A json annotated rest model for Action to RESTful API representation.
|
||||
*
|
||||
@@ -28,7 +24,6 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("SP Action")
|
||||
public class ActionRest extends BaseEntityRest {
|
||||
|
||||
/**
|
||||
@@ -45,16 +40,12 @@ public class ActionRest extends BaseEntityRest {
|
||||
|
||||
public static final String ACTION_PENDING = "pending";
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ITEM_ID)
|
||||
@JsonProperty("id")
|
||||
private Long actionId;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ACTION_TYPE, allowableValues = ACTION_UPDATE + "," + ACTION_CANCEL)
|
||||
@JsonProperty
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ACTION_EXECUTION_STATUS, allowableValues = ACTION_FINISHED + ","
|
||||
+ ACTION_PENDING)
|
||||
@JsonProperty
|
||||
private String status;
|
||||
|
||||
|
||||
6
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionStatusPagedList.java
Executable file → Normal file
6
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionStatusPagedList.java
Executable file → Normal file
@@ -12,13 +12,9 @@ import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.PagedList;
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Paged list rest model for ActionStatus to RESTful API representation.
|
||||
*
|
||||
@@ -27,10 +23,8 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
*
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("Paged list of action status")
|
||||
public class ActionStatusPagedList extends PagedList<ActionStatusRest> {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ACTION_STATUS_LIST)
|
||||
private final List<ActionStatusRest> content;
|
||||
|
||||
/**
|
||||
|
||||
16
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionStatusRest.java
Executable file → Normal file
16
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionStatusRest.java
Executable file → Normal file
@@ -10,16 +10,11 @@ package org.eclipse.hawkbit.rest.resource.model.action;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A json annotated rest model for ActionStatus to RESTful API representation.
|
||||
*
|
||||
@@ -29,7 +24,6 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("SP Action Status")
|
||||
public class ActionStatusRest {
|
||||
|
||||
/**
|
||||
@@ -61,20 +55,20 @@ public class ActionStatusRest {
|
||||
*/
|
||||
public static final String AS_RETRIEVED = "retrieved";
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ITEM_ID)
|
||||
/**
|
||||
* Action has been canceled for this target.
|
||||
*/
|
||||
public static final String AS_CANCELING = "canceling";
|
||||
|
||||
@JsonProperty("id")
|
||||
private Long statusId;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ACTION_STATUS_TYPE, required = true, allowableValues = AS_FINISHED
|
||||
+ "," + AS_ERROR + "," + AS_WARNING + "," + AS_RUNNING + "," + AS_CANCELED + "," + AS_RETRIEVED)
|
||||
@JsonProperty
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ACTION_STATUS_MESSAGES)
|
||||
@JsonProperty
|
||||
private List<String> messages;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ACTION_STATUS_REPORTED_AT)
|
||||
@JsonProperty
|
||||
private Long reportedAt;
|
||||
|
||||
|
||||
0
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionStatussRest.java
Executable file → Normal file
0
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionStatussRest.java
Executable file → Normal file
0
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionsRest.java
Executable file → Normal file
0
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/action/ActionsRest.java
Executable file → Normal file
10
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/artifact/ArtifactHash.java
Executable file → Normal file
10
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/artifact/ArtifactHash.java
Executable file → Normal file
@@ -8,28 +8,18 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.artifact;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Hashes for given Artifact.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ApiModel(ApiModelProperties.ARTIFACT_HASHES)
|
||||
public class ArtifactHash {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ARTIFACT_HASHES_SHA1)
|
||||
@JsonProperty
|
||||
private String sha1;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ARTIFACT_HASHES_MD5)
|
||||
@JsonProperty
|
||||
private String md5;
|
||||
|
||||
|
||||
13
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/artifact/ArtifactRest.java
Executable file → Normal file
13
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/artifact/ArtifactRest.java
Executable file → Normal file
@@ -9,7 +9,6 @@
|
||||
package org.eclipse.hawkbit.rest.resource.model.artifact;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.BaseEntityRest;
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
@@ -18,36 +17,24 @@ import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonValue;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A json annotated rest model for Artifact to RESTful API representation.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("Software Artifact")
|
||||
public class ArtifactRest extends BaseEntityRest {
|
||||
@JsonProperty(required = true)
|
||||
private ArtifactType type;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ITEM_ID, required = true)
|
||||
@JsonProperty("id")
|
||||
private Long artifactId;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ARTIFACT_HASHES)
|
||||
@JsonProperty
|
||||
private ArtifactHash hashes;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ARTIFACT_PROVIDED_FILENAME)
|
||||
@JsonProperty
|
||||
private String providedFilename;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ARTIFACT_SIZE)
|
||||
@JsonProperty
|
||||
private Long size;
|
||||
|
||||
|
||||
6
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/artifact/ArtifactsRest.java
Executable file → Normal file
6
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/artifact/ArtifactsRest.java
Executable file → Normal file
@@ -16,16 +16,10 @@ import java.util.ListIterator;
|
||||
|
||||
import org.springframework.hateoas.ResourceSupport;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
/**
|
||||
* List representation of the {@link ArtifactRest}.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ApiModel
|
||||
public class ArtifactsRest extends ResourceSupport implements List<ArtifactRest> {
|
||||
|
||||
private final List<ArtifactRest> delegate = new ArrayList<>();
|
||||
|
||||
0
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/ActionTypeRest.java
Executable file → Normal file
0
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/ActionTypeRest.java
Executable file → Normal file
9
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetPagedList.java
Executable file → Normal file
9
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetPagedList.java
Executable file → Normal file
@@ -11,22 +11,13 @@ package org.eclipse.hawkbit.rest.resource.model.distributionset;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.PagedList;
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Paged list for SoftwareModule.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ApiModel("Paged list of distribution sets")
|
||||
public class DistributionSetPagedList extends PagedList<DistributionSetRest> {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.SM_LIST, required = true)
|
||||
private final List<DistributionSetRest> content;
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,7 +10,6 @@ package org.eclipse.hawkbit.rest.resource.model.distributionset;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleAssigmentRest;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
@@ -18,45 +17,32 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A json annotated rest model for DistributionSet for POST.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("Distribution set")
|
||||
public class DistributionSetRequestBodyCreate extends DistributionSetRequestBodyUpdate {
|
||||
public class DistributionSetRequestBodyPost extends DistributionSetRequestBodyPut {
|
||||
|
||||
// deprecated format from the time where os, application and runtime where
|
||||
// statically defined
|
||||
@ApiModelProperty(hidden = true)
|
||||
@JsonProperty
|
||||
private SoftwareModuleAssigmentRest os;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@JsonProperty
|
||||
private SoftwareModuleAssigmentRest runtime;
|
||||
|
||||
@ApiModelProperty(hidden = true)
|
||||
@JsonProperty
|
||||
private SoftwareModuleAssigmentRest application;
|
||||
// deprecated format - END
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DS_MODULES)
|
||||
@JsonProperty
|
||||
private List<SoftwareModuleAssigmentRest> modules;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DS_REQUIRED_STEP)
|
||||
@JsonProperty
|
||||
private boolean requiredMigrationStep;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DS_TYPE)
|
||||
@JsonProperty
|
||||
private String type;
|
||||
|
||||
@@ -70,9 +56,12 @@ public class DistributionSetRequestBodyCreate extends DistributionSetRequestBody
|
||||
/**
|
||||
* @param os
|
||||
* the os to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setOs(final SoftwareModuleAssigmentRest os) {
|
||||
public DistributionSetRequestBodyPost setOs(final SoftwareModuleAssigmentRest os) {
|
||||
this.os = os;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -85,9 +74,13 @@ public class DistributionSetRequestBodyCreate extends DistributionSetRequestBody
|
||||
/**
|
||||
* @param runtime
|
||||
* the runtime to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setRuntime(final SoftwareModuleAssigmentRest runtime) {
|
||||
public DistributionSetRequestBodyPost setRuntime(final SoftwareModuleAssigmentRest runtime) {
|
||||
this.runtime = runtime;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,9 +93,13 @@ public class DistributionSetRequestBodyCreate extends DistributionSetRequestBody
|
||||
/**
|
||||
* @param application
|
||||
* the application to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setApplication(final SoftwareModuleAssigmentRest application) {
|
||||
public DistributionSetRequestBodyPost setApplication(final SoftwareModuleAssigmentRest application) {
|
||||
this.application = application;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -115,9 +112,13 @@ public class DistributionSetRequestBodyCreate extends DistributionSetRequestBody
|
||||
/**
|
||||
* @param requiredMigrationStep
|
||||
* the requiredMigrationStep to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setRequiredMigrationStep(final boolean requiredMigrationStep) {
|
||||
public DistributionSetRequestBodyPost setRequiredMigrationStep(final boolean requiredMigrationStep) {
|
||||
this.requiredMigrationStep = requiredMigrationStep;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -130,9 +131,13 @@ public class DistributionSetRequestBodyCreate extends DistributionSetRequestBody
|
||||
/**
|
||||
* @param modules
|
||||
* the modules to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setModules(final List<SoftwareModuleAssigmentRest> modules) {
|
||||
public DistributionSetRequestBodyPost setModules(final List<SoftwareModuleAssigmentRest> modules) {
|
||||
this.modules = modules;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -145,9 +150,13 @@ public class DistributionSetRequestBodyCreate extends DistributionSetRequestBody
|
||||
/**
|
||||
* @param type
|
||||
* the type to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setType(final String type) {
|
||||
public DistributionSetRequestBodyPost setType(final String type) {
|
||||
this.type = type;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,37 +8,25 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.distributionset;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A json annotated rest model for DistributionSet for PUT/POST.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("Distribution set")
|
||||
public class DistributionSetRequestBodyUpdate {
|
||||
public class DistributionSetRequestBodyPut {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.NAME, required = true)
|
||||
@JsonProperty(required = true)
|
||||
@JsonProperty
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DESCRPTION)
|
||||
@JsonProperty
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.VERSION)
|
||||
@JsonProperty
|
||||
private String version;
|
||||
|
||||
@@ -52,9 +40,12 @@ public class DistributionSetRequestBodyUpdate {
|
||||
/**
|
||||
* @param name
|
||||
* the name to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setName(final String name) {
|
||||
public DistributionSetRequestBodyPut setName(final String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -67,9 +58,13 @@ public class DistributionSetRequestBodyUpdate {
|
||||
/**
|
||||
* @param description
|
||||
* the description to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setDescription(final String description) {
|
||||
public DistributionSetRequestBodyPut setDescription(final String description) {
|
||||
this.description = description;
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -82,8 +77,12 @@ public class DistributionSetRequestBodyUpdate {
|
||||
/**
|
||||
* @param version
|
||||
* the version to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setVersion(final String version) {
|
||||
public DistributionSetRequestBodyPut setVersion(final String version) {
|
||||
this.version = version;
|
||||
|
||||
return this;
|
||||
}
|
||||
}
|
||||
13
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetRest.java
Executable file → Normal file
13
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetRest.java
Executable file → Normal file
@@ -12,7 +12,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
import org.eclipse.hawkbit.rest.resource.model.softwaremodule.SoftwareModuleRest;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
@@ -21,9 +20,6 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A json annotated rest model for DistributionSet to RESTful API
|
||||
* representation.
|
||||
@@ -34,30 +30,23 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("Distribution set")
|
||||
public class DistributionSetRest extends NamedEntityRest {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ITEM_ID)
|
||||
@JsonProperty(value = "id", required = true)
|
||||
private Long dsId;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.VERSION)
|
||||
@JsonProperty
|
||||
private String version;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DS_MODULES)
|
||||
@JsonProperty
|
||||
private List<SoftwareModuleRest> modules = new ArrayList<SoftwareModuleRest>();
|
||||
private List<SoftwareModuleRest> modules = new ArrayList<>();
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DS_REQUIRED_STEP)
|
||||
@JsonProperty
|
||||
private boolean requiredMigrationStep;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DS_TYPE)
|
||||
@JsonProperty
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DS_COMPLETE)
|
||||
@JsonProperty
|
||||
private Boolean complete;
|
||||
|
||||
|
||||
0
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetsRest.java
Executable file → Normal file
0
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/DistributionSetsRest.java
Executable file → Normal file
12
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/TargetAssignmentRequestBody.java
Executable file → Normal file
12
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/TargetAssignmentRequestBody.java
Executable file → Normal file
@@ -8,33 +8,21 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.distributionset;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Request Body of Target for assignment operations (ID only).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ApiModel("Target ID")
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class TargetAssignmentRequestBody {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ITEM_ID)
|
||||
@JsonProperty
|
||||
private String id;
|
||||
|
||||
@ApiModelProperty(value = "The force time in case type is 'timeforced'", required = false)
|
||||
private long forcetime;
|
||||
|
||||
@ApiModelProperty(value = "The type of action to assign, default 'forced'", required = false, allowableValues = "soft,forced,timeforced")
|
||||
private ActionTypeRest type;
|
||||
|
||||
/**
|
||||
|
||||
9
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/TargetAssignmentResponseBody.java
Executable file → Normal file
9
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionset/TargetAssignmentResponseBody.java
Executable file → Normal file
@@ -12,25 +12,18 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Response Body of Target for assignment operations.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("Target Assignment Response")
|
||||
public class TargetAssignmentResponseBody {
|
||||
|
||||
@ApiModelProperty(value = "The number of targets have been assigned")
|
||||
private int assigned;
|
||||
@ApiModelProperty(value = "The number of targets which already have been the assignment")
|
||||
private int alreadyAssigned;
|
||||
@ApiModelProperty(value = "The total number of targets")
|
||||
private int total;
|
||||
|
||||
/**
|
||||
|
||||
8
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypePagedList.java
Executable file → Normal file
8
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypePagedList.java
Executable file → Normal file
@@ -11,22 +11,14 @@ package org.eclipse.hawkbit.rest.resource.model.distributionsettype;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.PagedList;
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Paged list for DistributionSetType.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ApiModel("Paged list of distribution set types")
|
||||
public class DistributionSetTypePagedList extends PagedList<DistributionSetTypeRest> {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DS_TYPE_LIST, required = true)
|
||||
private final List<DistributionSetTypeRest> content;
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,39 +10,28 @@ package org.eclipse.hawkbit.rest.resource.model.distributionsettype;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
import org.eclipse.hawkbit.rest.resource.model.softwaremoduletype.SoftwareModuleTypeAssigmentRest;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Request Body for DistributionSetType POST.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class DistributionSetTypeRequestBodyCreate {
|
||||
public class DistributionSetTypeRequestBodyPost {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.NAME, required = true)
|
||||
@JsonProperty(required = true)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DESCRPTION)
|
||||
@JsonProperty
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DS_TYPE_KEY)
|
||||
@JsonProperty
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DS_TYPE_MANDATORY_MODULES)
|
||||
@JsonProperty
|
||||
private List<SoftwareModuleTypeAssigmentRest> mandatorymodules;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DS_TYPE_OPTIONAL_MODULES)
|
||||
@JsonProperty
|
||||
private List<SoftwareModuleTypeAssigmentRest> optionalmodules;
|
||||
|
||||
@@ -56,9 +45,12 @@ public class DistributionSetTypeRequestBodyCreate {
|
||||
/**
|
||||
* @param name
|
||||
* the name to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setName(final String name) {
|
||||
public DistributionSetTypeRequestBodyPost setName(final String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -71,9 +63,12 @@ public class DistributionSetTypeRequestBodyCreate {
|
||||
/**
|
||||
* @param description
|
||||
* the description to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setDescription(final String description) {
|
||||
public DistributionSetTypeRequestBodyPost setDescription(final String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -86,13 +81,16 @@ public class DistributionSetTypeRequestBodyCreate {
|
||||
/**
|
||||
* @param key
|
||||
* the key to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setKey(final String key) {
|
||||
public DistributionSetTypeRequestBodyPost setKey(final String key) {
|
||||
this.key = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the mandatorymodules
|
||||
* @return the mandatory modules
|
||||
*/
|
||||
public List<SoftwareModuleTypeAssigmentRest> getMandatorymodules() {
|
||||
return mandatorymodules;
|
||||
@@ -100,14 +98,18 @@ public class DistributionSetTypeRequestBodyCreate {
|
||||
|
||||
/**
|
||||
* @param mandatorymodules
|
||||
* the mandatorymodules to set
|
||||
* the mandatory modules to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setMandatorymodules(final List<SoftwareModuleTypeAssigmentRest> mandatorymodules) {
|
||||
public DistributionSetTypeRequestBodyPost setMandatorymodules(
|
||||
final List<SoftwareModuleTypeAssigmentRest> mandatorymodules) {
|
||||
this.mandatorymodules = mandatorymodules;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the optionalmodules
|
||||
* @return the optional modules
|
||||
*/
|
||||
public List<SoftwareModuleTypeAssigmentRest> getOptionalmodules() {
|
||||
return optionalmodules;
|
||||
@@ -115,10 +117,14 @@ public class DistributionSetTypeRequestBodyCreate {
|
||||
|
||||
/**
|
||||
* @param optionalmodules
|
||||
* the optionalmodules to set
|
||||
* the optional modules to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setOptionalmodules(final List<SoftwareModuleTypeAssigmentRest> optionalmodules) {
|
||||
public DistributionSetTypeRequestBodyPost setOptionalmodules(
|
||||
final List<SoftwareModuleTypeAssigmentRest> optionalmodules) {
|
||||
this.optionalmodules = optionalmodules;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -8,22 +8,14 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.distributionsettype;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Request Body for DistributionSetType PUT, i.e. update.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class DistributionSetTypeRequestBodyUpdate {
|
||||
public class DistributionSetTypeRequestBodyPut {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DESCRPTION)
|
||||
@JsonProperty
|
||||
private String description;
|
||||
|
||||
@@ -37,9 +29,12 @@ public class DistributionSetTypeRequestBodyUpdate {
|
||||
/**
|
||||
* @param description
|
||||
* the description to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setDescription(final String description) {
|
||||
public DistributionSetTypeRequestBodyPut setDescription(final String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
7
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypeRest.java
Executable file → Normal file
7
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypeRest.java
Executable file → Normal file
@@ -9,16 +9,12 @@
|
||||
package org.eclipse.hawkbit.rest.resource.model.distributionsettype;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A json annotated rest model for SoftwareModuleType to RESTful API
|
||||
* representation.
|
||||
@@ -29,14 +25,11 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("Software Module")
|
||||
public class DistributionSetTypeRest extends NamedEntityRest {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ITEM_ID, required = true)
|
||||
@JsonProperty(value = "id", required = true)
|
||||
private Long moduleId;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DS_TYPE_KEY)
|
||||
@JsonProperty
|
||||
private String key;
|
||||
|
||||
|
||||
6
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypesRest.java
Executable file → Normal file
6
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/distributionsettype/DistributionSetTypesRest.java
Executable file → Normal file
@@ -16,17 +16,11 @@ import java.util.ListIterator;
|
||||
|
||||
import org.springframework.hateoas.ResourceSupport;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
/**
|
||||
* List representation of the {@link DistributionSetTypeRest} because Spring MVC
|
||||
* cannot handle plain lists interfaces as request body.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ApiModel("DistributionSetType")
|
||||
public class DistributionSetTypesRest extends ResourceSupport implements List<DistributionSetTypeRest> {
|
||||
|
||||
private final List<DistributionSetTypeRest> delegate = new ArrayList<>();
|
||||
|
||||
@@ -1,176 +0,0 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.doc;
|
||||
|
||||
/**
|
||||
* Constants for API documentation.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public final class ApiModelProperties {
|
||||
private static final String ENDING = " of the entity";
|
||||
|
||||
// generic
|
||||
public static final String ITEM_ID = "the id" + ENDING;
|
||||
|
||||
public static final String NAME = "the name" + ENDING;
|
||||
public static final String DESCRPTION = "the description" + ENDING;
|
||||
|
||||
public static final String CREATED_BY = "entity was originally created by (IM UUID)";
|
||||
|
||||
public static final String CREATED_AT = "entity was originally created at";
|
||||
public static final String LAST_MODIFIED_BY = "entity was last modified by (IM UUID)";
|
||||
public static final String LAST_MODIFIED_AT = "entity was last modified at";
|
||||
public static final String SIZE = "current page size";
|
||||
public static final String TOTAL_ELEMENTS = "total number of elements";
|
||||
|
||||
// Versioned entity
|
||||
public static final String VERSION = "software version";
|
||||
|
||||
// software module
|
||||
public static final String SOFTWARE_MODULE_TYPE = "the software module type " + ENDING;
|
||||
|
||||
public static final String VENDOR = "the software vendor " + ENDING;
|
||||
public static final String ARTIFACT_HASHES = "hashes of the artifact";
|
||||
public static final String ARTIFACT_SIZE = "size of the artifact";
|
||||
public static final String ARTIFACT_PROVIDED_FILENAME = "filename of the artifact";
|
||||
public static final String ARTIFACT_HASHES_SHA1 = "SHA1 hash of the artifact";
|
||||
public static final String ARTIFACT_HASHES_MD5 = "MD5 hash of the artifact";
|
||||
public static final String DS_OS = "operating system or firmware software module - DEPRECATED (use modules)";
|
||||
public static final String DS_RUNTIME = "runtime software module (e.g. JVM) - DEPRECATED (use modules)";
|
||||
public static final String DS_APPLICATION = "application software module (e.g. OSGi container) - DEPRECATED (use modules)";
|
||||
public static final String DS_MODULES = "software modules (e.g. OSGi bundles, runtimes)";
|
||||
public static final String DS_REQUIRED_STEP = "is a required migration step";
|
||||
|
||||
// Target
|
||||
public static final String INSTALLED_AT = "installation time of current installed DistributionSet";
|
||||
|
||||
public static final String LAST_REQUEST_AT = "last time where the target polled the server, same as pollStatus.lastRequestAt";
|
||||
// poll status
|
||||
public static final String POLL_LAST_REQUEST_AT = "last time where the target polled the server";
|
||||
public static final String POLL_NEXT_EXPECTED_REQUEST_AT = "next expected time where the target polls the server";
|
||||
public static final String POLL_OVERDUE = "defines if the target poll time is overdued based on the next expected poll time plus the configured overdue poll time threshold";
|
||||
|
||||
public static final String UPDATE_STATUS = "current update status";
|
||||
public static final String TARGET_ATTRIBUTES = "target attributes";
|
||||
|
||||
public static final String TARGET_LIST = "list of targets";
|
||||
|
||||
public static final String SM_LIST = "list of software modules";
|
||||
|
||||
public static final String ACTION_TYPE = "type of action";
|
||||
|
||||
public static final String ACTION_STATUS_TYPE = "type of the action status";
|
||||
|
||||
public static final String ACTION_STATUS_MESSAGES = "messages related to the status";
|
||||
|
||||
public static final String ACTION_STATUS_REPORTED_AT = "time at which the status was reported (server time)";
|
||||
|
||||
public static final String ACTION_STATUS_LIST = "list of action status";
|
||||
|
||||
public static final String ACTION_EXECUTION_STATUS = "status of action";
|
||||
|
||||
public static final String ACTION_LIST = "list if actions";
|
||||
|
||||
public static final String POLL_STATUS = "status of the poll time of the target";
|
||||
|
||||
public static final String IP_ADDRESS = "last known ip-address of the target";
|
||||
|
||||
public static final String ADDRESS = "last known address of the target";
|
||||
|
||||
public static final String SECURITY_TOKEN = "the security token of this target which can be used to authenticate the target if enabled";
|
||||
|
||||
public static final String META_DATA = "Metadata";
|
||||
|
||||
public static final String SM_TYPE_KEY = "key that can be interpreted by the target";
|
||||
|
||||
public static final String SM_MAX_ASSIGNMENTS = "maximum number of assigments to a distribution set/target, e.g. only one firmware but multiple applications";
|
||||
|
||||
public static final String SM_TYPE_LIST = "list of software modules types";
|
||||
|
||||
// Direct Device Integration API
|
||||
public static final String TARGET_TIME = "time on the target device";
|
||||
|
||||
public static final String TARGET_STATUS = "SP target action status";
|
||||
|
||||
public static final String TARGET_EXEC_STATUS = "status of the action execution";
|
||||
|
||||
public static final String TARGET_RESULT_VALUE = "result of the action execution";
|
||||
|
||||
public static final String TARGET_RESULT_DETAILS = "List of details message information";
|
||||
|
||||
public static final String TARGET_RESULT_FINISHED = "defined status of the result";
|
||||
|
||||
public static final String TARGET_RESULT_PROGRESS = "progress assumption of the device";
|
||||
|
||||
public static final String TARGET_PROGRESS_CNT = "current progress level";
|
||||
|
||||
public static final String TARGET_PROGRESS_OF = "asumption concerning max progress level";
|
||||
|
||||
public static final String ACTION_ID = "id of the action";
|
||||
|
||||
public static final String CANCEL_ACTION = "action that needs to be canceled";
|
||||
|
||||
public static final String CHUNK_TYPE = "type of the chunk, e.g. firmware, bundle, app";
|
||||
|
||||
public static final String SOFTWARE_MODUL_TYPE = "type of the software module, e.g. firmware, bundle, app";
|
||||
|
||||
public static final String SOFTWARE_MODULE_VERSION = "version of the software module";
|
||||
|
||||
public static final String SOFTWARE_MODULE_NAME = "name of the software module";
|
||||
|
||||
public static final String SOFTWARE_MODULE_ARTIFACT_LINKS = "artifact links of the software module";
|
||||
|
||||
public static final String SOFTWARE_MODUL_ID = "id of the software module";
|
||||
|
||||
public static final String CHUNK_VERSION = "software version of the chunk";
|
||||
|
||||
public static final String CHUNK_NAME = "name of the chunk";
|
||||
|
||||
public static final String ARTIFACTS = "list of artifacts";
|
||||
|
||||
public static final String TARGET_CONFIGURATION = "target configuration setup by the server";
|
||||
|
||||
public static final String TARGET_POLL_TIME = "suggested sleep time between polls";
|
||||
|
||||
public static final String TARGET_SLEEP = "sleep time in HH:MM:SS notation";
|
||||
|
||||
public static final String DEPLOYMENT = "detailed deployment operation";
|
||||
|
||||
public static final String HANDLING_DOWNLOAD = "handling for the download part of the provisioning process";
|
||||
|
||||
public static final String HANDLING_UPDATE = "handling for the update part of the provisioning process";
|
||||
|
||||
public static final String CHUNK = "software chunk of an update";
|
||||
|
||||
public static final String SOFTWARE_MODUL = "software moduls of an update";
|
||||
|
||||
public static final String ARTIFACT = "artifact moduls of an update";
|
||||
|
||||
public static final String TARGET_CONFIG_DATA = "configuration data as key/value list";
|
||||
|
||||
public static final String DS_TYPE_KEY = "funtional key of the distribution set type";
|
||||
|
||||
public static final String DS_TYPE_LIST = "list of distribution set types";
|
||||
|
||||
public static final String DS_TYPE = "the type of the distribution set";
|
||||
|
||||
public static final String DS_COMPLETE = "true of the distribution set software module setup is complete by means as defined by the distribution set type";
|
||||
|
||||
public static final String DS_TYPE_MANDATORY_MODULES = "mandatory module type IDs";
|
||||
|
||||
public static final String DS_TYPE_OPTIONAL_MODULES = "optional module type IDs";
|
||||
|
||||
private ApiModelProperties() {
|
||||
// utility class
|
||||
}
|
||||
|
||||
}
|
||||
3
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleAssigmentRest.java
Executable file → Normal file
3
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleAssigmentRest.java
Executable file → Normal file
@@ -12,8 +12,6 @@ import org.eclipse.hawkbit.rest.resource.model.IdRest;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
/**
|
||||
* Request Body of SoftwareModule for assignment operations (ID only).
|
||||
*
|
||||
@@ -22,7 +20,6 @@ import io.swagger.annotations.ApiModel;
|
||||
*
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("Software Module ID")
|
||||
public class SoftwareModuleAssigmentRest extends IdRest {
|
||||
|
||||
}
|
||||
|
||||
9
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModulePagedList.java
Executable file → Normal file
9
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModulePagedList.java
Executable file → Normal file
@@ -11,22 +11,13 @@ package org.eclipse.hawkbit.rest.resource.model.softwaremodule;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.PagedList;
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Paged list for SoftwareModule.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ApiModel("Paged list of software modules")
|
||||
public class SoftwareModulePagedList extends PagedList<SoftwareModuleRest> {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.SM_LIST, required = true)
|
||||
private final List<SoftwareModuleRest> content;
|
||||
|
||||
/**
|
||||
|
||||
38
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRequestBodyPost.java
Executable file → Normal file
38
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRequestBodyPost.java
Executable file → Normal file
@@ -8,39 +8,26 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.softwaremodule;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Request Body for SoftwareModule POST.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SoftwareModuleRequestBodyPost {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.NAME, required = true)
|
||||
@JsonProperty(required = true)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.VERSION, required = true)
|
||||
@JsonProperty(required = true)
|
||||
private String version;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.SOFTWARE_MODULE_TYPE, required = true, allowableValues = SoftwareModuleRest.SM_RUNTIME
|
||||
+ "," + SoftwareModuleRest.SM_APPLICATION + "," + SoftwareModuleRest.SM_OS)
|
||||
@JsonProperty(required = true)
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DESCRPTION)
|
||||
@JsonProperty
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.VENDOR)
|
||||
@JsonProperty
|
||||
private String vendor;
|
||||
|
||||
@@ -54,9 +41,12 @@ public class SoftwareModuleRequestBodyPost {
|
||||
/**
|
||||
* @param name
|
||||
* the name to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setName(final String name) {
|
||||
public SoftwareModuleRequestBodyPost setName(final String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -69,9 +59,12 @@ public class SoftwareModuleRequestBodyPost {
|
||||
/**
|
||||
* @param version
|
||||
* the version to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setVersion(final String version) {
|
||||
public SoftwareModuleRequestBodyPost setVersion(final String version) {
|
||||
this.version = version;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -84,9 +77,12 @@ public class SoftwareModuleRequestBodyPost {
|
||||
/**
|
||||
* @param type
|
||||
* the type to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setType(final String type) {
|
||||
public SoftwareModuleRequestBodyPost setType(final String type) {
|
||||
this.type = type;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -99,9 +95,12 @@ public class SoftwareModuleRequestBodyPost {
|
||||
/**
|
||||
* @param description
|
||||
* the description to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setDescription(final String description) {
|
||||
public SoftwareModuleRequestBodyPost setDescription(final String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -114,9 +113,12 @@ public class SoftwareModuleRequestBodyPost {
|
||||
/**
|
||||
* @param vendor
|
||||
* the vendor to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setVendor(final String vendor) {
|
||||
public SoftwareModuleRequestBodyPost setVendor(final String vendor) {
|
||||
this.vendor = vendor;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
19
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRequestBodyPut.java
Executable file → Normal file
19
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRequestBodyPut.java
Executable file → Normal file
@@ -8,26 +8,17 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.softwaremodule;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Request Body for SoftwareModule PUT.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SoftwareModuleRequestBodyPut {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DESCRPTION)
|
||||
@JsonProperty
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.VENDOR)
|
||||
@JsonProperty
|
||||
private String vendor;
|
||||
|
||||
@@ -41,9 +32,12 @@ public class SoftwareModuleRequestBodyPut {
|
||||
/**
|
||||
* @param description
|
||||
* the description to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setDescription(final String description) {
|
||||
public SoftwareModuleRequestBodyPut setDescription(final String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,9 +50,12 @@ public class SoftwareModuleRequestBodyPut {
|
||||
/**
|
||||
* @param vendor
|
||||
* the vendor to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setVendor(final String vendor) {
|
||||
public SoftwareModuleRequestBodyPut setVendor(final String vendor) {
|
||||
this.vendor = vendor;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
12
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRest.java
Executable file → Normal file
12
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModuleRest.java
Executable file → Normal file
@@ -9,7 +9,6 @@
|
||||
package org.eclipse.hawkbit.rest.resource.model.softwaremodule;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
@@ -17,19 +16,12 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A json annotated rest model for SoftwareModule to RESTful API representation.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("Software Module")
|
||||
public class SoftwareModuleRest extends NamedEntityRest {
|
||||
/**
|
||||
* API definition for {@link SoftwareModule.Type#RUNTIME}.
|
||||
@@ -44,19 +36,15 @@ public class SoftwareModuleRest extends NamedEntityRest {
|
||||
*/
|
||||
public static final String SM_APPLICATION = "application";
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ITEM_ID, required = true)
|
||||
@JsonProperty(value = "id", required = true)
|
||||
private Long moduleId;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.VERSION, required = true)
|
||||
@JsonProperty(required = true)
|
||||
private String version;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.SOFTWARE_MODULE_TYPE, required = true)
|
||||
@JsonProperty(required = true)
|
||||
private String type;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.VENDOR)
|
||||
@JsonProperty
|
||||
private String vendor;
|
||||
|
||||
|
||||
0
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModulesRest.java
Executable file → Normal file
0
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremodule/SoftwareModulesRest.java
Executable file → Normal file
6
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeAssigmentRest.java
Executable file → Normal file
6
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeAssigmentRest.java
Executable file → Normal file
@@ -12,17 +12,11 @@ import org.eclipse.hawkbit.rest.resource.model.IdRest;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
/**
|
||||
* Request Body of SoftwareModuleType for assignment operations (ID only).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("Software Module Type ID")
|
||||
public class SoftwareModuleTypeAssigmentRest extends IdRest {
|
||||
|
||||
}
|
||||
|
||||
9
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypePagedList.java
Executable file → Normal file
9
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypePagedList.java
Executable file → Normal file
@@ -11,22 +11,13 @@ package org.eclipse.hawkbit.rest.resource.model.softwaremoduletype;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.PagedList;
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Paged list for SoftwareModuleType.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ApiModel("Paged list of software module typess")
|
||||
public class SoftwareModuleTypePagedList extends PagedList<SoftwareModuleTypeRest> {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.SM_TYPE_LIST, required = true)
|
||||
private final List<SoftwareModuleTypeRest> content;
|
||||
|
||||
/**
|
||||
|
||||
30
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRequestBodyPost.java
Executable file → Normal file
30
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRequestBodyPost.java
Executable file → Normal file
@@ -8,34 +8,23 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.softwaremoduletype;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Request Body for SoftwareModuleType POST.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SoftwareModuleTypeRequestBodyPost {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.NAME, required = true)
|
||||
@JsonProperty(required = true)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DESCRPTION)
|
||||
@JsonProperty
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.SM_TYPE_KEY)
|
||||
@JsonProperty
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.SM_MAX_ASSIGNMENTS)
|
||||
@JsonProperty
|
||||
private int maxAssignments;
|
||||
|
||||
@@ -49,9 +38,12 @@ public class SoftwareModuleTypeRequestBodyPost {
|
||||
/**
|
||||
* @param name
|
||||
* the name to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setName(final String name) {
|
||||
public SoftwareModuleTypeRequestBodyPost setName(final String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -64,9 +56,12 @@ public class SoftwareModuleTypeRequestBodyPost {
|
||||
/**
|
||||
* @param description
|
||||
* the description to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setDescription(final String description) {
|
||||
public SoftwareModuleTypeRequestBodyPost setDescription(final String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -79,9 +74,11 @@ public class SoftwareModuleTypeRequestBodyPost {
|
||||
/**
|
||||
* @param key
|
||||
* the key to set
|
||||
* @return updated body
|
||||
*/
|
||||
public void setKey(final String key) {
|
||||
public SoftwareModuleTypeRequestBodyPost setKey(final String key) {
|
||||
this.key = key;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -94,9 +91,12 @@ public class SoftwareModuleTypeRequestBodyPost {
|
||||
/**
|
||||
* @param maxAssignments
|
||||
* the maxAssignments to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setMaxAssignments(final int maxAssignments) {
|
||||
public SoftwareModuleTypeRequestBodyPost setMaxAssignments(final int maxAssignments) {
|
||||
this.maxAssignments = maxAssignments;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
13
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRequestBodyPut.java
Executable file → Normal file
13
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRequestBodyPut.java
Executable file → Normal file
@@ -8,22 +8,14 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.softwaremoduletype;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Request Body for SoftwareModuleType PUT.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class SoftwareModuleTypeRequestBodyPut {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DESCRPTION)
|
||||
@JsonProperty
|
||||
private String description;
|
||||
|
||||
@@ -37,9 +29,12 @@ public class SoftwareModuleTypeRequestBodyPut {
|
||||
/**
|
||||
* @param description
|
||||
* the description to set
|
||||
*
|
||||
* @return updated body
|
||||
*/
|
||||
public void setDescription(final String description) {
|
||||
public SoftwareModuleTypeRequestBodyPut setDescription(final String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
8
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRest.java
Executable file → Normal file
8
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypeRest.java
Executable file → Normal file
@@ -9,16 +9,12 @@
|
||||
package org.eclipse.hawkbit.rest.resource.model.softwaremoduletype;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A json annotated rest model for SoftwareModuleType to RESTful API
|
||||
* representation.
|
||||
@@ -29,18 +25,14 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("Software Module")
|
||||
public class SoftwareModuleTypeRest extends NamedEntityRest {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ITEM_ID, required = true)
|
||||
@JsonProperty(value = "id", required = true)
|
||||
private Long moduleId;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.SM_TYPE_KEY)
|
||||
@JsonProperty
|
||||
private String key;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.SM_MAX_ASSIGNMENTS)
|
||||
@JsonProperty
|
||||
private int maxAssignments;
|
||||
|
||||
|
||||
6
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypesRest.java
Executable file → Normal file
6
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/softwaremoduletype/SoftwareModuleTypesRest.java
Executable file → Normal file
@@ -16,17 +16,11 @@ import java.util.ListIterator;
|
||||
|
||||
import org.springframework.hateoas.ResourceSupport;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
/**
|
||||
* List representation of the {@link SoftwareModuleTypeRest} because Spring MVC
|
||||
* cannot handle plain lists interfaces as request body.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ApiModel("SoftwareModuleType")
|
||||
public class SoftwareModuleTypesRest extends ResourceSupport implements List<SoftwareModuleTypeRest> {
|
||||
|
||||
private final List<SoftwareModuleTypeRest> delegate = new ArrayList<>();
|
||||
|
||||
0
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/system/CacheRest.java
Executable file → Normal file
0
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/system/CacheRest.java
Executable file → Normal file
@@ -0,0 +1,86 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.system;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
|
||||
/**
|
||||
* Body for system statistics.
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class SystemStatisticsRest {
|
||||
|
||||
private long overallTargets;
|
||||
private long overallArtifacts;
|
||||
private long overallArtifactVolumeInBytes;
|
||||
private long overallActions;
|
||||
private long overallTenants;
|
||||
|
||||
private List<TenantSystemUsageRest> tenantStats;
|
||||
|
||||
public long getOverallTargets() {
|
||||
return overallTargets;
|
||||
}
|
||||
|
||||
public SystemStatisticsRest setOverallTargets(final long overallTargets) {
|
||||
this.overallTargets = overallTargets;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getOverallArtifacts() {
|
||||
return overallArtifacts;
|
||||
}
|
||||
|
||||
public SystemStatisticsRest setOverallArtifacts(final long overallArtifacts) {
|
||||
this.overallArtifacts = overallArtifacts;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getOverallArtifactVolumeInBytes() {
|
||||
return overallArtifactVolumeInBytes;
|
||||
}
|
||||
|
||||
public SystemStatisticsRest setOverallArtifactVolumeInBytes(final long overallArtifactVolumeInBytes) {
|
||||
this.overallArtifactVolumeInBytes = overallArtifactVolumeInBytes;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getOverallActions() {
|
||||
return overallActions;
|
||||
}
|
||||
|
||||
public SystemStatisticsRest setOverallActions(final long overallActions) {
|
||||
this.overallActions = overallActions;
|
||||
return this;
|
||||
}
|
||||
|
||||
public long getOverallTenants() {
|
||||
return overallTenants;
|
||||
}
|
||||
|
||||
public SystemStatisticsRest setOverallTenants(final long overallTenants) {
|
||||
this.overallTenants = overallTenants;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void setTenantStats(final List<TenantSystemUsageRest> tenantStats) {
|
||||
this.tenantStats = tenantStats;
|
||||
}
|
||||
|
||||
public List<TenantSystemUsageRest> getTenantStats() {
|
||||
return tenantStats;
|
||||
}
|
||||
|
||||
}
|
||||
5
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/system/TenantConfigurationRest.java
Executable file → Normal file
5
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/system/TenantConfigurationRest.java
Executable file → Normal file
@@ -12,15 +12,12 @@ import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
/**
|
||||
*
|
||||
* Response body for tenant configuration requests.
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("Tenant Configuration")
|
||||
public class TenantConfigurationRest {
|
||||
|
||||
private String key;
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.system;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
|
||||
/**
|
||||
* Response body for system usage report.
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class TenantSystemUsageRest {
|
||||
|
||||
private final String tenantName;
|
||||
private long targets;
|
||||
private long artifacts;
|
||||
private long actions;
|
||||
private long overallArtifactVolumeInBytes;
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param tenantName
|
||||
*/
|
||||
public TenantSystemUsageRest(final String tenantName) {
|
||||
super();
|
||||
this.tenantName = tenantName;
|
||||
}
|
||||
|
||||
public long getTargets() {
|
||||
return targets;
|
||||
}
|
||||
|
||||
public void setTargets(final long targets) {
|
||||
this.targets = targets;
|
||||
}
|
||||
|
||||
public long getArtifacts() {
|
||||
return artifacts;
|
||||
}
|
||||
|
||||
public void setArtifacts(final long artifacts) {
|
||||
this.artifacts = artifacts;
|
||||
}
|
||||
|
||||
public long getActions() {
|
||||
return actions;
|
||||
}
|
||||
|
||||
public void setActions(final long actions) {
|
||||
this.actions = actions;
|
||||
}
|
||||
|
||||
public long getOverallArtifactVolumeInBytes() {
|
||||
return overallArtifactVolumeInBytes;
|
||||
}
|
||||
|
||||
public void setOverallArtifactVolumeInBytes(final long overallArtifactVolumeInBytes) {
|
||||
this.overallArtifactVolumeInBytes = overallArtifactVolumeInBytes;
|
||||
}
|
||||
|
||||
public String getTenantName() {
|
||||
return tenantName;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.tag;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Request Body for PUT.
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class AssignedDistributionSetRequestBody {
|
||||
|
||||
@JsonProperty(value = "id", required = true)
|
||||
private Long distributionSetId;
|
||||
|
||||
public Long getDistributionSetId() {
|
||||
return distributionSetId;
|
||||
}
|
||||
|
||||
public AssignedDistributionSetRequestBody setDistributionSetId(final Long distributionSetId) {
|
||||
this.distributionSetId = distributionSetId;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.tag;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Request Body for PUT.
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class AssignedTargetRequestBody {
|
||||
|
||||
@JsonProperty(required = true)
|
||||
private String controllerId;
|
||||
|
||||
public String getControllerId() {
|
||||
return controllerId;
|
||||
}
|
||||
|
||||
public AssignedTargetRequestBody setControllerId(final String controllerId) {
|
||||
this.controllerId = controllerId;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.tag;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.distributionset.DistributionSetsRest;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* * A json annotated rest model for DSAssigmentResult to RESTful API
|
||||
* representation.
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class DistributionSetTagAssigmentResultRest {
|
||||
|
||||
@JsonProperty
|
||||
private DistributionSetsRest assignedDistributionSets;
|
||||
|
||||
@JsonProperty
|
||||
private DistributionSetsRest unassignedDistributionSets;
|
||||
|
||||
public DistributionSetsRest getAssignedDistributionSets() {
|
||||
return assignedDistributionSets;
|
||||
}
|
||||
|
||||
public DistributionSetsRest getUnassignedDistributionSets() {
|
||||
return unassignedDistributionSets;
|
||||
}
|
||||
|
||||
public void setAssignedDistributionSets(final DistributionSetsRest assignedDistributionSets) {
|
||||
this.assignedDistributionSets = assignedDistributionSets;
|
||||
}
|
||||
|
||||
public void setUnassignedDistributionSets(final DistributionSetsRest unassignedDistributionSets) {
|
||||
this.unassignedDistributionSets = unassignedDistributionSets;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.tag;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.PagedList;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Paged list for tags.
|
||||
*
|
||||
*/
|
||||
public class TagPagedList extends PagedList<TagRest> {
|
||||
|
||||
private final List<TagRest> content;
|
||||
|
||||
/**
|
||||
* @param content
|
||||
* @param total
|
||||
*/
|
||||
@JsonCreator
|
||||
public TagPagedList(@JsonProperty("content") final List<TagRest> content, @JsonProperty("total") final long total) {
|
||||
super(content, total);
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the content of the paged list. Never {@code null}.
|
||||
*/
|
||||
public List<TagRest> getContent() {
|
||||
return content;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.tag;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Request Body for PUT/POST.
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class TagRequestBodyPut {
|
||||
|
||||
@JsonProperty
|
||||
private String colour;
|
||||
|
||||
@JsonProperty
|
||||
private String name;
|
||||
|
||||
@JsonProperty
|
||||
private String description;
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public TagRequestBodyPut setName(final String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public TagRequestBodyPut setDescription(final String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TagRequestBodyPut setColour(final String colour) {
|
||||
this.colour = colour;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String getColour() {
|
||||
return colour;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.tag;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* A json annotated rest model for Tag to RESTful API representation.
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class TagRest extends NamedEntityRest {
|
||||
|
||||
@JsonProperty(value = "id", required = true)
|
||||
private Long tagId;
|
||||
|
||||
@JsonProperty
|
||||
private String colour;
|
||||
|
||||
@JsonIgnore
|
||||
public void setTagId(final Long tagId) {
|
||||
this.tagId = tagId;
|
||||
}
|
||||
|
||||
public Long getTagId() {
|
||||
return tagId;
|
||||
}
|
||||
|
||||
public void setColour(final String colour) {
|
||||
this.colour = colour;
|
||||
}
|
||||
|
||||
public String getColour() {
|
||||
return colour;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,275 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.tag;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.ListIterator;
|
||||
|
||||
import org.springframework.hateoas.ResourceSupport;
|
||||
|
||||
/**
|
||||
* List representation of the {@link TagRest} because Spring MVC cannot handle
|
||||
* plain lists interfaces as request body.
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class TagsRest extends ResourceSupport implements List<TagRest> {
|
||||
|
||||
private final List<TagRest> delegate = new ArrayList<>();
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see java.util.List#size()
|
||||
*/
|
||||
@Override
|
||||
public int size() {
|
||||
return delegate.size();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see java.util.List#isEmpty()
|
||||
*/
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return delegate.isEmpty();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param o
|
||||
* @return
|
||||
* @see java.util.List#contains(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean contains(final Object o) {
|
||||
return delegate.contains(o);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see java.util.List#iterator()
|
||||
*/
|
||||
@Override
|
||||
public Iterator<TagRest> iterator() {
|
||||
return delegate.iterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see java.util.List#toArray()
|
||||
*/
|
||||
@Override
|
||||
public Object[] toArray() {
|
||||
return delegate.toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param a
|
||||
* @return
|
||||
* @see java.util.List#toArray(java.lang.Object[])
|
||||
*/
|
||||
@Override
|
||||
public <T> T[] toArray(final T[] a) {
|
||||
return delegate.toArray(a);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param e
|
||||
* @return
|
||||
* @see java.util.List#add(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean add(final TagRest e) {
|
||||
return delegate.add(e);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param o
|
||||
* @return
|
||||
* @see java.util.List#remove(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean remove(final Object o) {
|
||||
return delegate.remove(o);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param c
|
||||
* @return
|
||||
* @see java.util.List#containsAll(java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
public boolean containsAll(final Collection<?> c) {
|
||||
return delegate.containsAll(c);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param c
|
||||
* @return
|
||||
* @see java.util.List#addAll(java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
public boolean addAll(final Collection<? extends TagRest> c) {
|
||||
return delegate.addAll(c);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param index
|
||||
* @param c
|
||||
* @return
|
||||
* @see java.util.List#addAll(int, java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
public boolean addAll(final int index, final Collection<? extends TagRest> c) {
|
||||
return delegate.addAll(index, c);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param c
|
||||
* @return
|
||||
* @see java.util.List#removeAll(java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
public boolean removeAll(final Collection<?> c) {
|
||||
return delegate.removeAll(c);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param c
|
||||
* @return
|
||||
* @see java.util.List#retainAll(java.util.Collection)
|
||||
*/
|
||||
@Override
|
||||
public boolean retainAll(final Collection<?> c) {
|
||||
return delegate.retainAll(c);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @see java.util.List#clear()
|
||||
*/
|
||||
@Override
|
||||
public void clear() {
|
||||
delegate.clear();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param o
|
||||
* @return
|
||||
* @see java.util.List#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(final Object o) {
|
||||
return delegate.equals(o);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see java.util.List#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return delegate.hashCode();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param index
|
||||
* @return
|
||||
* @see java.util.List#get(int)
|
||||
*/
|
||||
@Override
|
||||
public TagRest get(final int index) {
|
||||
return delegate.get(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param index
|
||||
* @param element
|
||||
* @return
|
||||
* @see java.util.List#set(int, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public TagRest set(final int index, final TagRest element) {
|
||||
return delegate.set(index, element);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param index
|
||||
* @param element
|
||||
* @see java.util.List#add(int, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void add(final int index, final TagRest element) {
|
||||
delegate.add(index, element);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param index
|
||||
* @return
|
||||
* @see java.util.List#remove(int)
|
||||
*/
|
||||
@Override
|
||||
public TagRest remove(final int index) {
|
||||
return delegate.remove(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param o
|
||||
* @return
|
||||
* @see java.util.List#indexOf(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public int indexOf(final Object o) {
|
||||
return delegate.indexOf(o);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param o
|
||||
* @return
|
||||
* @see java.util.List#lastIndexOf(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public int lastIndexOf(final Object o) {
|
||||
return delegate.lastIndexOf(o);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return
|
||||
* @see java.util.List#listIterator()
|
||||
*/
|
||||
@Override
|
||||
public ListIterator<TagRest> listIterator() {
|
||||
return delegate.listIterator();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param index
|
||||
* @return
|
||||
* @see java.util.List#listIterator(int)
|
||||
*/
|
||||
@Override
|
||||
public ListIterator<TagRest> listIterator(final int index) {
|
||||
return delegate.listIterator(index);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param fromIndex
|
||||
* @param toIndex
|
||||
* @return
|
||||
* @see java.util.List#subList(int, int)
|
||||
*/
|
||||
@Override
|
||||
public List<TagRest> subList(final int fromIndex, final int toIndex) {
|
||||
return delegate.subList(fromIndex, toIndex);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.tag;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.target.TargetsRest;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* * A json annotated rest model for TargetTagAssigmentResult to RESTful API
|
||||
* representation.
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class TargetTagAssigmentResultRest {
|
||||
|
||||
@JsonProperty
|
||||
private TargetsRest assignedTargets;
|
||||
|
||||
@JsonProperty
|
||||
private TargetsRest unassignedTargets;
|
||||
|
||||
public void setAssignedTargets(final TargetsRest assignedTargets) {
|
||||
this.assignedTargets = assignedTargets;
|
||||
}
|
||||
|
||||
public TargetsRest getAssignedTargets() {
|
||||
return assignedTargets;
|
||||
}
|
||||
|
||||
public void setUnassignedTargets(final TargetsRest unassignedTargets) {
|
||||
this.unassignedTargets = unassignedTargets;
|
||||
}
|
||||
|
||||
public TargetsRest getUnassignedTargets() {
|
||||
return unassignedTargets;
|
||||
}
|
||||
|
||||
}
|
||||
10
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/DistributionSetAssigmentRest.java
Executable file → Normal file
10
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/DistributionSetAssigmentRest.java
Executable file → Normal file
@@ -6,22 +6,12 @@ package org.eclipse.hawkbit.rest.resource.model.target;
|
||||
import org.eclipse.hawkbit.rest.resource.model.IdRest;
|
||||
import org.eclipse.hawkbit.rest.resource.model.distributionset.ActionTypeRest;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Request Body of DistributionSet for assignment operations (ID only).
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ApiModel("Distribution Set Assignment")
|
||||
public class DistributionSetAssigmentRest extends IdRest {
|
||||
|
||||
@ApiModelProperty(value = "forcetime in milliseconds")
|
||||
private long forcetime;
|
||||
@ApiModelProperty(value = "the assignment type default 'forced'")
|
||||
private ActionTypeRest type;
|
||||
|
||||
/**
|
||||
|
||||
10
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetAttributes.java
Executable file → Normal file
10
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetAttributes.java
Executable file → Normal file
@@ -6,18 +6,10 @@ package org.eclipse.hawkbit.rest.resource.model.target;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
|
||||
/**
|
||||
* {@link Map} with attribtes of SP Target.
|
||||
*
|
||||
*
|
||||
*
|
||||
* {@link Map} with attributes of SP Target.
|
||||
*
|
||||
*/
|
||||
@ApiModel(ApiModelProperties.TARGET_ATTRIBUTES)
|
||||
public class TargetAttributes extends HashMap<String, String> {
|
||||
|
||||
}
|
||||
|
||||
14
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetPagedList.java
Executable file → Normal file
14
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetPagedList.java
Executable file → Normal file
@@ -6,29 +6,25 @@ package org.eclipse.hawkbit.rest.resource.model.target;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.PagedList;
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import com.fasterxml.jackson.annotation.JsonCreator;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Paged list for targets.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@ApiModel("Paged list of targets")
|
||||
public class TargetPagedList extends PagedList<TargetRest> {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.TARGET_LIST, required = true)
|
||||
private final List<TargetRest> content;
|
||||
|
||||
/**
|
||||
* @param content
|
||||
* @param total
|
||||
*/
|
||||
public TargetPagedList(final List<TargetRest> content, final long total) {
|
||||
@JsonCreator
|
||||
public TargetPagedList(@JsonProperty("content") final List<TargetRest> content,
|
||||
@JsonProperty("total") final long total) {
|
||||
super(content, total);
|
||||
this.content = content;
|
||||
}
|
||||
|
||||
19
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetRequestBody.java
Executable file → Normal file
19
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetRequestBody.java
Executable file → Normal file
@@ -3,28 +3,18 @@
|
||||
*/
|
||||
package org.eclipse.hawkbit.rest.resource.model.target;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* Request body for target PUT/POST commands.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class TargetRequestBody {
|
||||
@ApiModelProperty(value = ApiModelProperties.NAME, required = true)
|
||||
@JsonProperty(required = true)
|
||||
private String name;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.DESCRPTION)
|
||||
private String description;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ITEM_ID, required = true)
|
||||
@JsonProperty(required = true)
|
||||
private String controllerId;
|
||||
|
||||
@@ -53,24 +43,27 @@ public class TargetRequestBody {
|
||||
* @param name
|
||||
* the name to set
|
||||
*/
|
||||
public void setName(final String name) {
|
||||
public TargetRequestBody setName(final String name) {
|
||||
this.name = name;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param description
|
||||
* the description to set
|
||||
*/
|
||||
public void setDescription(final String description) {
|
||||
public TargetRequestBody setDescription(final String description) {
|
||||
this.description = description;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param controllerId
|
||||
* the controllerId to set
|
||||
*/
|
||||
public void setControllerId(final String controllerId) {
|
||||
public TargetRequestBody setControllerId(final String controllerId) {
|
||||
this.controllerId = controllerId;
|
||||
return this;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
16
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetRest.java
Executable file → Normal file
16
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetRest.java
Executable file → Normal file
@@ -7,7 +7,6 @@ import java.net.URI;
|
||||
|
||||
import org.eclipse.hawkbit.rest.resource.model.NamedEntityRest;
|
||||
import org.eclipse.hawkbit.rest.resource.model.PollStatusRest;
|
||||
import org.eclipse.hawkbit.rest.resource.model.doc.ApiModelProperties;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
@@ -15,50 +14,35 @@ import com.fasterxml.jackson.annotation.JsonInclude;
|
||||
import com.fasterxml.jackson.annotation.JsonInclude.Include;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
/**
|
||||
* A json annotated rest model for Target to RESTful API representation.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
@JsonInclude(Include.NON_NULL)
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@ApiModel("Provisioning Target")
|
||||
public class TargetRest extends NamedEntityRest {
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ITEM_ID, required = true)
|
||||
@JsonProperty(required = true)
|
||||
private String controllerId;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.UPDATE_STATUS, allowableValues = "error, in_sync, pending, registered, unknown")
|
||||
@JsonProperty
|
||||
private String updateStatus;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.LAST_REQUEST_AT)
|
||||
@JsonProperty
|
||||
private Long lastControllerRequestAt;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.INSTALLED_AT)
|
||||
@JsonProperty
|
||||
private Long installedAt;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.IP_ADDRESS)
|
||||
@JsonProperty
|
||||
private String ipAddress;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.ADDRESS)
|
||||
@JsonProperty
|
||||
private String address;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.POLL_STATUS)
|
||||
@JsonProperty
|
||||
private PollStatusRest pollStatus;
|
||||
|
||||
@ApiModelProperty(value = ApiModelProperties.SECURITY_TOKEN)
|
||||
@JsonProperty
|
||||
private String securityToken;
|
||||
|
||||
|
||||
3
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetsRest.java
Executable file → Normal file
3
hawkbit-rest-api/src/main/java/org/eclipse/hawkbit/rest/resource/model/target/TargetsRest.java
Executable file → Normal file
@@ -15,9 +15,6 @@ import org.springframework.hateoas.ResourceSupport;
|
||||
* A list representation of the {@link TargetRest} because Spring MVC cannot
|
||||
* handle plain lists interfaces as request body.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
public class TargetsRest extends ResourceSupport implements List<TargetRest> {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user