2 * ============LICENSE_START=======================================================
3 * Copyright (C) 2019 Nordix Foundation.
4 * ================================================================================
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
9 * http://www.apache.org/licenses/LICENSE-2.0
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
17 * SPDX-License-Identifier: Apache-2.0
18 * ============LICENSE_END=========================================================
21 package org.onap.so.adapters.vnfmadapter.extclients.etsicatalog;
23 import static org.slf4j.LoggerFactory.getLogger;
24 import org.slf4j.Logger;
25 import org.springframework.beans.factory.annotation.Value;
26 import org.springframework.stereotype.Service;
29 * Provides the URLs for the REST Requests to the ETSI Catalog Manager.
31 * @author gareth.roper@est.tech
34 public class EtsiCatalogUrlProvider {
36 private static final Logger logger = getLogger(EtsiCatalogUrlProvider.class);
38 @Value("${etsi-catalog-manager.vnfpkgm.endpoint}")
39 private String etsiCatalogManagerEndpoint;
41 public EtsiCatalogUrlProvider() {}
44 * Get the URL for retrieving the Package Content from the ETSI Catalog.".
46 * @param vnfPkgId The ID of the VNF Package
47 * @return the URL for the GET operation
49 public String getVnfPackageContentUrl(final String vnfPkgId) {
50 final String url = etsiCatalogManagerEndpoint + "/vnf_packages/" + vnfPkgId + "/package_content";
51 logger.info("getEtsiCatalogVnfPackageContentUrl: {}", url);
56 * Get the URL for retrieving VNF packages information from ETSI Catalog.".
58 * @return the URL for the GET operation
60 public String getVnfPackagesUrl() {
61 final String url = etsiCatalogManagerEndpoint + "/vnf_packages";
62 logger.info("getEtsiCatalogVnfPackagesEndpoint: {}", url);
67 * Get the URL for retrieving specific VNF package information from the ETSI Catalog.".
69 * @param vnfPkgId The ID of the VNF Package
70 * @return the URL for the GET operation
72 public String getVnfPackageUrl(final String vnfPkgId) {
73 final String url = etsiCatalogManagerEndpoint + "/vnf_packages/" + vnfPkgId;
74 logger.info("getEtsiCatalogVnfPackageEndpoint: {}", url);
79 * Get the URL for retrieving VNF Package Artifacts
81 * @param vnfPkgId The ID of the VNF Package
82 * @param artifactPath The path to the Artifact
83 * @return the URL for the GET operation
85 public String getVnfPackageArtifactUrl(final String vnfPkgId, final String artifactPath) {
86 final String url = etsiCatalogManagerEndpoint + "/vnf_packages/" + vnfPkgId + "/artifacts/" + artifactPath;
87 logger.info("getVnfPackageArtifactUrl: {}", url);
92 * Get the URL for retrieving VNF packages vnfd from ETSI Catalog.
94 * @param vnfPkgId The ID of the VNF Package
95 * @return the URL for the GET operation
97 public String getVnfPackageVnfdUrl(final String vnfPkgId) {
98 final String url = etsiCatalogManagerEndpoint + "/vnf_packages/" + vnfPkgId + "/vnfd";
99 logger.info("getEtsiCatalogVnfPackageVnfd: {}", url);
104 * Get the URL for posting/retrieving a Subscription
106 * @return the URL for the operation
108 public String getSubscriptionUrl() {
109 final String url = etsiCatalogManagerEndpoint + "/subscriptions";
110 logger.info("getSubscriptionNotificationUrl: {}", url);