0% found this document useful (0 votes)
6 views49 pages

Cortex Xpanse Python SDK Readthedocs Io en Latest

The document outlines the release notes for Palo Alto Cortex Xpanse version 2.1.0, detailing its APIs and submodules. It includes information on asset management, incident management, and service handling, along with examples of how to use the APIs. The document serves as a comprehensive guide for developers working with the Cortex Xpanse Python SDK.

Uploaded by

patosantirso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views49 pages

Cortex Xpanse Python SDK Readthedocs Io en Latest

The document outlines the release notes for Palo Alto Cortex Xpanse version 2.1.0, detailing its APIs and submodules. It includes information on asset management, incident management, and service handling, along with examples of how to use the APIs. The document serves as a comprehensive guide for developers working with the Cortex Xpanse Python SDK.

Uploaded by

patosantirso
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 49

Xpanse

Release 2.1.0

Palo Alto Cortex Xpanse

Aug 08, 2023


CONTENTS

1 Subpackages 1
1.1 Cortex Xpanse APIs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1 Subpackages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1.1 Cortex Xpanse Asset Management API . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1.1.2 Cortex Xpanse Attack Surface Rules API . . . . . . . . . . . . . . . . . . . . . . . 6
1.1.1.3 Cortex Xpanse Incident Management API . . . . . . . . . . . . . . . . . . . . . . 8
1.1.1.4 Cortex Xpanse Tags API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12

2 Submodules 15

3 xpanse.client module 17

4 xpanse.const module 21

5 xpanse.endpoint module 25

6 xpanse.error module 27

7 xpanse.iterator module 29

8 xpanse.response module 31

9 xpanse.types module 33

10 xpanse.utils module 35

11 Cortex Xpanse Python SDK 37


11.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
11.2 Install . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
11.3 Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
11.4 Usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
11.5 Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
11.6 Logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

Python Module Index 41

Index 43

i
ii
CHAPTER

ONE

SUBPACKAGES

1.1 Cortex Xpanse APIs

1.1.1 Subpackages

1.1.1.1 Cortex Xpanse Asset Management API

xpanse.api.asset_management.v1.assets module

class AssetsEndpoint(session)
Bases: xpanse.api.asset_management.assets_management_base.
AssetsManagementBaseEndpoint
Part of the Public API for handling Assets. See: https://docs-cortex.paloaltonetworks.com/r/
Cortex-XPANSE/Cortex-Xpanse-API-Reference/Get-All-Assets See: https://docs-cortex.paloaltonetworks.
com/r/Cortex-XPANSE/Cortex-Xpanse-API-Reference/Get-Asset
GET_ENDPOINT = 'public_api/v1/assets/get_asset_internet_exposure/'
LIST_DATA_KEY = 'assets_internet_exposure'
LIST_ENDPOINT = 'public_api/v1/assets/get_assets_internet_exposure/'
count(asset_types: Optional[Set[xpanse.const.AssetType]] = None, request_data:
Optional[xpanse.types.RequestData] = None, **kwargs: Any) →
xpanse.response.XpanseResponse
This endpoint will return a count of Assets.
Parameters
• asset_types (Set[AssetType], Optional) – An optional set of asset types
that can be used to filter your request.
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.
Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

1
Xpanse, Release 2.1.0

Examples

>>> # Get Assets total count:


>>> assets = client.assets.count()
>>> if assets.response.status_code < 300:
>>> count = assets.data

get(asset_ids: List[str], request_data: Optional[xpanse.types.RequestData] = None, **kwargs: Any)


→ xpanse.response.XpanseResponse
This endpoint will return details for a list of Asset ids. Arguments should be passed as keyword args using
the names below.
Parameters
• asset_ids (List[str]) – The lists of asset ids to retrieve with your request.
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.
Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

Examples

>>> # Get Assets with specified ids to a list:


>>> assets = client.assets.get(asset_ids=["id1", "id2"])
>>> if assets.response.status_code < 300:
>>> results = assets.data

list(asset_types: Optional[Set[xpanse.const.AssetType]] = None, request_data:


Optional[xpanse.types.RequestData] = None, **kwargs: Any) →
xpanse.iterator.XpanseResultIterator
This endpoint will return a paginated list of Assets.
Parameters
• asset_types (Set[AssetType], Optional) – An optional set of Asset types
that can be used to filter your request.
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the requests module. Note: By default, all payload data is sent under the
“json” keyword for your request.
Returns An iterator containing all of the Asset results. Results can be iterated or called by page
using <iterator>.next().
Return type XpanseResultIterator

2 Chapter 1. Subpackages
Xpanse, Release 2.1.0

Examples

>>> # Return all Assets dumped to a list:


>>> assets = client.assets.list().dump()

xpanse.api.asset_management.v1.owned_ip_ranges module

class OwnedIpRangesEndpoint(session)
Bases: xpanse.api.asset_management.assets_management_base.
AssetsManagementBaseEndpoint
Part of the Public API for handling Owned IP Ranges. See: https://docs-cortex.paloaltonetworks.
com/r/Cortex-XPANSE/Cortex-Xpanse-API-Reference/Get-All-External-IP-Address-Ranges
See: https://docs-cortex.paloaltonetworks.com/r/Cortex-XPANSE/Cortex-Xpanse-API-Reference/
Get-External-IP-Address-Range
GET_ENDPOINT = 'public_api/v1/assets/get_external_ip_address_range/'
LIST_DATA_KEY = 'external_ip_address_ranges'
LIST_ENDPOINT = 'public_api/v1/assets/get_external_ip_address_ranges/'
count(request_data: Optional[xpanse.types.RequestData] = None, **kwargs: Any) →
xpanse.response.XpanseResponse
This endpoint will return a count of Owned IP Ranges.
Parameters
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.
Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

Examples

>>> # Get Owned IP Ranges total count:


>>> ip_ranges = client.owned_ip_ranges.count()
>>> if ip_ranges.response.status_code < 300:
>>> count = ip_ranges.data

