Class CaaSClient

This class is used to connect to the CloudFabrix's AIOps platform to fetch datasets.

This class is used to connect to the CloudFabrix's AIOps platform to fetch datasets.

Method Name

Description

get_tags()

Gets all the tags supported by the CloudFabrix platform

logout()

Logs out of the API session

setOrgContext(self, orgId)

Sets the context filter and takes Organization ID as the parameter. All requests will be against this context filter

refreshTags()

returns the list of tags by fetching again

incidents()

returns handle to the incidents dataset as CaaSDataset

alerts()

returns handle to the alerts dataset as CaaSDataset

assetInventory()

returns handle to the inventory dataset as CaaSDataset [tag: asset-db:assetLCMMaster]

assetNetworkConnectivity()

returns handle to the network connectivity dataset as CaaSDataset [tag: asset-db:all_cdp]

assetAppDependency()

returns handle to the application dependency dataset as CaaSDataset (tag: asset-db:adm-apps)

contracts()

returns handle to the contracts dataset as CaaSDataset (tag:asset-db:contracts)

assetContracts()

returns handle to the assets-contract mapping dataset(tag: asset-db:contracts_aia)

count()

takes tag, cfxql_query="*" as parameters and returns count matching the query

get_next_results(self, tag, query="*")

returns an iterator for fetching paginated data.

The parameters are:

tag:str - the tag associated with the dataset

cfxql_query - the cfx query to be used, default is all

service_url: str - the internal url of the service associated with the dataset sort:dict - the sort criteria to be used while fetching results assending:bool - if the results should be sorted asscending, default 'True'

max_rows: int - number of rows to fetch

disableErrors: book - if the errors should be displayed or not

get_tags()

returns all tags in the system

get_data(self, tag, cfxql_query="*", date_format=None,service_url=None, disableErrors=false)

generic method to get metadata. Returns dataframe: pd.DataFrame object. Various parameters are:

tag:str - the tag associated with the dataset.

cfxql_query:str - the cfxql query to be used, default is all.

sort:dict - the sort criteria to be used while fetching results

ascending: bool - if the results should be sorting ascending, default is 'True'.

max_rows: int -number of rows to fetch

disableErrors: bool - if the errors should be displayed or not

execute_cfxql(self, tag, cfxql_query, offset=0, maxResults=200,sort=None,

taskid=None, ascending=True, service_url=None, disableErrors=False

Performs on API query operatio on the given tag with the given query questions.

Returns json array with each object represented in a row.

Various Parameters are:

ag:str - the tag associated with the dataset.

cfxql_query:str - the cfxql query to be used, default is all. offset:int - the number of records to fetch as part of this request.

maxResults:int -The max. number of records to fetch as part of this request

sort:dict - the sort criteria to be used while fetching results taskid: str - Arbitrary id that client can pass for tracking purposes which will be returned back.

ascending: bool - if the results should be sorting ascending, default is 'True'.

disableErrors: bool - if the errors should be displayed or not

get_port_details(self, resource_df, resourceKey)

returns a dataframe of all port details

get_port_details_single_asset(self, resource, resourceKey, commonAttrs=None)

Gets port details for an asset, commonAttrs is a dict object

Last updated