The software product data resource allows you to easily access and manage all of your software products in one convenient location. With the software resource, you have the ability to retrieve the entire software product catalog, all products from a specific vendor, all versions of a specific product, and even information on a specific version of a software product. Additionally, you can use filters to narrow down your output based on software category and product lifecycle stage. All operations in this section of the API utilize the GET method, and the resulting content is formatted according to the Portable Inventory Data format for easy integration with other systems.
Follow along with our Postman Collection
To access the requests associated with the Software endpoint, click on the Software product data folder in our Postman collection.
Retrieve the full software catalog
Retrieves all software products in the software product catalog.
API Request
Python
Request:
GET ot-base/api/v1/software
import requests
# Enter your hostname (for example: myserver.com or 127.0.0.1) between the quotes.
hostname = 'enterHostnameOrIP'
# Replace username and password with your username and password credentials.
auth=('username', 'password')
url = 'https://'+hostname+'/ot-base/api/v1/software'
response = requests.get(url, auth=auth)
print(response.status_code)
print(response.text)
Retrieve software products of a particular vendor
Retrieves all software products of a particular vendor.
Note: The vendor name might need to be quoted if it contains special characters.
API Request
Python
Request:
GET ot-base/api/v1/software/?vendor=vendorName
import requests
# Enter your hostname (for example: myserver.com or 127.0.0.1) between the quotes.
hostname = 'enterHostnameOrIP'
# Replace username and password with your username and password credentials.
auth=('username', 'password')
url = 'https://'+hostname+'/ot-base/api/v1/software'
# Replace vendorName with a vendor name between the quotes.
params = {'vendor': 'enterVendorName'}
response = requests.get(url, auth=auth, params=params)
print(response.status_code)
print(response.text)
Wildcard search is supported by using the special character %.
Example:
GET ot-base/api/v1/software/?vendor=micro%
returns results both for the vendor name Microsoft and for Microsoft Corporation.
Retrieve particular software products, identified by product name
Retrieves all versions of a software product of a particular vendor. The name filter can only be used in conjunction with the vendor filter.
Note: Vendor and product names might need to be quoted if they contain special characters.
API Request
Python
Request:
GET ot-base/api/v1/software/?vendor=vendorName&name=productName
import requests
# Enter your hostname (for example: myserver.com or 127.0.0.1) between the quotes.
hostname = 'enterHostnameOrIP'
# Replace username and password with your username and password credentials.
auth=('username', 'password')
url = 'https://'+hostname+'/ot-base/api/v1/software'
params = {
'vendor': 'enterVendorName',
'name': 'enterProductName'
}
response = requests.get(url, auth=auth, params=params)
print(response.status_code)
print(response.text)
Retrieve particular software product versions
Retrieves product data for a particular software product version. The version filter can only be used in conjunction with the vendor and name filters.
Note: Vendor name, product name, and version number might need to be quoted if they contain special characters.
Request:
GET ot-base/api/v1/software/?vendor=vendorName&name=productName&version=versionNumber
Retrieve software products of a particular software category
Filtering by software category can be done by using the category filter. For example, the following query will output only operating systems.
API Request
Python
Request:
GET ot-base/api/v1/software/?category=os
import requests
# Enter your hostname (for example: myserver.com or 127.0.0.1) between the quotes.
hostname = 'enterHostnameOrIP'
# Replace username and password with your username and password credentials.
auth=('username', 'password')
url = 'https://'+hostname+'/ot-base/api/v1/software'
# Replace enterCategoryType with a category type that you've defined in Asset Center.
params = {'category': 'enterCategoryType'}
response = requests.get(url, auth=auth, params=params)
print(response.status_code)
print(response.text)
Category filters can be combined in order to search for multiple categories in one query. As an example, the following query retrieves both operating systems and security patches.
API Request
Python
Request:
GET ot-base/api/v1/software/?category=os,patch
import requests
# Enter your hostname (for example: myserver.com or 127.0.0.1) between the quotes.
hostname = 'enterHostnameOrIP'
# Replace username and password with your username and password credentials.
auth=('username', 'password')
url = 'https://'+hostname+'/ot-base/api/v1/software'
# Replace categoryType with a category type(s) that you've defined in Asset Center.
params = {'category': 'categoryType1, categoryType2'}
response = requests.get(url, auth=auth, params=params)
print(response.status_code)
print(response.text)
Retrieve software products installed at a particular location
You can limit the result set to products installed at a particular location by providing the location ID of that location using the parameter locationid.
API Request
Python
Request:
GET ot-base/api/v1/software/?locationid=usa
import requests
# Enter your hostname (for example: myserver.com or 127.0.0.1) between the quotes.
hostname = 'enterHostnameOrIP'
# Replace username and password with your username and password credentials.
auth=('username', 'password')
url = 'https://'+hostname+'/ot-base/api/v1/software'
# Replace enterLocationID with a location id that you've defined in Asset Center and place it in quotes.
params = {'locationid': 'enterLocationID'}
response = requests.get(url, auth=auth, params=params)
print(response.status_code)
print(response.text)
Retrieve software products in a particular product lifecycle stage
Filtering by product lifecycle stage is accomplished by using the lifecycle filter. It can take the values active, phaseout, end of support, and discontinued.
In the following example, we search for all Siemens software products for which support has ended.
API Request
Python
Request:
GET ot-base/api/v1/software/?vendor=siemens&lifecycle=end%20of%20support
import requests
# Enter your hostname (for example: myserver.com or 127.0.0.1) between the quotes.
hostname = 'enterHostnameOrIP'
# Replace username and password with your username and password credentials.
auth=('username', 'password')
url = 'https://'+hostname+'/ot-base/api/v1/software'
# Replace enterVendorName with a vendor and place it between qoutes.
# Replce enterLifecylce with one of the following ['active','phaseout','end of support','discontinued'].
params = {
'vendor': 'enterVendorName',
'lifecycle': 'enterLifecycle'
}
response = requests.get(url, auth=auth, params=params)
print(response.status_code)
print(response.text)
Comments
0 comments
Please sign in to leave a comment.