get(ip_range_ids: List[str], request_data: Optional[xpanse.types.RequestData] = None, **kwargs:


Any) → xpanse.response.XpanseResponse
This endpoint will return details for a list of Owned IP Range ids. Arguments should be passed as keyword
args using the names below.
Parameters
• ip_range_ids (List[str]) – The lists of Owned IP Range ids to retrieve with your
request.

1.1. Cortex Xpanse APIs 3


Xpanse, Release 2.1.0

• request_data (RequestData, Optional) – Any supplemental request_data to


be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.
Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

Examples

>>> # Get Owned IP Ranges with specified ids to a list:


>>> ip_ranges = client.owned_ip_ranges.get(ip_range_ids=["id1", "id2"])
>>> if ip_ranges.response.status_code < 300:
>>> results = ip_ranges.data

list(request_data: Optional[xpanse.types.RequestData] = None, **kwargs: Any) →


xpanse.iterator.XpanseResultIterator
This endpoint will return a paginated list of Owned IP Ranges.
Parameters
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the requests module. Note: By default, all payload data is sent under the
“json” keyword for your request.
Returns An iterator containing all of the Owned IP Ranges results. Results can be iterated or
called by page using <iterator>.next().
Return type XpanseResultIterator

Examples

>>> # Return all Owned IP Ranges dumped to a list:


>>> ip_ranges = client.owned_ip_ranges.list().dump()

xpanse.api.asset_management.v1.services module

class ServicesEndpoint(session)
Bases: xpanse.api.asset_management.assets_management_base.
AssetsManagementBaseEndpoint
Part of the Public API for handling Services. See: https://docs-cortex.paloaltonetworks.com/r/Cortex-XPANSE/
Cortex-Xpanse-API-Reference/Get-All-External-Services See: https://docs-cortex.paloaltonetworks.com/r/
Cortex-XPANSE/Cortex-Xpanse-API-Reference/Get-External-Service
GET_ENDPOINT = 'public_api/v1/assets/get_external_service/'

4 Chapter 1. Subpackages
Xpanse, Release 2.1.0

LIST_DATA_KEY = 'external_services'
LIST_ENDPOINT = 'public_api/v1/assets/get_external_services/'
count(request_data: Optional[xpanse.types.RequestData] = None, **kwargs: Any) →
xpanse.response.XpanseResponse
This endpoint will return a count of Services.
Parameters
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.
Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

Examples

>>> # Get Services total count:


>>> services = client.services.count()
>>> if services.response.status_code < 300:
>>> count = services.data

get(service_ids: List[str], request_data: Optional[xpanse.types.RequestData] = None, **kwargs: Any)


→ xpanse.response.XpanseResponse
This endpoint will return details for a list of Service ids. Arguments should be passed as keyword args
using the names below.
Parameters
• service_ids (List[str]) – The lists of Service ids to retrieve with your request.
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.
Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

1.1. Cortex Xpanse APIs 5


Xpanse, Release 2.1.0

Examples

>>> # Get Services with specified ids to a list:


>>> services = client.services.get(service_ids=["id1", "id2"])
>>> if services.response.status_code < 300:
>>> results = services.data

list(request_data: Optional[xpanse.types.RequestData] = None, **kwargs: Any) →


xpanse.iterator.XpanseResultIterator
This endpoint will return a paginated list of Services.
Parameters
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the requests module. Note: By default, all payload data is sent under the
“json” keyword for your request.
Returns An iterator containing all of the Service results. Results can be iterated or called by
page using <iterator>.next().
Return type XpanseResultIterator

Examples

>>> # Return all Services dumped to a list:


>>> services = client.services.list().dump()

1.1.1.2 Cortex Xpanse Attack Surface Rules API

xpanse.api.attack_surface_rules.v1.attack_surface_rules module

class AttackSurfaceRulesEndpoint(session)
Bases: xpanse.endpoint.XpanseEndpoint
Part of the Public API for handling Attack Surface Rules.
DATA_KEY = 'attack_surface_rules'
ENDPOINT = 'public_api/v1/get_attack_surface_rules/'
count(request_data: Optional[xpanse.types.RequestData] = None, **kwargs: Any) →
xpanse.response.XpanseResponse
This endpoint will return a count of Attack Surface Rules.
Parameters
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.

6 Chapter 1. Subpackages
Xpanse, Release 2.1.0

Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

Examples

>>> # Get attack surface rules total count:


>>> attack_surface_rules = client.attack_surface_rules.count()
>>> if attack_surface_rules.response.status_code < 300:
>>> count = attack_surface_rules.data

get(attack_surface_rule_ids: List[str], request_data: Optional[xpanse.types.RequestData] = None,


**kwargs: Any) → xpanse.response.XpanseResponse
This endpoint will return details for a list of Attack Surface Rule ids. Arguments should be passed as
keyword args using the names below.
Parameters
• attack_surface_rule_ids (List[str]) – The lists of Attack Surface Rule ids
to retrieve with your request.
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.
Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

Examples

>>> # Get attack surface rules with specified ids to a list:


>>> attack_surface_rules = client.attack_surface_rules.get(attack_surface_
˓→rule_ids=["id1", "id2"])

>>> if attack_surface_rules.response.status_code < 300:


>>> results = attack_surface_rules.data

list(request_data: Optional[xpanse.types.RequestData] = None, **kwargs: Any) →


xpanse.iterator.XpanseResultIterator
This endpoint will return a paginated list of Attack Surface Rules.
Parameters
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the requests module. Note: By default, all payload data is sent under the
“json” keyword for your request.

1.1. Cortex Xpanse APIs 7


Xpanse, Release 2.1.0

Returns An iterator containing all of the Attack Surface Rules results. Results can be iterated
or called by page using <iterator>.next().
Return type XpanseResultIterator

Examples

>>> # Return all attack surface rules dumped to a list:


>>> attack_surface_rules = client.attack_surface_rules.list().dump()

1.1.1.3 Cortex Xpanse Incident Management API

xpanse.api.incident_management.v1.incidents module

