Jian Li | c704b67 | 2018-09-04 18:52:53 +0900 | [diff] [blame] | 1 | /* |
| 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 | */ |
| 16 | |
| 17 | package org.onosproject.openstacknode.api; |
| 18 | |
| 19 | /** |
| 20 | * Representation of openstack neutron config information. |
| 21 | */ |
| 22 | public interface NeutronConfig { |
| 23 | |
| 24 | /** |
| 25 | * Returns whether to use metadata proxy service. |
| 26 | * Note that SONA will behave as a metadata proxy server |
| 27 | * |
| 28 | * @return true if metadata proxy service is enabled, false otherwise |
| 29 | */ |
| 30 | boolean useMetadataProxy(); |
| 31 | |
| 32 | /** |
| 33 | * Returns metadata proxy secret. |
| 34 | * |
| 35 | * @return metadata proxy secret |
| 36 | */ |
| 37 | String metadataProxySecret(); |
| 38 | |
| 39 | /** |
Jian Li | 92b6f29 | 2018-09-06 10:57:18 +0900 | [diff] [blame^] | 40 | * Returns NOVA metadata IP address. |
| 41 | * |
| 42 | * @return NOVA metadata IP address |
| 43 | */ |
| 44 | String novaMetadataIp(); |
| 45 | |
| 46 | /** |
| 47 | * Returns NOVA metadata port number. |
| 48 | * |
| 49 | * @return NOVA metadata port number |
| 50 | */ |
| 51 | Integer novaMetadataPort(); |
| 52 | |
| 53 | /** |
Jian Li | c704b67 | 2018-09-04 18:52:53 +0900 | [diff] [blame] | 54 | * Builder of neutron config. |
| 55 | */ |
| 56 | interface Builder { |
| 57 | |
| 58 | /** |
| 59 | * Builds an immutable neutron config instance. |
| 60 | * |
| 61 | * @return neutron config instance |
| 62 | */ |
| 63 | NeutronConfig build(); |
| 64 | |
| 65 | /** |
| 66 | * Returns neutron config with supplied useMetadataProxy flag. |
| 67 | * |
| 68 | * @param useMetadataProxy useMetadataProxy flag |
| 69 | * @return neutron config builder |
| 70 | */ |
| 71 | Builder useMetadataProxy(boolean useMetadataProxy); |
| 72 | |
| 73 | /** |
| 74 | * Returns neutron config with supplied metadataProxySecret. |
| 75 | * |
| 76 | * @param metadataProxySecret metadata proxy secret |
| 77 | * @return neutron config builder |
| 78 | */ |
| 79 | Builder metadataProxySecret(String metadataProxySecret); |
Jian Li | 92b6f29 | 2018-09-06 10:57:18 +0900 | [diff] [blame^] | 80 | |
| 81 | /** |
| 82 | * Returns neutron config with supplied NOVA metadata IP address. |
| 83 | * |
| 84 | * @param novaMetadataIp NOVA metadata IP address |
| 85 | * @return neutron config builder |
| 86 | */ |
| 87 | Builder novaMetadataIp(String novaMetadataIp); |
| 88 | |
| 89 | /** |
| 90 | * Returns neutron config with supplied NOVA metadata port number. |
| 91 | * |
| 92 | * @param novaMetadataPort NOVA metadata port number |
| 93 | * @return neutron config builder |
| 94 | */ |
| 95 | Builder novaMetadataPort(Integer novaMetadataPort); |
Jian Li | c704b67 | 2018-09-04 18:52:53 +0900 | [diff] [blame] | 96 | } |
| 97 | } |