API Details¶
CiscoSupportAPI¶
The CiscoSupportAPI class creates “session objects” for wrapping support APIs.
Each support API endpoint is available to an instance of the ciscosupportsdk.
from ciscosupportsdk.api import CiscoSupportAPI
cs = CiscoSupportAPI(CS_API_KEY, CS_API_SECRET)
- class ciscosupportsdk.api.CiscoSupportAPI(client_id: str, client_secret: str)¶
Bases:
objectCisco Support API wrapper.
Creates a session for all API calls through a CiscoSupportAPI object. The ‘session’ handles authentication and communication to the API. Each of the support APIs are added to this object in a hierarchical structure.
asd¶
- class ciscosupportsdk.api.asd.AutomatedSoftwareDistributionApi(session: ApiSession)¶
Bases:
objectCisco Automated Software Distribution service provides software information and download URLs to assist you in upgrading your device/application to the latest version.
Unlike the other Support APIs, ASD takes its inputs as a JSON request body over POST rather than as path parameters.
A download is a two step flow: call one of the metadata methods to get image GUIDs and a
metadata_trans_id, then pass both toget_download_urls(). If the response carries anacceptance_form, the K9 or EULA agreement still has to be accepted – post it withaccept_k9_agreement()oraccept_eula_agreement()and retry.- accept_eula_agreement(file_names: list[str] = None, status: ComplianceStatus = ComplianceStatus.ACCEPTED, decline_comments: str = None) AsdAgreementAck¶
Records the user’s response to the EULA.
- Param:
file_names: list[str]: Images the response applies to.
- Param:
status: ComplianceStatus: Accepted or Declined.
- Param:
decline_comments: str: Required when declining.
- Return type:
AsdAgreementAck
- accept_k9_agreement(file_names: list[str] = None, status: ComplianceStatus = ComplianceStatus.ACCEPTED, confirm: str = 'CONFIRM_CHECKED', bus_function: BusinessFunction = BusinessFunction.COMM_OR_CIVIL, gov_mil_countries: str = 'GOV_OR_MIL_COUNTRIES_NO', decline_comments: str = None) AsdAgreementAck¶
Records the user’s response to the K9 agreement.
- Param:
file_names: list[str]: Images the response applies to.
- Param:
status: ComplianceStatus: Accepted or Declined.
- Param:
confirm: str: Confirmation checkbox value.
- Param:
bus_function: BusinessFunction: Business function declaration.
- Param:
gov_mil_countries: str: Government/military country declaration.
- Param:
decline_comments: str: Required when declining.
- Return type:
AsdAgreementAck
- get_download_urls(pid: str, mdf_id: str, metadata_trans_id: str, image_guids: list[str]) AsdDownloadResponse¶
Returns sessionized download URLs for the specified images.
The whole response is returned rather than just the downloads, because
acceptance_formhas to be inspected: when it is populated the K9 or EULA agreement must be accepted before the URLs are usable.- Param:
pid: str: Product identifier the images belong to.
- Param:
mdf_id: str: MDF identifier from the metadata response.
- Param:
metadata_trans_id: str:
metadata_trans_idreturned by the metadata call that produced these image GUIDs.- Param:
image_guids: list[str]: Image GUIDs to download.
- Return type:
AsdDownloadResponse
- get_downloads(pid: str, mdf_id: str, metadata_trans_id: str, image_guids: list[str]) Iterable[AsdDownload]¶
Convenience wrapper over
get_download_urls()that yields just the download entries.- Return type:
Iterable[AsdDownload]
- get_eula_agreement() AsdAgreement¶
Returns the EULA text and the current acceptance state for the authenticated user.
- Return type:
AsdAgreement
- get_k9_agreement() AsdAgreement¶
Returns the K9 (strong encryption) agreement text and the current acceptance state for the authenticated user.
- Return type:
AsdAgreement
- get_software_by_pid_and_image(pid: str, image_names: list[str], per_page: int = None) Iterable[AsdMetadata]¶
Returns software metadata for a product ID and image name or names.
- Param:
pid: str: Product identifier to return software for.
- Param:
image_names: list[str]: Image names to return metadata for.
- Param:
per_page: int: Number of records to return per page.
- Return type:
Iterable[AsdMetadata]
- get_software_by_pid_and_release(pid: str, current_release_version: str, output_release_version: str = 'latest', per_page: int = None) Iterable[AsdMetadata]¶
Returns software metadata for a product ID and release version.
- Param:
pid: str: Product identifier to return software for.
- Param:
current_release_version: str: Release currently running on the device, for example
5.4.3.- Param:
output_release_version: str: Release to return metadata for;
latestreturns the most recent release.- Param:
per_page: int: Number of records to return per page.
- Return type:
Iterable[AsdMetadata]
- get_software_status_by_image(image_names: list[str]) AsdMetadataResponse¶
Returns the current status of the specified image or images.
Unlike the other metadata endpoints this one is not paginated, and the full response is returned so that
invalid_images– the names the service did not recognise – is available to the caller.- Param:
image_names: list[str]: Image names to look up.
- Return type:
AsdMetadataResponse
bug¶
- Used to makes calls to the
BugApiendpoint. >>> cs = CiscoSupportAPI(CS_API_KEY, CS_API_SECRET) >>> cs.bug <ciscosupportsdk.api.bug.BugApi object at 0x10451eb20>
- class ciscosupportsdk.api.bug.BugApi(session: ApiSession)¶
Bases:
objectCisco defects (or bugs) are made visible to customers and partners through the use of the Bug Search Tool (BST) application. The objective of the Cisco Bug API is to provide an entry point into the Bug Search Tool for customers and partners to view bug details and perform bug searches while integrating the search results into their own interfaces and applications.
- get_bug_details(bug_ids: list[str]) Iterable[Bug]¶
Returns detailed information for the specified bug ID or IDs.
- Param:
bug_ids: list[str]: Identifier of the bug or bugs for which to return detailed information. A maximum of five (5) bug IDs can be submitted separated by a comma.
- Return type:
Bug
- get_bugs_by_keyword(keyword: str, status: Status = None, modified_date: DateModified = None, severity: Severity = None, sort_by: SortBy = None) Iterable[Bug]¶
Returns detailed information for the bugs associated with the specified keyword.
- Param:
keyword: str: Keyword or keywords for which to return details on associated bugs. Multiple words can be submitted
- Param:
status: Status: Status of the bug; only bugs with the specified status are returned.
- Param:
modified_date: DateModified: Last modified date of the bug; only bugs modified within the specified time are returned.
- Param:
severity: Severity: Severity of the bug; only bugs with the specified severity are returned.
- Param:
sort_by: SortBy: Parameter on which to sort the results.
- Return type:
ProductBug
- get_bugs_by_product_and_affected_release(product_series: str, affected_releases: list[str], status: Status = None, modified_date: DateModified = None, severity: Severity = None, sort_by: SortBy = None) Iterable[Bug]¶
Returns detailed information for the bugs associated with the specified hardware product series and affected software release or releases.
- get_bugs_by_product_and_fixed_release(product_series: str, fixed_in_releases: list[str], status: Status = None, modified_date: DateModified = None, severity: Severity = None, sort_by: SortBy = None) Iterable[Bug]¶
Returns detailed information for the bugs associated with the specified hardware product series and affected software release or releases.
- get_bugs_by_product_id(base_pid: str, status: Status = None, modified_date: DateModified = None, severity: Severity = None, sort_by: SortBy = None) Iterable[Bug]¶
Returns detailed information for the bugs associated with the specified base product ID.
- Param:
base_pid: str: Identifier of the base product for which to return details on associated bugs. Only one base product ID can be submitted.
- Param:
status: Status: Status of the bug; only bugs with the specified status are returned.
- Param:
modified_date: DateModified: Last modified date of the bug; only bugs modified within the specified time are returned.
- Param:
severity: Severity: Severity of the bug; only bugs with the specified severity are returned.
- Param:
sort_by: SortBy: Parameter on which to sort the results.
- Return type:
ProductBug
- get_bugs_by_product_id_and_release(base_pid: str, software_releases: list[str], status: Status = None, modified_date: DateModified = None, severity: Severity = None, sort_by: SortBy = None) Iterable[Bug]¶
Returns detailed information for the bugs associated with the specified base product ID.
- Param:
base_pid: str: Identifier of the base product for which to return details on associated bugs. Only one base product ID can be submitted.
- Param:
status: Status: Status of the bug; only bugs with the specified status are returned.
- Param:
modified_date: DateModified: Last modified date of the bug; only bugs modified within the specified time are returned.
- Param:
severity: Severity: Severity of the bug; only bugs with the specified severity are returned.
- Param:
sort_by: SortBy: Parameter on which to sort the results.
- Return type:
ProductBug
- get_bugs_by_product_name_and_affected_release(product_name: str, affected_releases: list[str], status: Status = None, modified_date: DateModified = None, severity: Severity = None, sort_by: SortBy = None) Iterable[Bug]¶
Returns detailed information for the bugs associated with the specified product name and affected software release or releases.
- get_bugs_by_product_name_and_fixed_release(product_name: str, fixed_in_releases: list[str], status: Status = None, modified_date: DateModified = None, severity: Severity = None, sort_by: SortBy = None) Iterable[Bug]¶
Returns detailed information for the bugs associated with the specified product name and affected software release or releases.
case¶
- class ciscosupportsdk.api.case.CaseApi(session: ApiSession)¶
Bases:
objectThe Cisco Support Case API v3 provides a powerful, convenient, and simple way to interact with the Cisco Support Case Manager tool and aims to improve the partner and customer experience by enabling you to access case information instantly, programmatically, and in bulk.
- get_case_details(case_id: str) CaseDetail¶
Returns detailed information for the specified case.
- Param:
case_id: str: Identifier of the case for which to return results.
- get_case_summary(case_ids: list[str], sort_by: SortCaseBy = SortCaseBy.UPDATED_DATE) Iterable[Case]¶
Returns brief information for the specified case or cases.
- Param:
case_ids: list[str]: Identifier of the case or cases for which to return results. Multiple values must be specified within a comma-separated list and cannot exceed 30 IDs.
- Param:
sort_by: SortCaseBy: Order in which the results should be sorted.
- get_cases_by_contract_id(contract_ids: list[str], date_created_from: str = None, date_created_to: str = None, status_flag: CaseStatusFlag = CaseStatusFlag.OPEN, sort_by: SortCaseBy = SortCaseBy.UPDATED_DATE) Iterable[Case]¶
Returns summary information for cases associated with the specified contract or contracts.
- Param:
contract_ids: list[str]: Identifier of the user or users for which to return results. A maximum of 10 may be passed.
- Param:
date_created_from: str: Beginning date (in UTC) of the range in which to search. For example: 2013-04-23T11:00:14Z Note: The maximum date range currently supported is 90 days.
- Param:
date_created_to: str: End date (in UTC) of the range in which to search. For example: 2013-04-23T11:00:14Z Note: The maximum date range currently supported is 90 days.
- Param:
status_flag: CaseStatusFlag: Return only cases associated with the specified status.
- Param:
sort_by: SortCaseBy: Order in which the results should be sorted.
- get_cases_by_user_id(user_ids: list[str], date_created_from: str = None, date_created_to: str = None, status_flag: CaseStatusFlag = CaseStatusFlag.OPEN, sort_by: SortCaseBy = SortCaseBy.UPDATED_DATE) Iterable[Case]¶
Returns summary information for cases associated with the specified contract or contracts.
- Param:
user_ids: list[str]: Identifier of the user or users for which to return results. A maximum of 10 may be passed.
- Param:
date_created_from: str: Beginning date (in UTC) of the range in which to search. For example: 2013-04-23T11:00:14Z Note: The maximum date range currently supported is 90 days.
- Param:
date_created_to: str: End date (in UTC) of the range in which to search. For example: 2013-04-23T11:00:14Z Note: The maximum date range currently supported is 90 days.
- Param:
status_flag: CaseStatusFlag: Return only cases associated with the specified status.
- Param:
sort_by: SortCaseBy: Order in which the results should be sorted.
eox¶
- class ciscosupportsdk.api.eox.EoxApi(session: ApiSession)¶
Bases:
objectThe Cisco EoX API provides access to Cisco End of Life product data.
Using the EoX Service API, customers and partners can request Cisco EoX product information for both hardware and software using a variety of input mechanisms.
- get_by_dates(start_date: str | ~.datetime.date, end_date: str | ~.datetime.date, eox_attribs: list[~ciscosupportsdk.models.eox.EoxAttrib]) Iterable[EoxRecord]¶
Get EoX notices for all products by date.
Returns all active and inactive EoX records for all products with the specified eoxAttrib value within an inclusive date range. If you do not specify an eoxAttrib value, this method returns records with an updated time stamp within the specified date range.
Note: This method can be used to retrieve records based on any date listed in the EoX record. For example, if you specify a date range and enter EO_SALE_DATE and EO_LAST_SUPPORT_DATE as the eoxAttrib values, this method returns records with an end of sale date or last date of support within the specified date range. This feature allows you to target specific date ranges within each attribute without having to pull the entire database.
- Parameters:
start_date – Start date of the date range of records to return in the following format: YYYY-MM-DD. For example: 2010-01-01
end_date – End date of the date range of records to return in the following format: YYYY-MM-DD. For example: 2010-01-01
- Returns:
Iterable[EoxRecord]
- Raises:
EoxError, ValueError – Depending on errors with input or processing
the request on the server. –
- get_by_serial_number(serial_numbers: list[str]) Iterable[EoxRecord]¶
Returns the EoX record for products with the specified serial numbers.
- Parameters:
serial_numbers – Device serial number or numbers for which to return results. You can enter up to 20 serial numbers (each with a maximum length of 40) separated by commas.
- Returns:
Iterable[EoxRecord]
- Raises:
EoxError, ValueError –
- get_by_software_release(software_releases: list[SoftwareRelease]) Iterable[EoxRecord]¶
Returns the EoX record for products associated with the specified software release and (optionally) the specified operating system.
- Parameters:
software_release – A combination of software release and operating system. Up to 20 combinations may be used and each may return multiple entires.
- Returns:
Iterable[EoxRecord]
- Raises:
EoxError, ValueError –
- exception ciscosupportsdk.api.eox.EoxError¶
Bases:
ExceptionServer side errors in processing the request throw an EoxError.
If you see one of these, make sure to look at the message body to see why the error occurred.
product_information¶
- class ciscosupportsdk.api.productinformation.ProductInformationApi(session: ApiSession)¶
Bases:
objectThe Cisco Product Information API looks up details on products using serial numbers and product IDs.
- get_info_by_product_id(product_ids: list[str]) Iterable[ProductInformationRecord]¶
Returns product information associated with the specified product identifier or identifiers.
- get_info_by_serial(serial_numbers: list[str]) Iterable[ProductInformationRecord]¶
Returns product information associated with the specified serial ] number or numbers.
- get_mdf_by_product_id(product_ids: list[str]) Iterable[ProductMDFRecord]¶
Returns metadata framework (MDF) identifiers associated with the specified product identifier or identifiers.Returns metadata framework (MDF) identifiers associated with the specified product identifier or identifiers.
serial_information¶
- class ciscosupportsdk.api.serialnumbertoinformation.SerialNumberToInformationAPI(session: ApiSession)¶
Bases:
objectThe Cisco Serial Number to Information API assists customers and partners in identifying an orderable PID and coverage status based on a serial number.
- get_coverage_owner_status(serial_numbers: list[str]) Iterable[CoverageOwnerStatus]¶
Returns the orderable PID for the specified device serial number.
- Param:
serial_numbers: list[str]: Device serial number or numbers for which to return results. You can enter up to 75 serial numbers (each with a maximum length of 40) separated by commas.
- Return type:
Iterable[OrderableProductList]
- get_coverage_status(serial_numbers: list[str]) Iterable[CoverageStatus]¶
Returns coverage status for a set of serial numbers.
- Param:
serial_numbers: list[str]: Device serial number or numbers for which to return results. You can enter up to 75 serial numbers (each with a maximum length of 40) separated by commas.
- Return type:
Iterable[CoverageStatus]
- get_coverage_summary_by_serial(serial_numbers: list[str]) Iterable[CoverageSummary]¶
Returns coverage status, warranty, and product identifier details for a set of serial numbers.
- Param:
serial_numbers: list[str]: Device serial number or numbers for which to return results. You can enter up to 75 serial numbers (each with a maximum length of 40) separated by commas.
- Return type:
Iterable[CoverageSummary]
- get_orderable_pids(serial_numbers: list[str]) Iterable[OrderableProductList]¶
Returns the orderable PID for the specified device serial number.
- Param:
serial_numbers: list[str]: Device serial number or numbers for which to return results. You can enter up to 75 serial numbers (each with a maximum length of 40) separated by commas.
- Return type:
Iterable[OrderableProductList]
serviceorderreturn¶
- class ciscosupportsdk.api.serviceorderreturn.ServiceOrderReturnApi(session: ApiSession)¶
Bases:
objectThe Cisco Service Order Return (RMA) API provides a powerful, convenient, and simple way to interact with the Cisco RMA service and enables you to access RMA information instantly, programmatically, and in bulk.
The Cisco Service Order Return (RMA) API is stateless, externally accessible, and delivered as a REST web service, which allows you to build innovative RMA applications and portals
- get_rma_details_by_rma_number(rma_number: str) Iterable[Rma]¶
Returns detailed information about the specified RMA.
- Param:
rma_number: str: Identifier of the RMA for which to return details. Note: Currently, only one RMA Number is required and accepted. In the future, multiple RMA numbers will be supported.
- Return type:
Iterable[Rma]
- get_rma_details_by_user_id(user_id: str, from_date: str = None, to_date: str = None, status: str = None, sort_by: str = None) Iterable[User]¶
Returns a list of RMAs associated with the specified user. By default, the last 30 days of RMAs for a user is returned.
- Param:
user_id: list[str]: Identifier of the user for which to return associated RMAs. Note: Only 1 user ID is accepted; currently, multiple user IDs are not supported.
- Return type:
Iterable[Rma]
suggestion¶
- ciscosupportsdk.api.softwaresuggestion.MAX_SUPPORTED_FEATURES = 10¶
The API accepts at most 10 feature names, within a 512 character budget.
- class ciscosupportsdk.api.softwaresuggestion.SoftwareSuggestionApi(session: ApiSession)¶
Bases:
objectThe process of selecting the appropriate software upgrade path for your environment can be complex. The Cisco Software Suggestions streamline the software selection process by providing the necessary information to assist you in making intelligent choices for upgrading your software.
- get_compatible_by_mdf_id(mdf_id: str, current_image: str = None, current_release: str = None, supported_features: list[str] = None, supported_hardware: list[str] = None) Iterable[Suggestion]¶
Returns compatible and suggested software releases for a product given its mdf identifier (mdfId) and specific software attributes.
- Param:
mdfIds: list[str]: Base mdf IDs for which to return suggested software releases. A maximum of 10 mdf Ids are allowed.
- get_compatible_by_product_id(product_id: str, current_image: str = None, current_release: str = None, supported_features: list[str] = None, supported_hardware: list[str] = None) Iterable[Suggestion]¶
Returns compatible and suggested software releases for a product given its product identifier (PID) and specific software attributes.
- Param:
mdfIds: list[str]: Base mdf IDs for which to return suggested software releases. A maximum of 10 mdf Ids are allowed.
- get_suggestions_and_image_by_mdf_ids(mdf_ids: list[str]) Iterable[Suggestion]¶
Returns a list of Cisco suggested software releases and images for a list of mdf IDs.
- Param:
product_ids: list[str]: Base product IDs for which to return suggested software releases. A maximum of 10 PIDs are allowed.
- get_suggestions_and_image_by_product_ids(product_ids: list[str]) Iterable[Suggestions]¶
Returns a list of Cisco suggested software releases and images for a list of product IDs.
- Param:
product_ids: list[str]: Base product IDs for which to return suggested software releases. A maximum of 10 PIDs are allowed.
- get_suggestions_by_mdf_ids(mdf_ids: list[str]) Iterable[Suggestion]¶
Returns a list of Cisco suggested software releases and NO images for a list of mdf IDs.
- Param:
product_ids: list[str]: Base product IDs for which to return suggested software releases. A maximum of 10 PIDs are allowed.
- get_suggestions_by_product_ids(product_ids: list[str]) Iterable[Suggestions]¶
Returns a list of Cisco suggested software releases (without images) for a list of product IDs.
- Param:
product_ids: list[str]: Base product IDs for which to return suggested software releases. A maximum of 10 PIDs are allowed.
rma¶
While known as an RMA to many customers and partners, the service endpoint here is described above in serviceorderreturn. This member is here for convenience and references the same API endpoint.