class IncidentsEndpoint(session)
Bases: xpanse.endpoint.XpanseEndpoint
Part of the Public API for handling Incidents. See: https://docs-cortex.paloaltonetworks.com/
r/Cortex-XPANSE/Cortex-Xpanse-API-Reference/Get-Incidents See: https://docs-cortex.paloaltonetworks.
com/r/Cortex-XPANSE/Cortex-Xpanse-API-Reference/Update-an-Incident
DATA_KEY = 'incidents'
LIST_ENDPOINT = 'public_api/v1/incidents/get_incidents/'
UPDATE_ENDPOINT = 'public_api/v1/incidents/update_incident/'
count(request_data: Optional[xpanse.types.RequestData] = None, **kwargs: Any) →
xpanse.response.XpanseResponse
This endpoint will return a count of Incidents.
Parameters
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.
Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

8 Chapter 1. Subpackages
Xpanse, Release 2.1.0

Examples

>>> # Get Incidents total count:


>>> incidents = client.incidents.count()
>>> if incidents.response.status_code < 300:
>>> count = incidents.data

get(incident_ids: List[str], request_data: Optional[xpanse.types.RequestData] = None, **kwargs:


Any) → xpanse.response.XpanseResponse
This endpoint will return details for a list of Incident ids. Arguments should be passed as keyword args
using the names below.
Parameters
• incident_ids (List[str]) – The list of Incident ids to retrieve with your request.
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.
Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

Examples

>>> # Get Incidents with specified ids to a list:


>>> incidents = client.incidents.get(incident_ids=["id1", "id2"])
>>> if incidents.response.status_code < 300:
>>> results = incidents.data

list(request_data: Optional[xpanse.types.RequestData] = None, **kwargs: Any) →


xpanse.iterator.XpanseResultIterator
This endpoint will return a paginated list of Incidents.
Parameters
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the requests module. Note: By default, all payload data is sent under the
“json” keyword for your request.
Returns An iterator containing all of the Incident results. Results can be iterated or called by
page using <iterator>.next().
Return type XpanseResultIterator

1.1. Cortex Xpanse APIs 9


Xpanse, Release 2.1.0

Examples

>>> # Return all Incidents dumped to a list:


>>> incidents = client.incidents.list().dump()

update(incident_id: str, update_data: Any, **kwargs: Any) → xpanse.response.XpanseResponse


This endpoint will update a set of Incidents’ data.
Parameters
• incident_id (str) – The Incident id to modify with your request data.
• update_data (Any) – The data with which to update the Incident.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.
Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

Examples

>>> # Update Incidents with new assignee:


>>> incidents = client.incidents.update(incident_id="id1",
>>> update_data={"assigned_user_mail":
˓→"[email protected]"})

>>> if incidents.response.status_code < 300:


>>> results = incidents.data

xpanse.api.incident_management.v2.alerts module

class AlertsEndpoint(session)
Bases: xpanse.endpoint.XpanseEndpoint
Part of the Public API for handling Alerts Multi-Events v2. See: https://docs-cortex.paloaltonetworks.com/r/
Cortex-XPANSE/Cortex-Xpanse-API-Reference/Get-Alerts-Multi-Events
DATA_KEY = 'alerts'
ENDPOINT = 'public_api/v2/alerts/get_alerts_multi_events/'
count(request_data: Optional[xpanse.types.RequestData] = None, **kwargs: Any) →
xpanse.response.XpanseResponse
This endpoint will return a count of Alerts.
Parameters
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.

10 Chapter 1. Subpackages
Xpanse, Release 2.1.0

Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

Examples

>>> # Get Alerts total count:


>>> alerts = client.alerts.count()
>>> if alerts.response.status_code < 300:
>>> count = alerts.data

get(alert_ids: List[str], request_data: Optional[xpanse.types.RequestData] = None, **kwargs: Any)


→ xpanse.response.XpanseResponse
This endpoint will return details for a list of Alert ids. Arguments should be passed as keyword args using
the names below.
Parameters
• alert_ids (List[str]) – The lists of Alert ids to retrieve with your request.
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.
Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

Examples

>>> # Get Alerts with specified ids to a list:


>>> alerts = client.alerts.get(alert_ids=["id1", "id2"])
>>> if alerts.response.status_code < 300:
>>> results = alerts.data

list(request_data: Optional[xpanse.types.RequestData] = None, **kwargs: Any) →


xpanse.iterator.XpanseResultIterator
This endpoint will return a paginated list of Alerts.
Parameters
• request_data (RequestData, Optional) – Any supplemental request_data to
be included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the requests module. Note: By default, all payload data is sent under the
“json” keyword for your request.
Returns An iterator containing all of the Alert results. Results can be iterated or called by page
using <iterator>.next().

1.1. Cortex Xpanse APIs 11


Xpanse, Release 2.1.0

Return type XpanseResultIterator

Examples

>>> # Return all Alerts dumped to a list:


>>> alerts = client.alerts.list().dump()

1.1.1.4 Cortex Xpanse Tags API

xpanse.api.tags.v1.tags module

class TagsEndpoint(session)
Bases: xpanse.endpoint.XpanseEndpoint
Part of the Public API for handling Tags.
ASSIGN_DATA_KEY = 'assign_tags'
ASSIGN_ENDPOINT = 'public_api/v1/assets/tags/{data_type}/assign'
REMOVE_DATA_KEY = 'remove_tags'
REMOVE_ENDPOINT = 'public_api/v1/assets/tags/{data_type}/remove'
assign(data_type: xpanse.const.TaggableDataType, tags: List[str], filters: List[xpanse.types.Filter],
**kwargs) → xpanse.response.XpanseResponse
This method assigns new or existing tags to a set of taggable data.
The two taggable data types are Asset Tags (AT) and IP Range Tags (IPR).
Parameters
• data_type (TaggableDataType) – The data type you would like to tag. Currently
only supports tagging Assets and Owned IP Ranges
• tags (List[str]) – A list of the new or existing tag names you would like to attach.
• filters (List[Filter]) – A list of Filters to determine the filtered set of data to
which the tags should be applied.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.
Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

12 Chapter 1. Subpackages
Xpanse, Release 2.1.0

Examples

