mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
35 lines
806 B
Python
35 lines
806 B
Python
'''
|
|
CLI entry-point for salt-api
|
|
'''
|
|
# Import salt libs
|
|
from salt.utils.parsers import (
|
|
ConfigDirMixIn,
|
|
LogLevelMixIn,
|
|
OptionParser,
|
|
OptionParserMeta)
|
|
|
|
# Import salt-api libs
|
|
import saltapi.client
|
|
import saltapi.config
|
|
import saltapi.version
|
|
|
|
class SaltAPI(OptionParser, ConfigDirMixIn, LogLevelMixIn):
|
|
'''
|
|
The cli parser object used to fire up the salt api system.
|
|
'''
|
|
__metaclass__ = OptionParserMeta
|
|
|
|
VERSION = saltapi.version.__version__
|
|
|
|
def setup_config(self):
|
|
return saltapi.config.api_config(self.get_config_file_path('master'))
|
|
|
|
def run(self):
|
|
'''
|
|
Run the api
|
|
'''
|
|
self.parse_args()
|
|
self.process_config_dir()
|
|
client = saltapi.client.SaltAPIClient(self.config)
|
|
client.run()
|