* ============LICENSE_START=======================================================
* Copyright (C) 2020 Nordix Foundation
* Modifications Copyright (C) 2020 Bell Canada. All rights reserved.
+ * Modifications Copyright (C) 2021 Pantheon.tech
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
@RestController
+@RequestMapping("${rest.api.cps-base-path}")
public class AdminRestController implements CpsAdminApi {
@Autowired
return new ResponseEntity<>(dataspaceName, HttpStatus.CREATED);
}
+ @Override
+ public ResponseEntity<Object> deleteDataspace(final String dataspaceName) {
+ return new ResponseEntity<>(HttpStatus.NOT_IMPLEMENTED);
+ }
+
@Override
public ResponseEntity<String> createSchemaSet(final MultipartFile multipartFile,
final String schemaSetName, final String dataspaceName) {
}
@Override
- public ResponseEntity<Object> deleteAnchor(final String dataspaceName, final String anchorName) {
- return null;
- }
-
- @Override
- public ResponseEntity<Object> deleteDataspace(final String dataspaceName) {
- return null;
+ public ResponseEntity<Void> deleteAnchor(final String dataspaceName, final String anchorName) {
+ cpsAdminService.deleteAnchor(dataspaceName, anchorName);
+ return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Override
public ResponseEntity<Object> getAnchor(final String dataspaceName, final String anchorName) {
- return null;
+ final Anchor anchor = cpsAdminService.getAnchor(dataspaceName, anchorName);
+ return new ResponseEntity<>(anchor, HttpStatus.OK);
}
@Override