blob: 781b0c96fab12379c8efcf2d1e15d84e9ec74df4 [file] [log] [blame]
Jian Liff8b9f92018-06-05 17:36:37 +09001/*
2 * Copyright 2018-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.openstacktelemetry.api.config;
17
18import java.util.Map;
19
20/**
21 * Configuration API of REST for publishing openstack telemetry.
22 */
Jian Li69600e02018-12-24 13:21:18 +090023public interface RestTelemetryConfig extends TelemetryConfigProperties {
Jian Liff8b9f92018-06-05 17:36:37 +090024
25 /**
26 * Obtains REST IP address.
27 *
28 * @return REST IP address
29 */
30 String address();
31
32 /**
33 * Obtains REST port number.
34 *
35 * @return REST port number
36 */
37 int port();
38
39 /**
40 * Obtains default REST server endpoint.
41 *
42 * @return default REST server endpoint
43 */
44 String endpoint();
45
46 /**
47 * Obtains HTTP method for publishing network metrics.
48 *
49 * @return HTTP method
50 */
51 String method();
52
53 /**
54 * Obtains request media type.
55 *
56 * @return request media type
57 */
58 String requestMediaType();
59
60 /**
61 * Obtains response media type.
62 *
63 * @return response media type
64 */
65 String responseMediaType();
66
67 /**
68 * Obtains REST config maps.
69 *
70 * @return REST config map
71 */
72 Map<String, Object> configMap();
73
74 /**
75 * Builder class for RestTelemetryConfig.
76 */
Jian Li69600e02018-12-24 13:21:18 +090077 interface Builder extends TelemetryConfigProperties.Builder {
Jian Liff8b9f92018-06-05 17:36:37 +090078
79 /**
80 * Sets REST server IP address.
81 *
82 * @param address REST server IP address
83 * @return builder instance
84 */
85 Builder withAddress(String address);
86
87 /**
88 * Sets REST server port number.
89 *
90 * @param port REST server port number
91 * @return builder instance
92 */
93 Builder withPort(int port);
94
95 /**
96 * Sets REST server default endpoint.
97 *
98 * @param endpoint REST server default endpoint
99 * @return builder instance
100 */
101 Builder withEndpoint(String endpoint);
102
103 /**
104 * Sets HTTP method.
105 *
106 * @param method HTTP method
107 * @return builder instance
108 */
109 Builder withMethod(String method);
110
111 /**
112 * Sets REST request media type.
113 *
114 * @param mediaType REST request media type
115 * @return builder instance
116 */
117 Builder withRequestMediaType(String mediaType);
118
119 /**
120 * Sets REST response media type.
121 *
122 * @param mediaType REST response media type
123 * @return builder instance
124 */
125 Builder withResponseMediaType(String mediaType);
126
127 /**
128 * Sets REST config map.
129 *
130 * @param configMap REST config map
131 * @return builder instance
132 */
133 Builder withConfigMap(Map<String, Object> configMap);
134
135 /**
136 * Creates a REST telemetry config instance.
137 *
138 * @return REST telemetry config instance
139 */
140 RestTelemetryConfig build();
141 }
Jian Li69600e02018-12-24 13:21:18 +0900142}