[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r134984040 ## File path: api/src/org/apache/cloudstack/api/command/admin/annotation/ListAnnotationsCmd.java ## @@ -0,0 +1,81 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.command.admin.annotation; + +import com.cloud.exception.ConcurrentOperationException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.NetworkRuleConflictException; +import com.cloud.exception.ResourceAllocationException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.utils.StringUtils; +import com.google.common.base.Preconditions; +import org.apache.cloudstack.acl.RoleType; +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.BaseCmd; +import org.apache.cloudstack.api.BaseListCmd; +import org.apache.cloudstack.api.Parameter; +import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.response.AnnotationResponse; +import org.apache.cloudstack.api.response.ListResponse; + +@APICommand(name = ListAnnotationsCmd.APINAME, description = "Lists annotations.", responseObject = AnnotationResponse.class, +requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, since = "4.11", authorized = {RoleType.Admin}) Review comment: I don't see an above which is probably obfuscated by a rebase but as for this; we do not allow anybody but admins to annotate for now. When we find use cases we can add them here This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r134983298 ## File path: server/src/org/apache/cloudstack/annotation/AnnotationManagerImpl.java ## @@ -0,0 +1,145 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.annotation; + +import com.cloud.utils.component.ManagerBase; +import com.cloud.utils.component.PluggableService; +import org.apache.cloudstack.annotation.dao.AnnotationDao; +import org.apache.cloudstack.api.command.admin.annotation.AddAnnotationCmd; +import org.apache.cloudstack.api.command.admin.annotation.ListAnnotationsCmd; +import org.apache.cloudstack.api.command.admin.annotation.RemoveAnnotationCmd; +import org.apache.cloudstack.api.response.AnnotationResponse; +import org.apache.cloudstack.api.response.ListResponse; +import org.apache.cloudstack.context.CallContext; +import org.apache.log4j.Logger; + +import javax.inject.Inject; +import java.util.ArrayList; +import java.util.List; + +/** + * @since 4.11 + */ +public final class AnnotationManagerImpl extends ManagerBase implements AnnotationService, PluggableService { +public static final Logger s_logger = Logger.getLogger(AnnotationManagerImpl.class); + +@Inject +private AnnotationDao annotationDao; + +@Override +public ListResponse searchForAnnotations(ListAnnotationsCmd cmd) { +List annotations = +getAnnotationsForApiCmd(cmd); +List annotationResponses = +convertAnnotationsToResponses(annotations); +return createAnnotationsResponseList(annotationResponses); +} + +@Override +public AnnotationResponse addAnnotation(AddAnnotationCmd addAnnotationCmd) { +return addAnnotation(addAnnotationCmd.getAnnotation(), addAnnotationCmd.getEntityType(), addAnnotationCmd.getEntityUuid()); +} + +public AnnotationResponse addAnnotation(String text, EntityType type, String uuid) { Review comment: will add This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r134983243 ## File path: api/src/org/apache/cloudstack/api/command/admin/annotation/RemoveAnnotationCmd.java ## @@ -0,0 +1,68 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.command.admin.annotation; + +import com.cloud.exception.ConcurrentOperationException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.NetworkRuleConflictException; +import com.cloud.exception.ResourceAllocationException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.user.Account; +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.BaseCmd; +import org.apache.cloudstack.api.Parameter; +import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.response.AnnotationResponse; + +/** + * @since 4.11 + */ +@APICommand(name = RemoveAnnotationCmd.APINAME, description = "remove an annotation.", responseObject = AnnotationResponse.class, +requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) +public class RemoveAnnotationCmd extends BaseCmd{ + +@Parameter(name = ApiConstants.ID, type = CommandType.STRING, required = true, description = "the id of the annotation") +private String uuid; + +public String getUuid() { Review comment: I addressed this earlier, don't know why it stuck here but as clear from the fragment the variable is above the getter. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r134983068 ## File path: api/src/org/apache/cloudstack/api/response/AnnotationResponse.java ## @@ -0,0 +1,121 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.response; + +import com.cloud.serializer.Param; +import com.google.gson.annotations.SerializedName; +import org.apache.cloudstack.annotation.Annotation; +import org.apache.cloudstack.annotation.AnnotationService; +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.BaseResponse; +import org.apache.cloudstack.api.EntityReference; + +import java.util.Date; + +/** + * @since 4.11 Review comment: I'm just answerring this once for all the below as well: This is javadoc that might be helpfull for a developer working in an IDE in several versions at once. It is not useless unless there is a regular annotation as well. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r134981905 ## File path: api/src/org/apache/cloudstack/api/BaseCmd.java ## @@ -192,6 +191,8 @@ public AlertService _alertSvc; @Inject public UUIDManager _uuidMgr; +@Inject +public AnnotationService annotationService; Review comment: As discussed, this is a breakage of pattern in the code base that goes two ways. Adhering to one and not the other has downsides either way. Not important now (in this PR) but worth revisiting is how to poetically describe used services per API without having to describe the samething over and over per set of API, i.e. the Annotation APIs. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r131885935 ## File path: api/src/org/apache/cloudstack/api/BaseCmd.java ## @@ -192,6 +191,8 @@ public AlertService _alertSvc; @Inject public UUIDManager _uuidMgr; +@Inject +public AnnotationService annotationService; Review comment: addressed with the a contains method on the Enum and precondition, @rhtyd This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r134981342 ## File path: api/src/org/apache/cloudstack/api/command/admin/annotation/AddAnnotationCmd.java ## @@ -0,0 +1,83 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.command.admin.annotation; + +import com.cloud.exception.ConcurrentOperationException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.NetworkRuleConflictException; +import com.cloud.exception.ResourceAllocationException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.user.Account; +import com.google.common.base.Preconditions; +import org.apache.cloudstack.annotation.AnnotationService; +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.BaseCmd; +import org.apache.cloudstack.api.Parameter; +import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.response.AnnotationResponse; + +/** + * @since 4.11 + */ +@APICommand(name = AddAnnotationCmd.APINAME, description = "add an annotation.", responseObject = AnnotationResponse.class, +requestHasSensitiveInfo = false, responseHasSensitiveInfo = false) +public class AddAnnotationCmd extends BaseCmd{ + +@Parameter(name = ApiConstants.ANNOTATION, type = CommandType.STRING, description = "the annotation text") +private String annotation; +@Parameter(name = ApiConstants.ENTITY_TYPE, type = CommandType.STRING, description = "the entity type") +private String entityType; +@Parameter(name = ApiConstants.ENTITY_ID, type = CommandType.STRING, description = "the id of the entity to annotate") +private String entityUuid; + +public String getAnnotation() { +return annotation; +} + +public AnnotationService.EntityType getEntityType() { +return AnnotationService.EntityType.valueOf(entityType); Review comment: addressed with the a contains method on the Enum and precondition, This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r131885935 ## File path: api/src/org/apache/cloudstack/api/BaseCmd.java ## @@ -192,6 +191,8 @@ public AlertService _alertSvc; @Inject public UUIDManager _uuidMgr; +@Inject +public AnnotationService annotationService; Review comment: addressed with the a contains method on the Enum and precondition, @rhtyd This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r131103831 ## File path: api/src/org/apache/cloudstack/api/command/admin/annotation/AddAnnotationCmd.java ## @@ -0,0 +1,81 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.command.admin.annotation; + +import com.cloud.exception.ConcurrentOperationException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.NetworkRuleConflictException; +import com.cloud.exception.ResourceAllocationException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.user.Account; +import com.google.common.base.Preconditions; +import org.apache.cloudstack.acl.RoleType; +import org.apache.cloudstack.annotation.AnnotationService; +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.BaseCmd; +import org.apache.cloudstack.api.Parameter; +import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.response.AnnotationResponse; + +@APICommand(name = AddAnnotationCmd.APINAME, description = "add an annotation.", responseObject = AnnotationResponse.class, +requestHasSensitiveInfo = false, responseHasSensitiveInfo = false, since = "4.11", authorized = {RoleType.Admin}) Review comment: We might want to expand certainly for loadbalancers and maybe zones/pods/clusters. Not sure about VMs, yet. @PaulAngus has ideas on that as well This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r130289673 ## File path: ui/l10n/en.js ## @@ -425,6 +425,8 @@ var dictionary = {"ICMP.code":"ICMP Code", "label.allocated":"Allocated", "label.allocation.state":"Allocation State", "label.allow":"Allow", +"label.annotated.by":"Annotator", +"label.annotation":"Annotation", Review comment: I do not see the gain in the rename. The word 'annotation' has connotations but so does 'comment'. Both are equally bad, IMHO. This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r130288672 ## File path: engine/schema/src/org/apache/cloudstack/annotation/dao/AnnotationDaoImpl.java ## @@ -0,0 +1,61 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.annotation.dao; + +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import org.apache.cloudstack.annotation.AnnotationVO; +import org.springframework.stereotype.Component; + +import javax.ejb.Local; +import java.util.List; + +/** + * @since 4.1 + */ +@Component +@Local(value = {AnnotationDao.class}) Review comment: ok This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r130288672 ## File path: engine/schema/src/org/apache/cloudstack/annotation/dao/AnnotationDaoImpl.java ## @@ -0,0 +1,61 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.annotation.dao; + +import com.cloud.utils.db.GenericDaoBase; +import com.cloud.utils.db.SearchBuilder; +import com.cloud.utils.db.SearchCriteria; +import org.apache.cloudstack.annotation.AnnotationVO; +import org.springframework.stereotype.Component; + +import javax.ejb.Local; +import java.util.List; + +/** + * @since 4.1 + */ +@Component +@Local(value = {AnnotationDao.class}) Review comment: ok This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r130288602 ## File path: engine/schema/src/org/apache/cloudstack/annotation/AnnotationVO.java ## @@ -0,0 +1,154 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.annotation; + +import com.cloud.utils.db.GenericDao; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Table; +import java.util.Date; +import java.util.UUID; + +/** + * @since 4.11 Review comment: no reason to This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r130288626 ## File path: engine/schema/src/org/apache/cloudstack/annotation/dao/AnnotationDao.java ## @@ -0,0 +1,30 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.annotation.dao; + +import org.apache.cloudstack.annotation.AnnotationVO; +import com.cloud.utils.db.GenericDao; + +import java.util.List; + +/** Review comment: no reason to This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r130288592 ## File path: api/src/org/apache/cloudstack/api/response/AnnotationResponse.java ## @@ -0,0 +1,121 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.response; + +import com.cloud.serializer.Param; +import com.google.gson.annotations.SerializedName; +import org.apache.cloudstack.annotation.Annotation; +import org.apache.cloudstack.annotation.AnnotationService; +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.BaseResponse; +import org.apache.cloudstack.api.EntityReference; + +import java.util.Date; + +/** + * @since 4.11 Review comment: no reason to This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r130286305 ## File path: server/src/org/apache/cloudstack/annotation/AnnotationManagerImpl.java ## @@ -0,0 +1,145 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.annotation; + +import com.cloud.utils.component.ManagerBase; +import com.cloud.utils.component.PluggableService; +import org.apache.cloudstack.annotation.dao.AnnotationDao; +import org.apache.cloudstack.api.command.admin.annotation.AddAnnotationCmd; +import org.apache.cloudstack.api.command.admin.annotation.ListAnnotationsCmd; +import org.apache.cloudstack.api.command.admin.annotation.RemoveAnnotationCmd; +import org.apache.cloudstack.api.response.AnnotationResponse; +import org.apache.cloudstack.api.response.ListResponse; +import org.apache.cloudstack.context.CallContext; +import org.apache.log4j.Logger; + +import javax.inject.Inject; +import java.util.ArrayList; +import java.util.List; + +/** + * @since 4.11 + */ +public final class AnnotationManagerImpl extends ManagerBase implements AnnotationService, PluggableService { +public static final Logger s_logger = Logger.getLogger(AnnotationManagerImpl.class); Review comment: sure This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r130286152 ## File path: tools/apidoc/gen_toc.py ## @@ -171,6 +171,9 @@ 'StratosphereSsp' : ' Stratosphere SSP', 'Metrics' : 'Metrics', 'Infrastructure' : 'Metrics', +'listAnnotations' : 'Annotations', Review comment: will do This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r130285662 ## File path: api/src/org/apache/cloudstack/api/command/admin/annotation/AddAnnotationCmd.java ## @@ -0,0 +1,83 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. +package org.apache.cloudstack.api.command.admin.annotation; + +import com.cloud.exception.ConcurrentOperationException; +import com.cloud.exception.InsufficientCapacityException; +import com.cloud.exception.NetworkRuleConflictException; +import com.cloud.exception.ResourceAllocationException; +import com.cloud.exception.ResourceUnavailableException; +import com.cloud.user.Account; +import com.google.common.base.Preconditions; +import org.apache.cloudstack.annotation.AnnotationService; +import org.apache.cloudstack.api.APICommand; +import org.apache.cloudstack.api.ApiConstants; +import org.apache.cloudstack.api.BaseCmd; +import org.apache.cloudstack.api.Parameter; +import org.apache.cloudstack.api.ServerApiException; +import org.apache.cloudstack.api.response.AnnotationResponse; + +/** + * @since 4.11 + */ +@APICommand(name = AddAnnotationCmd.APINAME, description = "add an annotation.", responseObject = AnnotationResponse.class, Review comment: makes sense This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services
[GitHub] DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations
DaanHoogland commented on a change in pull request #2181: CLOUDSTACK-9957 Annotations URL: https://github.com/apache/cloudstack/pull/2181#discussion_r130285644 ## File path: api/src/org/apache/cloudstack/api/BaseCmd.java ## @@ -192,6 +191,8 @@ public AlertService _alertSvc; @Inject public UUIDManager _uuidMgr; +@Inject +public AnnotationService annotationService; Review comment: this is not the usual pattern on API classes. I am adhering to the general practice in this case This is an automated message from the Apache Git Service. To respond to the message, please log on GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services