AssistedInstall
Actively maintained. Last release 5 days ago, commits in 26 of the last 26 weeks. A safe choice.
$
pip install assisted-service-clientassisted-service-client
Assisted installation
This Python package is automatically generated by the Swagger Codegen project:
- API version: 1.0.0
- Package version: 1.0.0
- Build package: io.swagger.codegen.languages.PythonClientCodegen
Requirements.
Python 2.7 and 3.4+
Installation & Usage
pip install
If the python package is hosted on Github, you can install directly from Github
pip install assisted-service-client
(you may need to run pip with root permission: sudo pip install assisted-service-client)
Then import the package:
import assisted_service_client
Setuptools
Install via Setuptools.
python setup.py install --user
(or sudo python setup.py install to install the package for all users)
Then import the package:
import assisted_service_client
Getting Started
Please follow the installation procedure and then run the following:
from __future__ import print_function
import time
import assisted_service_client
from assisted_service_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: urlAuth
configuration = assisted_service_client.Configuration()
configuration.api_key['api_key'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['api_key'] = 'Bearer'
# Configure API key authorization: userAuth
configuration = assisted_service_client.Configuration()
configuration.api_key['Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Authorization'] = 'Bearer'
# Configure API key authorization: watcherAuth
configuration = assisted_service_client.Configuration()
configuration.api_key['Watcher-Authorization'] = 'YOUR_API_KEY'
# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
# configuration.api_key_prefix['Watcher-Authorization'] = 'Bearer'
# create an instance of the API class
api_instance = assisted_service_client.EventsApi(assisted_service_client.ApiClient(configuration))
cluster_id = 'cluster_id_example' # str | The cluster to return events for. (optional)
host_id = 'host_id_example' # str | A host in the specified cluster to return events for (DEPRECATED. Use `host_ids` instead). (optional)
host_ids = ['host_ids_example'] # list[str] | Hosts in the specified cluster to return events for. (optional)
infra_env_id = 'infra_env_id_example' # str | The infra-env to return events for. (optional)
limit = 56 # int | The maximum number of records to retrieve. (optional)
offset = 56 # int | Number of records to skip before starting to return the records. (optional)
order = 'ascending' # str | Order by event_time of events retrieved. (optional) (default to ascending)
severities = ['severities_example'] # list[str] | Retrieved events severities. (optional)
message = 'message_example' # str | Retrieved events message pattern. (optional)
deleted_hosts = true # bool | Deleted hosts flag. (optional)
cluster_level = true # bool | Cluster level events flag. (optional)
categories = ['categories_example'] # list[str] | A comma-separated list of event categories. (optional)
try:
api_response = api_instance.v2_list_events(cluster_id=cluster_id, host_id=host_id, host_ids=host_ids, infra_env_id=infra_env_id, limit=limit, offset=offset, order=order, severities=severities, message=message, deleted_hosts=deleted_hosts, cluster_level=cluster_level, categories=categories)
pprint(api_response)
except ApiException as e:
print("Exception when calling EventsApi->v2_list_events: %s
" % e)