>>> # Attach "Awesome Tag" and "Boring Tag" to Asset with ID "abc1":
>>> tags = client.tags.assign(data_type=TaggableDataType.ASSETS,
>>> tags=["Awesome Tag", "Boring Tag"],
>>> filters=[{"field": "asm_id_list", "operator":
˓→"in", "value": ["abc1"]}])

>>> if tags.response.status_code < 300:


>>> succeeded = tags.data

remove(data_type: xpanse.const.TaggableDataType, tags: List[str], filters: List[xpanse.types.Filter],


**kwargs) → xpanse.response.XpanseResponse
This method removes existing tags from a set of taggable data.
The two taggable data types are Asset Tags (AT) and IP Range Tags (IPR).
Parameters
• data_type (TaggableDataType) – The data type from which you would like to
remove tags. Currently only supports removing tags from Assets and Owned IP Ranges
• tags (List[str]) – A list of the existing tag names you would like to remove.
• filters (List[Filter]) – A list of Filters to determine the filtered set of data from
which the tags should be removed.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request.
Returns An object containing the raw requests.Response and parsed data results. The raw re-
sponse can be accessed with <xpanse_reponse>.response attribute. The parsed results can
be accessed with the <xpanse_response>.data attribute.
Return type XpanseResponse

Examples

>>> # Remove "Awesome Tag" and "Boring Tag" to Asset with ID "abc1":
>>> tags = client.tags.remove(data_type=TaggableDataType.ASSETS,
>>> tags=["Awesome Tag", "Boring Tag"],
>>> filters=[{"field": "asm_id_list", "operator":
˓→"in", "value": ["abc1"]}])

>>> if tags.response.status_code < 300:


>>> succeeded = tags.data

class AssetsApi(session)
Bases: xpanse.api.asset_management.v1.assets.AssetsEndpoint
property current_version
property v1
class OwnedIpRangesApi(session)
Bases: xpanse.api.asset_management.v1.owned_ip_ranges.OwnedIpRangesEndpoint
property current_version
property v1

1.1. Cortex Xpanse APIs 13


Xpanse, Release 2.1.0

class ServicesApi(session)
Bases: xpanse.api.asset_management.v1.services.ServicesEndpoint
property current_version
property v1
class AttackSurfaceRulesApi(session)
Bases: xpanse.api.attack_surface_rules.v1.attack_surface_rules.
AttackSurfaceRulesEndpoint
property current_version
property v1
class AlertsApi(session)
Bases: xpanse.api.incident_management.v2.alerts.AlertsEndpoint
property current_version
property v1
property v2
class IncidentsApi(session)
Bases: xpanse.api.incident_management.v1.incidents.IncidentsEndpoint
property current_version
property v1
class TagsApi(session)
Bases: xpanse.api.tags.v1.tags.TagsEndpoint
property current_version
property v1

14 Chapter 1. Subpackages
CHAPTER

TWO

SUBMODULES

15
Xpanse, Release 2.1.0

16 Chapter 2. Submodules
CHAPTER

THREE

XPANSE.CLIENT MODULE

class XpanseClient(url: Optional[str] = None, api_key_id: Optional[Union[str, int]] = None, api_key:


Optional[str] = None, use_advanced_auth: bool = True, custom_ua: Optional[str]
= None, proxies: Optional[MutableMapping[str, str]] = None, verify: bool =
True)
Bases: object
Interface for Cortex Xpanse APIs.
Parameters
• url (str, required) – The base URL that the paths will be appended onto. This field
is required to be set either during instantiation, or using the environment variable COR-
TEX_FQDN.
• api_key_id (Union[str, int], required) – The API Key ID associated with
the generated credentials. This can be located after generating the credentials in the API
Keys table under the ‘ID’ column. i.e. 1, 2, 3, etc. This field is required to be set either
during instantiation, or using the environment variable CORTEX_API_KEY_ID.
• api_key (str, required) – The API Key generated when provisioning the creden-
tials in your product. It is recommended that the API Key defaults are kept (i.e. using
Advanced keys). This field is required to be set either during instantiation, or using the
environment variable CORTEX_API_KEY.
• use_advanced_auth (bool, optional) – A flag used to determine which type
of API Key is being used. ‘Advanced’ is used when True, ‘Standard’ is used
when False. This is configured when generating your API Keys is in the product.
The default is True. See: https://docs-cortex.paloaltonetworks.com/r/Cortex-XPANSE/
Cortex-Xpanse-API-Reference/Get-Started-with-APIs
• custom_ua (str, optional) – A custom string can be provided that will be sent
within the user-agent header on all requests to Xpanse. Final format will be Xpanse
SDK+<custom_ua>/__version__ . . .
• proxies (MutableMapping[str, str], optional) – A dictionary detailing
what proxy should be used for what transport protocol. This value will be passed to the
session object after it has been either attached or created. For details on the structure of
this dictionary, consult the :requests:`proxies <user/advanced/#proxies>` section of the
Requests documentation.
• verify (bool, optional) – Whether or not SSL verification should occur. This is
True by default. Disabling certificate verification is strongly discouraged. See: https://
urllib3.readthedocs.io/en/latest/advanced-usage.html#ssl-warnings InsecureRequestWarn-
ing

17
Xpanse, Release 2.1.0

