1 package org.apache.archiva.rest.api.services;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import io.swagger.v3.oas.annotations.tags.Tag;
23 import org.apache.archiva.maven2.model.Artifact;
24 import org.apache.archiva.redback.authorization.RedbackAuthorization;
25 import org.apache.archiva.repository.scanner.RepositoryScanStatistics;
26 import org.apache.archiva.rest.api.model.ArtifactTransferRequest;
27 import org.apache.archiva.rest.api.model.StringList;
28 import org.apache.archiva.security.common.ArchivaRoleConstants;
30 import javax.ws.rs.Consumes;
31 import javax.ws.rs.DELETE;
32 import javax.ws.rs.GET;
33 import javax.ws.rs.POST;
34 import javax.ws.rs.Path;
35 import javax.ws.rs.PathParam;
36 import javax.ws.rs.Produces;
37 import javax.ws.rs.QueryParam;
38 import javax.ws.rs.core.MediaType;
41 * @author Olivier Lamy
44 @Path ("/repositoriesService/")
45 @Tag( name="Repositories", description = "Managing repositories")
46 public interface RepositoriesService
52 @Path ("scanRepository")
54 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
55 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
56 Boolean scanRepository( @QueryParam ("repositoryId") String repositoryId,
57 @QueryParam ("fullScan") boolean fullScan )
58 throws ArchivaRestServiceException;
65 @Path ("scanRepositoryDirectoriesNow/{repositoryId}")
67 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
68 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
69 RepositoryScanStatistics scanRepositoryDirectoriesNow( @PathParam ("repositoryId") String repositoryId )
70 throws ArchivaRestServiceException;
73 @Path ("alreadyScanning/{repositoryId}")
75 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
76 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
77 Boolean alreadyScanning( @PathParam ("repositoryId") String repositoryId )
78 throws ArchivaRestServiceException;
80 @Path ("removeScanningTaskFromQueue/{repositoryId}")
82 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
83 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
84 Boolean removeScanningTaskFromQueue( @PathParam ("repositoryId") String repositoryId )
85 throws ArchivaRestServiceException;
87 @Path ("scanRepositoryNow")
89 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
90 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
91 Boolean scanRepositoryNow( @QueryParam ("repositoryId") String repositoryId,
92 @QueryParam ("fullScan") boolean fullScan )
93 throws ArchivaRestServiceException;
96 * permissions are checked in impl
97 * will copy an artifact from the source repository to the target repository
99 @Path ("copyArtifact")
101 @Consumes ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
102 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
103 @RedbackAuthorization (noPermission = true)
104 Boolean copyArtifact( ArtifactTransferRequest artifactTransferRequest )
105 throws ArchivaRestServiceException;
107 @Path ("scheduleDownloadRemoteIndex")
109 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
110 @RedbackAuthorization (permissions = ArchivaRoleConstants.OPERATION_RUN_INDEXER)
111 Boolean scheduleDownloadRemoteIndex( @QueryParam ("repositoryId") String repositoryId,
112 @QueryParam ("now") boolean now,
113 @QueryParam ("fullDownload") boolean fullDownload )
114 throws ArchivaRestServiceException;
118 * <b>permissions are checked in impl</b>
121 @Path ("deleteArtifact")
123 @Consumes ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
124 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
125 @RedbackAuthorization (noPermission = true)
126 Boolean deleteArtifact( Artifact artifact )
127 throws ArchivaRestServiceException;
130 * <b>permissions are checked in impl</b>
133 @Path ("projectVersion/{repositoryId}/{namespace}/{projectId}/{version}")
135 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
136 @RedbackAuthorization (noPermission = true)
137 Boolean removeProjectVersion( @PathParam ( "repositoryId" ) String repositoryId,
138 @PathParam ( "namespace" ) String namespace, @PathParam ( "projectId" ) String projectId,
139 @PathParam ( "version" ) String version )
140 throws ArchivaRestServiceException;
142 @Path ("isAuthorizedToDeleteArtifacts/{repositoryId}")
144 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
145 @RedbackAuthorization (noPermission = true, noRestriction = true)
146 Boolean isAuthorizedToDeleteArtifacts( @PathParam ("repositoryId") String repoId )
147 throws ArchivaRestServiceException;
150 * <b>permissions are checked in impl</b>
153 @Path ("deleteGroupId")
155 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
156 @RedbackAuthorization (noPermission = true)
157 Boolean deleteGroupId( @QueryParam ("groupId") String groupId, @QueryParam ("repositoryId") String repositoryId )
158 throws ArchivaRestServiceException;
161 * <b>permissions are checked in impl</b>
164 @Path ("project/{repositoryId}/{groupId}/{projectId}")
166 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
167 @RedbackAuthorization (noPermission = true)
168 Boolean deleteProject( @PathParam ("groupId") String groupId, @PathParam ("projectId") String projectId,
169 @PathParam ("repositoryId") String repositoryId )
170 throws ArchivaRestServiceException;
175 @Path ("runningRemoteDownloadIds")
177 @Produces ({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML, MediaType.TEXT_PLAIN })
178 @RedbackAuthorization (noPermission = true)
179 StringList getRunningRemoteDownloadIds();