Scott Baker | bba67b6 | 2019-01-28 17:38:21 -0800 | [diff] [blame] | 1 | # Copyright 2017-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | |
| 16 | class PullStep(object): |
| 17 | """ |
| 18 | All the pull steps defined in each synchronizer needs to inherit from this class in order to be loaded |
| 19 | """ |
| 20 | |
| 21 | def __init__(self, **kwargs): |
| 22 | """ |
| 23 | Initialize a pull step |
| 24 | :param kwargs: |
| 25 | -- observed_model: name of the model that is being polled |
Scott Baker | c2fddaa | 2019-01-30 15:45:03 -0800 | [diff] [blame] | 26 | -- model_accessor: used to create and update models |
Scott Baker | bba67b6 | 2019-01-28 17:38:21 -0800 | [diff] [blame] | 27 | """ |
| 28 | self.observed_model = kwargs.get("observed_model") |
Scott Baker | c2fddaa | 2019-01-30 15:45:03 -0800 | [diff] [blame] | 29 | self.model_accessor = kwargs.get("model_accessor") |
Scott Baker | bba67b6 | 2019-01-28 17:38:21 -0800 | [diff] [blame] | 30 | |
| 31 | def pull_records(self): |
| 32 | self.log.debug( |
| 33 | "There is no default pull_records, please provide a pull_records method for %s" |
| 34 | % self.observed_model |
| 35 | ) |