property alerts
Alerts V2 API
property assets
Assets API
property attack_surface_rules
Attack Surface Rules API
delete(path: str) → Optional[requests.models.Response]
Initiates an HTTP DELETE request using the specified path. Refer to requests.request for more
detailed information on what keyword arguments can be passed:
Parameters
• path (str) – The path to be appended onto the base URL for the request.
• **kwargs (dict) – Keyword arguments to be passed to the Requests Sessions request
method.
Returns requests.Response
get(path: str, **kwargs: Any) → Optional[requests.models.Response]
Initiates an HTTP GET request using the specified path. Refer to requests.request for more detailed
information on what keyword arguments can be passed:
Parameters
• path (str) – The path to be appended onto the base URL for the request.
• **kwargs (dict) – Keyword arguments to be passed to the Requests Sessions request
method.
Returns requests.Response
property incidents
Incidents API
property owned_ip_ranges
Owned IP Ranges API
patch(path: str, **kwargs: Any) → Optional[requests.models.Response]
Initiates an HTTP PATCH request using the specified path. Refer to requests.request for more
detailed information on what keyword arguments can be passed:
Parameters
• path (str) – The path to be appended onto the base URL for the request.
• **kwargs (dict) – Keyword arguments to be passed to the Requests Sessions request
method.
Returns requests.Response
post(path: str, **kwargs: Any) → Optional[requests.models.Response]
Initiates an HTTP POST request using the specified path. Refer to requests.request for more
detailed information on what keyword arguments can be passed:
Parameters
• path (str) – The path to be appended onto the base URL for the request.
• **kwargs (dict) – Keyword arguments to be passed to the Requests Sessions request
method.
Returns requests.Response

18 Chapter 3. xpanse.client module


Xpanse, Release 2.1.0

put(path: str, **kwargs: Any) → Optional[requests.models.Response]


Initiates an HTTP PUT request using the specified path. Refer to requests.request for more detailed
information on what keyword arguments can be passed:
Parameters
• path (str) – The path to be appended onto the base URL for the request.
• **kwargs (dict) – Keyword arguments to be passed to the Requests Sessions request
method.
Returns requests.Response
property services
Services API
property tags
Tags API

19
Xpanse, Release 2.1.0

20 Chapter 3. xpanse.client module


CHAPTER

FOUR

XPANSE.CONST MODULE

class AssetType(value)
Bases: enum.Enum
Enums for Asset Types
CERTIFICATE = 'certificate'
Certificate Type
CLOUD_RESOURCES = 'cloud_compute_instance'
“Cloud Compute Instance Type
DOMAIN = 'domain'
Domain Type
OWNED_RESPONSIVE_IP = 'unassociated_responsive_ip'
Unassociated Responsive IP Type
PRISMA_CLOUD_RESOURCE = 'cloud_integration'
“Cloud Integration Type
CORTEX_API_KEY = 'CORTEX_API_KEY'
Env Variable for Cortex Public API Key
CORTEX_API_KEY_ID = 'CORTEX_API_KEY_ID'
Env Variable for Cortex Public API Key ID
CORTEX_FQDN = 'CORTEX_FQDN'
Env Variable for API Host (Fully Qualified Domain Name)
DEFAULT_REQUEST_PAYLOAD_FIELD = 'json'
Default Parameter Used by the Requests Library for the Payload
DEFAULT_SEARCH_FROM = 0
Default search_from Field for Limit-Offset Pagination
DEFAULT_SEARCH_TO = 100
Default search_to Field for Limit-Offset Pagination
class FilterOperator(value)
Bases: enum.Enum
Enum for Filter Operators
CONTAINS = 'contains'
Contains
EQ = 'eq'
Equals

21
Xpanse, Release 2.1.0

GTE = 'gte'
Greater Than or Equal To
IN = 'in'
Includes
LTE = 'lte'
Less Than or Equal To
NEQ = 'neq'
Not Equals
NIN = 'nin'
Not Includes
NOT_CONTAINS = 'not_contains'
Not Contains
class HTTPVerb(value)
Bases: enum.Enum
Enums for HTTP verbs
HTTP_DELETE = 'DELETE'
HTTP DELETE Verb
HTTP_GET = 'GET'
HTTP GET Verb
HTTP_PATCH = 'PATCH'
HTTP PATCH Verb
HTTP_POST = 'POST'
HTTP POST Verb
HTTP_PUT = 'PUT'
HTTP PUT Verb
MAX_TOTAL_COUNT = 9999
Maximum total_count in the reply for Most Endpoints
class PublicApiFields
Bases: object
Keys for PAPI Requests and Responses
FIELD = 'field'
Common Field For Providing Request Data
FILTERS = 'filters'
Common Field For Providing Request Data
KEYWORD = 'keyword'
Common Field For Sorting Keyword in Request Data
NEXT_PAGE_TOKEN = 'next_page_token'
Common Pagination Token Field
OPERATOR = 'operator'
Common Field For Filter Operator in Request Data
REPLY = 'reply'
Common Top-Level Response Key

22 Chapter 4. xpanse.const module


Xpanse, Release 2.1.0

REQUEST_DATA = 'request_data'
Common Field For Providing Request Data
RESULTS_COUNT = 'results_count'
Common Field for Page Size Count
SEARCH_FROM = 'search_from'
Common Field For Query Offset
SEARCH_TO = 'search_to'
Common Field For Calculating Query Limit
SORT = 'sort'
Common Field For Sorting in Request Data
TAGS = 'tags'
Common Field For Providing Request Data
TOTAL_COUNT = 'total_count'
Common Field for Total Results Count - Limit is 9,999
USE_PAGE_TOKEN = 'use_page_token'
Common Field To Use Pagination
VALUE = 'value'
Common Field For Filter Value in Request Data
class SortOrder(value)
Bases: enum.Enum
Enum for Sort Order
ASC = 'asc'
Ascending
DESC = 'desc'
Descending
class TaggableDataType(value)
Bases: enum.Enum
An enumeration.
ASSETS = 'assets_internet_exposure'
Asset Data Type for AT Tag Management
OWNED_IP_RANGES = 'external_ip_address_ranges'
Owned IP Range Data Type for IPR Tag Management
V1_PREFIX = 'public_api/v1'
V1 URL Prefix
V2_PREFIX = 'public_api/v2'
V2 URL Prefix

23
Xpanse, Release 2.1.0

24 Chapter 4. xpanse.const module


CHAPTER

FIVE

XPANSE.ENDPOINT MODULE

class XpanseEndpoint(session)
Bases: object
The XpanseEndpoint class is used as a base class for all endpoints. Any additional logic that is desired to be
present on all endpoints, but is outside of the scope of the session or client can be added here.

25
Xpanse, Release 2.1.0

26 Chapter 5. xpanse.endpoint module


CHAPTER

SIX

