risc.main
Define the RISC primary module.
RISC
RISC(self, api_token: str = '', user_id: str = '', password: str = '')
Define the RISC toplevel class.
build_auth
RISC.build_auth()
Build the API authentication token.
get_assessments
RISC.get_assessments()
Get the RISC assessment code.
Returns: str: The RISC assessment code.
get_assessment
RISC.get_assessment(**kwargs)
Get the RISC assessment code.
Returns: str: The RISC assessment code.
get_auth_token
RISC.get_auth_token()
Authenticate with RISC.
Returns: str: The final authentication token to be used with subsequent requests.
assets_get_summary
RISC.assets_get_summary()
Use to retrieve a list of device types and counts.
assets_get_assets
RISC.assets_get_assets(device_type: str = '',
stack_id: int = 0,
device_id: str = '',
tag_id: str = '',
page: int = 0)
Use to retrieve a list of device types and counts.
stacks_get_summary
RISC.stacks_get_summary()
Use to retrieve a list of stacks.
stacks_get_summary_cost
RISC.stacks_get_summary_cost(provider_id: str)
Use to retrieve a list of stack costs.
stacks_get_connectivity
RISC.stacks_get_connectivity(stack_id: str = '')
Use to retrieve a list of connected stacks.
stacks_get_device_connectivity
RISC.stacks_get_device_connectivity(stack_id: int,
connectivity_type: str = 'internal',
page: int = 0)
Use to retrieve a list of connected stacks.
iaas_get_providers
RISC.iaas_get_providers()
Use to retrieve a list of IaaS providers.
iaas_pricing
RISC.iaas_pricing(payload: typing.Dict[str, str])
Use to retrieve a list of IaaS pricing.
tags_get_tags
RISC.tags_get_tags(payload: typing.Dict[str, str])
Use to retrieve a list of IaaS providers.
tags_add_tags
RISC.tags_add_tags(payload: typing.Dict[str, str])
Use to retrieve a list of IaaS providers.
assets_search
RISC.assets_search(search: str = '')
Get RISC assessment data.
ucel_get_checks
RISC.ucel_get_checks(device_id: str = '')
Use to retrieve a list of checks that have been run against devices.
ucel_get_assets
RISC.ucel_get_assets(check_id: str = '')
Use to retrieve data on the device(s) by check.
ucel_get_assets_paginated
RISC.ucel_get_assets_paginated(check_id: str = '', page: int = 1)
Use to retrieve data on the device(s) by check.
stacks_get_listeners
RISC.stacks_get_listeners(stack_id: int)
Use to retrieve a list of listeners in a stack.
get_swagger
RISC.get_swagger()
Fetch the swagger API configuration file.
get_server
RISC.get_server(search: str = '', compare: str = 'hostname')
Sift through the asset search response and only return the relevant host.
Args: search (str): The value to search for against the assets search API endpoint. compare (str): The key to be used to match the provided search value with. For example, this can be changed from hostname to identifying_ip. Defaults to: hostname.
Returns: dict: The device asset object, as returned from the RISC API.
get_application_ips
RISC.get_application_ips(application: str,
identifying_ips_only: bool = True)
Get all associated IP addresses for the provided application stack.
Args: application (str): The application stack name, as identified in RISC. identifying_ips_only (bool): Whether or not to return only the identifying_ip value for each asset found within the application stack. If set to: False, this method will iterate through all ips in the device data object. Defaults to: True.
Returns: list of str: The list of device IP addresses present in the application stack.
get_disks
RISC.get_disks(search: str,
fudge_factor: float = 1.5,
only_local_disks: bool = True)
Get disk data for a specific asset.
Args: search (str): The asset hostname to lookup. fudge_factor (float): The value multiplier to be used when calculating volume size to be returned. This can be used to estimate a buffer over current device usage. Defaults to: 1.0 to represent the existing disk usage. only_local_disks (bool): Whether or not to reduce the response to include only local disks. Defaults to: True.
Returns: dict: The mapping of disk data provided by RISC and additional drive usage data.
main
main()
Define the main entry method for the CLI.