bc6575fdf92df5283d905c41d1144fd6ea06314c
[holmes/common.git] / holmes-actions / src / main / java / org / onap / holmes / common / aai / config / AaiConfig.java
1 /**
2  * Copyright 2017 - 2021 ZTE Corporation.
3  * <p>
4  * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
5  * in compliance with the License. You may obtain a copy of the License at
6  * <p>
7  * http://www.apache.org/licenses/LICENSE-2.0
8  * <p>
9  * Unless required by applicable law or agreed to in writing, software distributed under the License
10  * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
11  * or implied. See the License for the specific language governing permissions and limitations under
12  * the License.
13  */
14 package org.onap.holmes.common.aai.config;
15
16 public class AaiConfig {
17
18     private static final String AAI_API_VERSION = "v19";
19
20     public static final String X_TRANSACTION_ID = "9999";
21
22     public static final String X_FROMAPP_ID = "jimmy-postman";
23
24     private static final String AAI_AUTHENTICATION_USER = "AAI";
25
26     private static final String AAI_AUTHENTICATION_PWD = "AAI";
27
28     private static final String AAI_PNF_URL_SUF = "/network/pnfs/pnf/{pnfName}/p-interfaces/p-interface/nodeId-{pnfName}-ltpId-{ifName}";
29
30     private AaiConfig() {
31
32     }
33
34     public static String getAuthenticationCredentials() {
35         String userCredentials = AAI_AUTHENTICATION_USER + ":"
36                 + AAI_AUTHENTICATION_PWD;
37         return "Basic " + java.util.Base64.getEncoder().encodeToString(userCredentials.getBytes());
38     }
39
40     public static class AaiConsts {
41
42         private AaiConsts() {
43
44         }
45
46         private static final String AAI_PREF = "/aai/";
47
48         public static final String AAI_VNF_ADDR = AAI_PREF + "v11/network/generic-vnfs/generic-vnf";
49
50         public static final String AAI_TP_UPDATE = AAI_PREF + AAI_API_VERSION + AAI_PNF_URL_SUF;
51
52         public static final String AAI_LINK_QUERY = AAI_PREF + AAI_API_VERSION + AAI_PNF_URL_SUF;
53
54         public static final String AAI_LINK_UPDATE = AAI_PREF + AAI_API_VERSION + "/network/logical-links/logical-link/{linkName}";
55
56         public static final String AAI_TP_ADDR = AAI_PREF + AAI_API_VERSION + "/network/pnfs/pnf/{node-Id}/p-interfaces/p-interface/{tp-id}";
57
58         public static final String AAI_VPN_ADDR = AAI_PREF + AAI_API_VERSION + AAI_PNF_URL_SUF;
59
60         public static final String AAI_CONN_ADDR = AAI_PREF + AAI_API_VERSION + "/network/vpn-bindings/vpn-binding/{vpnId}";
61
62         public static final String AAI_SERVICE_INSTANCE_ADDR_4_CCVPN = AAI_PREF + AAI_API_VERSION + "/network/connectivities/connectivity/{connectivityId}";
63
64         public static final String AAI_SERVICE_INSTANCES_ADDR_4_CCVPN = AAI_PREF + AAI_API_VERSION + "/business/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}";
65
66         public static final String AAI_VM_ADDR = AAI_PREF + "v11/search/nodes-query?search-node-type=vserver&filter=";
67
68         public static final String AAI_SERVICE = AAI_SERVICE_INSTANCES_ADDR_4_CCVPN + "/service-instances/service-instance/{instance-id}";
69
70         public static final String AAI_PNF = AAI_PREF + AAI_API_VERSION + "/network/pnfs/pnf/{pnfName}";
71
72         public static final String AAI_PNF_VALUE = AAI_PNF + "?depth=all";
73
74         public static final String AAI_PNF_ID = AAI_PREF + AAI_API_VERSION + "/network/pnfs?pnf-id={pnfId}";
75     }
76
77
78     public static class MsbConsts {
79
80         private MsbConsts() {
81
82         }
83
84         private static final String AAI_MSB_PREF = "/api";
85
86         private static final String AAI_NETWORK = "/aai-network/";
87
88         private static final String AAI_BUSINESS = "/aai-business/";
89
90         private static final String AAI_SEARCH = "/aai-search/";
91
92         public static final String AAI_VNF_ADDR = AAI_NETWORK + AAI_API_VERSION + "/generic-vnfs/generic-vnf";
93
94         public static final String AAI_TP_UPDATE = AAI_NETWORK + AAI_API_VERSION + AAI_PNF_URL_SUF;
95
96         public static final String AAI_LINK_QUERY = AAI_NETWORK + AAI_API_VERSION + AAI_PNF_URL_SUF;
97
98         public static final String AAI_LINK_UPDATE = AAI_NETWORK + AAI_API_VERSION + "/network/logical-links/logical-link/{linkName}";
99
100         public static final String AAI_TP_ADDR = AAI_NETWORK + AAI_API_VERSION + "/pnfs/pnf/{node-Id}/p-interfaces/p-interface/{tp-id}";
101
102         public static final String AAI_VPN_ADDR = AAI_NETWORK + AAI_API_VERSION + AAI_PNF_URL_SUF;
103
104         public static final String AAI_CONN_ADDR = AAI_NETWORK + AAI_API_VERSION + "/network/vpn-bindings/vpn-binding/{vpnId}";
105
106         public static final String AAI_SERVICE_INSTANCE_ADDR_4_CCVPN = AAI_NETWORK + AAI_API_VERSION + "/network/connectivities/connectivity/{connectivityId}";
107
108         public static final String AAI_SERVICE_INSTANCES_ADDR_4_CCVPN = AAI_BUSINESS + AAI_API_VERSION + "/customers/customer/{global-customer-id}/service-subscriptions/service-subscription/{service-type}";
109
110         public static final String AAI_VM_ADDR = AAI_SEARCH + AAI_API_VERSION + "/nodes-query?search-node-type=vserver&filter=";
111
112         public static final String AAI_SITE_RESOURCES_QUERY = AAI_MSB_PREF + AAI_NETWORK + AAI_API_VERSION +
113                 "/site-resources";
114
115         public static final String AAI_SITE_VNF_QUERY = AAI_MSB_PREF + AAI_NETWORK + AAI_API_VERSION +
116                 "/generic-vnfs/generic-vnf/{vnfId}";
117     }
118 }