XPANSE.ERROR MODULE

exception InvalidApiCredentials(msg: str, response: requests.models.Response = None)


Bases: xpanse.error.XpanseException
Thrown when credentials are invalid and need to be rotated.
exception UnexpectedResponseError(msg: str, response: requests.models.Response = None)
Bases: xpanse.error.XpanseException
Response from the server was unexpected and requires further investigation.
exception UnexpectedValueError(msg: str, response: requests.models.Response = None)
Bases: xpanse.error.XpanseException
An unexpected value error is thrown whenever the value specified for a parameter is outside the bounds of what
is expected or is missing.
exception XpanseException(msg: str, response: requests.models.Response = None)
Bases: Exception
Base exception class.

27
Xpanse, Release 2.1.0

28 Chapter 6. xpanse.error module


CHAPTER

SEVEN

XPANSE.ITERATOR MODULE

class XpanseResultIterator(api: Any, path: str, data_key: str, use_page_token: bool = True,
search_from: int = 0, search_to: int = 100, **kwargs)
Bases: object
Iterator for paging though results.
dump() → List[Any]
Iterates until completion and returns a list of results.
has_next() → bool
True when there’s another page of data, False when pagination is complete.
next() → Dict[str, Any]
Fetches the result from pagination.next, if a value exists.
property total
Returns the total number of results. (Max for most data types is 9_999).

29
Xpanse, Release 2.1.0

30 Chapter 7. xpanse.iterator module


CHAPTER

EIGHT

XPANSE.RESPONSE MODULE

class XpanseResponse(response: requests.models.Response, data_key: Optional[str] = None)


Bases: object
This class wraps the existing requests.Response class to enable ease of parsing while maintaining the raw re-
sponse object and status code.
Usages: > To see the raw response from the request, access the “response” attribute: xpanse_response.response
> To grab the parsed data from the response, access the “data” attribute: xpanse_response.data

Examples

>>> assets = client.assets.get(asset_ids=["id1"])


>>> if assets.response.status_code < 300:
>>> results = assets.data

property data
Parses the response body and returns it under the data property
property response
Defines the raw requests.Response property

31
Xpanse, Release 2.1.0

32 Chapter 8. xpanse.response module


CHAPTER

NINE

XPANSE.TYPES MODULE

class Filter(_typename, _fields=None, /, **kwargs)


Bases: dict
field: str
Field on Data Set to Filter
operator: str
Filter Operator - Use FilterOperator Enum for Values
value: Any
Filter Value
class RequestData(_typename, _fields=None, /, **kwargs)
Bases: dict
filters: NotRequired[List[Filter]]
A List of Desired Filter Objects
next_page_token: NotRequired[str]
Only Used For List Endpoints - Sets Next Page Token
search_from: NotRequired[int]
Search From Value Representing Offset
search_to: NotRequired[int]
Search To Value Representing Limit
sort: NotRequired[Sort]
Sort Object
use_page_token: NotRequired[bool]
Only Used For List Endpoints - Use Token Based Pagination
class Sort(_typename, _fields=None, /, **kwargs)
Bases: dict
field: str
Field on Data Set By Which to Sort
keyword: str
Sort Direction - Use SortOrder Enum for Values

33
Xpanse, Release 2.1.0

34 Chapter 9. xpanse.types module


CHAPTER

TEN

XPANSE.UTILS MODULE

build_request_payload(request_data: Optional[xpanse.types.RequestData] = None, filters: Op-


tional[List[xpanse.types.Filter]] = None, extra_request_data: Optional[dict]
= None, payload_field: str = 'json', **kwargs) → Dict
Updates the existing request_data to include overridden or appended data to the request payload.
Parameters
• request_data (RequestData, Optional) – Any supplemental request_data to be
included with your request. This is needed to implement any additional filters, offsets,
limits, or sort ordering.
• filters (List[Filter]) – A list of filter objects to be added to the request payload.
• extra_request_data (dict, Optional) – A dictionary of any extra root level
“request_data” to be provided in the payload.
• payload_field (str) – The name of the kwarg used by the requests library when mak-
ing the request. Default is “json”, but can be set to “data”.
• **kwargs – Any extraneous parameters you would like to include when executing your
request with the Requests.request module. Note: By default, all payload data is sent under
the “json” keyword for your request (see payload_field above).
Returns dict: A reference to the original kwargs with the updated request_data payload.
normalize_param_names(kwargs: Dict[str, Any]) → Dict[str, Any]
Replace underscores in kwarg names with hyphens.
Parameters kwargs – Any set of key-value pairs used for request query parameters.
Returns obj: The original reference to the kwargs object with its arguments normalized.

35
Xpanse, Release 2.1.0

36 Chapter 10. xpanse.utils module


CHAPTER

ELEVEN

CORTEX XPANSE PYTHON SDK

37
Xpanse, Release 2.1.0

11.1 Overview

This library is intended to be an interface to the Cortex Xpanse Public API.

11.2 Install

pip install xpanse

11.3 Requirements
Python 3.7+

11.4 Usage

# Import client
from xpanse.client import XpanseClient

# Initialize client
client = XpanseClient()

# Get assets iterator object and dump to a list


assets = client.assets.list().dump()

You can view more example code in the examples.

11.5 Configuration

A valid API Key, API Key ID, and Fully Qualified Domain Name (FQDN) are required for use.
Reference the docs for more information with Getting Started.
RECOMMENDED
You can supply them as environment variables.

export CORTEX_FQDN=<Your Xpanse Instance URL>


export CORTEX_API_KEY=<API Key>
export CORTEX_API_KEY_ID=<API Key ID>

NOT RECOMMENDED
The following parameters can be set inline using the XpanseClient constructor.
This is not recommended, as it easily exposes sensitive credentials in your source code.

# Import client
from xpanse.client import XpanseClient

# Initialize client - THIS IS NOT RECOMMENDED, SET ENVIRONMENT VARIABLES INSTEAD


(continues on next page)

38 Chapter 11. Cortex Xpanse Python SDK


Xpanse, Release 2.1.0

(continued from previous page)


client = XpanseClient(url="https://my-company.crtx.us.paloaltonetworks.com",
api_key="xxxxxxxxxxxxxxxApiKeyxxxxxxxxxxxxxxx",
api_key_id=1)

11.6 Logging

Logging is handled through the python logging package. To enable different levels of verbosity in your scripts you
can do the following:

import logging

# Set the logging level


logging.basicConfig(level=logging.DEBUG)

You can read more at https://docs.python.org/3/library/logging.html.

11.6. Logging 39
Xpanse, Release 2.1.0

40 Chapter 11. Cortex Xpanse Python SDK


PYTHON MODULE INDEX

x
xpanse.api.asset_management, 13
xpanse.api.asset_management.v1.assets,
1
xpanse.api.asset_management.v1.owned_ip_ranges,
3
xpanse.api.asset_management.v1.services,
4
xpanse.api.attack_surface_rules, 14
xpanse.api.attack_surface_rules.v1.attack_surface_rules,
6
xpanse.api.incident_management, 14
xpanse.api.incident_management.v1.incidents,
8
xpanse.api.incident_management.v2.alerts,
10
xpanse.api.tags, 14
xpanse.api.tags.v1.tags, 12
xpanse.client, 17
xpanse.const, 21
xpanse.endpoint, 25
xpanse.error, 27
xpanse.iterator, 29
xpanse.response, 31
xpanse.types, 33
xpanse.utils, 35

41
Xpanse, Release 2.1.0

42 Python Module Index


INDEX

A count() (ServicesEndpoint method), 5


alerts() (XpanseClient property), 17 current_version() (AlertsApi property), 14
AlertsApi (class in current_version() (AssetsApi property), 13
xpanse.api.incident_management), 14 current_version() (AttackSurfaceRulesApi prop-
AlertsEndpoint (class in erty), 14
xpanse.api.incident_management.v2.alerts), 10 current_version() (IncidentsApi property), 14
ASC (SortOrder attribute), 23 current_version() (OwnedIpRangesApi property),
ASSETS (TaggableDataType attribute), 23 13
assets() (XpanseClient property), 18 current_version() (ServicesApi property), 14
AssetsApi (class in xpanse.api.asset_management), current_version() (TagsApi property), 14
13
AssetsEndpoint (class in D
xpanse.api.asset_management.v1.assets), data() (XpanseResponse property), 31
1 DATA_KEY (AlertsEndpoint attribute), 10
AssetType (class in xpanse.const), 21 DATA_KEY (AttackSurfaceRulesEndpoint attribute), 6
assign() (TagsEndpoint method), 12 DATA_KEY (IncidentsEndpoint attribute), 8
ASSIGN_DATA_KEY (TagsEndpoint attribute), 12 DEFAULT_REQUEST_PAYLOAD_FIELD (in module
ASSIGN_ENDPOINT (TagsEndpoint attribute), 12 xpanse.const), 21
attack_surface_rules() (XpanseClient prop- DEFAULT_SEARCH_FROM (in module xpanse.const), 21
erty), 18 DEFAULT_SEARCH_TO (in module xpanse.const), 21
AttackSurfaceRulesApi (class in delete() (XpanseClient method), 18
xpanse.api.attack_surface_rules), 14 DESC (SortOrder attribute), 23
AttackSurfaceRulesEndpoint (class in DOMAIN (AssetType attribute), 21
dump() (XpanseResultIterator method), 29
xpanse.api.attack_surface_rules.v1.attack_surface_rules),
6
E
B ENDPOINT (AlertsEndpoint attribute), 10
build_request_payload() (in module ENDPOINT (AttackSurfaceRulesEndpoint attribute), 6
xpanse.utils), 35 EQ (FilterOperator attribute), 21

C F
CERTIFICATE (AssetType attribute), 21 field (Filter attribute), 33
CLOUD_RESOURCES (AssetType attribute), 21 FIELD (PublicApiFields attribute), 22
CONTAINS (FilterOperator attribute), 21 field (Sort attribute), 33
CORTEX_API_KEY (in module xpanse.const), 21 Filter (class in xpanse.types), 33
CORTEX_API_KEY_ID (in module xpanse.const), 21 FilterOperator (class in xpanse.const), 21
CORTEX_FQDN (in module xpanse.const), 21 FILTERS (PublicApiFields attribute), 22
count() (AlertsEndpoint method), 10 filters (RequestData attribute), 33
count() (AssetsEndpoint method), 1
count() (AttackSurfaceRulesEndpoint method), 6 G
count() (IncidentsEndpoint method), 8 get() (AlertsEndpoint method), 11
count() (OwnedIpRangesEndpoint method), 3 get() (AssetsEndpoint method), 2

43
Xpanse, Release 2.1.0

get() (AttackSurfaceRulesEndpoint method), 7 module


get() (IncidentsEndpoint method), 9 xpanse.api.asset_management, 13
get() (OwnedIpRangesEndpoint method), 3 xpanse.api.asset_management.v1.assets,
get() (ServicesEndpoint method), 5 1
get() (XpanseClient method), 18 xpanse.api.asset_management.v1.owned_ip_ranges,
GET_ENDPOINT (AssetsEndpoint attribute), 1 3
GET_ENDPOINT (OwnedIpRangesEndpoint attribute), 3 xpanse.api.asset_management.v1.services,
GET_ENDPOINT (ServicesEndpoint attribute), 4 4
GTE (FilterOperator attribute), 21 xpanse.api.attack_surface_rules, 14
xpanse.api.attack_surface_rules.v1.attack_surfac
H 6
has_next() (XpanseResultIterator method), 29 xpanse.api.incident_management, 14
HTTP_DELETE (HTTPVerb attribute), 22 xpanse.api.incident_management.v1.incidents,
HTTP_GET (HTTPVerb attribute), 22 8
HTTP_PATCH (HTTPVerb attribute), 22 xpanse.api.incident_management.v2.alerts,
HTTP_POST (HTTPVerb attribute), 22 10
HTTP_PUT (HTTPVerb attribute), 22 xpanse.api.tags, 14
HTTPVerb (class in xpanse.const), 22 xpanse.api.tags.v1.tags, 12
xpanse.client, 17
I xpanse.const, 21
IN (FilterOperator attribute), 22 xpanse.endpoint, 25
incidents() (XpanseClient property), 18 xpanse.error, 27
IncidentsApi (class in xpanse.iterator, 29
xpanse.api.incident_management), 14 xpanse.response, 31
IncidentsEndpoint (class in xpanse.types, 33
xpanse.api.incident_management.v1.incidents), xpanse.utils, 35
8
InvalidApiCredentials, 27
N
NEQ (FilterOperator attribute), 22
K next() (XpanseResultIterator method), 29
KEYWORD (PublicApiFields attribute), 22 NEXT_PAGE_TOKEN (PublicApiFields attribute), 22
keyword (Sort attribute), 33 next_page_token (RequestData attribute), 33
NIN (FilterOperator attribute), 22
L normalize_param_names() (in module
xpanse.utils), 35
list() (AlertsEndpoint method), 11
NOT_CONTAINS (FilterOperator attribute), 22
list() (AssetsEndpoint method), 2
list() (AttackSurfaceRulesEndpoint method), 7
list() (IncidentsEndpoint method), 9
O
list() (OwnedIpRangesEndpoint method), 4 operator (Filter attribute), 33
list() (ServicesEndpoint method), 6 OPERATOR (PublicApiFields attribute), 22
LIST_DATA_KEY (AssetsEndpoint attribute), 1 OWNED_IP_RANGES (TaggableDataType attribute), 23
LIST_DATA_KEY (OwnedIpRangesEndpoint attribute), owned_ip_ranges() (XpanseClient property), 18
3 OWNED_RESPONSIVE_IP (AssetType attribute), 21
LIST_DATA_KEY (ServicesEndpoint attribute), 4 OwnedIpRangesApi (class in
LIST_ENDPOINT (AssetsEndpoint attribute), 1 xpanse.api.asset_management), 13
LIST_ENDPOINT (IncidentsEndpoint attribute), 8 OwnedIpRangesEndpoint (class in
LIST_ENDPOINT (OwnedIpRangesEndpoint attribute), xpanse.api.asset_management.v1.owned_ip_ranges),
3 3
LIST_ENDPOINT (ServicesEndpoint attribute), 5
LTE (FilterOperator attribute), 22
P
patch() (XpanseClient method), 18
M post() (XpanseClient method), 18
PRISMA_CLOUD_RESOURCE (AssetType attribute), 21
MAX_TOTAL_COUNT (in module xpanse.const), 22
PublicApiFields (class in xpanse.const), 22

44 Index
Xpanse, Release 2.1.0

put() (XpanseClient method), 18 V1_PREFIX (in module xpanse.const), 23


v2() (AlertsApi property), 14
R V2_PREFIX (in module xpanse.const), 23
remove() (TagsEndpoint method), 13 value (Filter attribute), 33
REMOVE_DATA_KEY (TagsEndpoint attribute), 12 VALUE (PublicApiFields attribute), 23
REMOVE_ENDPOINT (TagsEndpoint attribute), 12
REPLY (PublicApiFields attribute), 22 X
REQUEST_DATA (PublicApiFields attribute), 22 xpanse.api.asset_management
RequestData (class in xpanse.types), 33 module, 13
response() (XpanseResponse property), 31 xpanse.api.asset_management.v1.assets
RESULTS_COUNT (PublicApiFields attribute), 23 module, 1
xpanse.api.asset_management.v1.owned_ip_ranges
S module, 3
SEARCH_FROM (PublicApiFields attribute), 23 xpanse.api.asset_management.v1.services
search_from (RequestData attribute), 33 module, 4
SEARCH_TO (PublicApiFields attribute), 23 xpanse.api.attack_surface_rules
search_to (RequestData attribute), 33 module, 14
services() (XpanseClient property), 19 xpanse.api.attack_surface_rules.v1.attack_surface_r
ServicesApi (class in module, 6
xpanse.api.asset_management), 13 xpanse.api.incident_management
ServicesEndpoint (class in module, 14
xpanse.api.asset_management.v1.services), xpanse.api.incident_management.v1.incidents
4 module, 8
Sort (class in xpanse.types), 33 xpanse.api.incident_management.v2.alerts
SORT (PublicApiFields attribute), 23 module, 10
sort (RequestData attribute), 33 xpanse.api.tags
SortOrder (class in xpanse.const), 23 module, 14
xpanse.api.tags.v1.tags
T module, 12
TaggableDataType (class in xpanse.const), 23 xpanse.client
TAGS (PublicApiFields attribute), 23 module, 17
tags() (XpanseClient property), 19 xpanse.const
TagsApi (class in xpanse.api.tags), 14 module, 21
TagsEndpoint (class in xpanse.api.tags.v1.tags), 12 xpanse.endpoint
total() (XpanseResultIterator property), 29 module, 25
TOTAL_COUNT (PublicApiFields attribute), 23 xpanse.error
module, 27
U xpanse.iterator
module, 29
UnexpectedResponseError, 27
xpanse.response
UnexpectedValueError, 27
module, 31
update() (IncidentsEndpoint method), 10
xpanse.types
UPDATE_ENDPOINT (IncidentsEndpoint attribute), 8
module, 33
USE_PAGE_TOKEN (PublicApiFields attribute), 23
xpanse.utils
use_page_token (RequestData attribute), 33
module, 35
XpanseClient (class in xpanse.client), 17
V XpanseEndpoint (class in xpanse.endpoint), 25
v1() (AlertsApi property), 14 XpanseException, 27
v1() (AssetsApi property), 13 XpanseResponse (class in xpanse.response), 31
v1() (AttackSurfaceRulesApi property), 14 XpanseResultIterator (class in xpanse.iterator),
v1() (IncidentsApi property), 14 29
v1() (OwnedIpRangesApi property), 13
v1() (ServicesApi property), 14
v1() (TagsApi property), 14

Index 45

You might also like