configuration_item_info – List ServiceNow configuration item

Retrieve information about ServiceNow configuration item.

For more information, refer to the ServiceNow configuration item management documentation at https://docs.servicenow.com/bundle/quebec-servicenow-platform/page/product/configuration-management/concept/c_ITILConfigurationManagement.html.

New in version 1.0.0.

Examples

- name: Retrieve all configuration items
  servicenow.itsm.configuration_item_info:
  register: result

- name: Retrieve a specific configuration item by its sys_id
  servicenow.itsm.configuration_item_info:
    sys_id: 01a9ec0d3790200044e0bfc8bcbe5dc3
  register: result

- name: Retrieve all hardare configuration items
  servicenow.itsm.configuration_item_info:
    query:
      - category: = Hardware
  register: result

- name: Retrieve configuration items in hardware category assigned to abel.tuter or bertie.luby
  servicenow.itsm.configuration_item_info:
    query:
      - category: = hardware
        assigned_to: = abel.tuter
      - category: = hardware
        assigned_to: = bertie.luby

See Also

See also

  • modules/servicenow.itsm.configuration_item_module

Parameters

configuration_item_mapping (optional)

User mappings for Configuration item object.

Where mapping is not set, the default will be used.

type: dict
environment (optional)

The environment to which this configuration item belongs.

type: dict
install_status (optional)

The functional status of the configuration item.

Special value that can not be overridden is absent, which would remove a configuration item from ServiceNow.

type: dict
operational_status (optional)

The operational status of the configuration item.

type: dict
instance (optional)

ServiceNow instance information.

type: dict
client_id (optional)

ID of the client application used for OAuth authentication.

If not set, the value of the SN_CLIENT_ID environment variable will be used.

If provided, it requires client_secret.

type: str
client_secret (optional)

Secret associated with client_id. Used for OAuth authentication.

If not set, the value of the SN_CLIENT_SECRET environment variable will be used.

If provided, it requires client_id.

type: str
grant_type (optional)

Grant type used for OAuth authentication.

If not set, the value of the SN_GRANT_TYPE environment variable will be used.

type: str
default: password
choices: password, refresh_token
host (required)

The ServiceNow host name.

If not set, the value of the SN_HOST environment variable will be used.

type: str
password (optional)

Password used for authentication.

If not set, the value of the SN_PASSWORD environment variable will be used.

Required when using basic authentication or when grant_type=password.

type: str
refresh_token (optional)

Refresh token used for OAuth authentication.

If not set, the value of the SN_REFRESH_TOKEN environment variable will be used.

Required when grant_type=refresh_token.

type: str
timeout (optional)

Timeout in seconds for the connection with the ServiceNow instance.

If not set, the value of the SN_TIMEOUT environment variable will be used.

type: float
username (optional)

Username used for authentication.

If not set, the value of the SN_USERNAME environment variable will be used.

Required when using basic authentication or when grant_type=password.

type: str
query (optional)

Provides a set of operators for use with filters, condition builders, and encoded queries.

The data type of a field determines what operators are available for it. Refer to the ServiceNow Available Filters Queries documentation at https://docs.servicenow.com/bundle/quebec-platform-user-interface/page/use/common-ui-elements/reference/r_OpAvailableFiltersQueries.html.

type: list
sys_class_name (optional)

ServiceNow configuration item class.

The value of this parameter should point to a ServiceNow CMDB configuration item table, for instance cmdb_ci_server.

For a list of valid CMDB tables, refer to ServiceNow documentation on https://docs.servicenow.com/bundle/paris-servicenow-platform/page/product/configuration-management/reference/cmdb-tables-details.html.

If this parameter is unset when a configuration item info is queried, the default value cmdb_ci will be used.

type: str
sys_id (optional)

Unique identifier of the record to retrieve.

type: str

Return Values

record

A list of configuration item records.

Note that the fields of the returned records depend on the configuration item’s sys_class_name.

sample:

asset: 05a9ec0d3790200044e0bfc8bcbe5dc2
asset_tag: P1000440
assigned: '2019-02-28 08:00:00'
assigned_to: 8a826bf03710200044e0bfc8bcbe5d96
assignment_group: ''
attachments:
- average_image_color: ''
  chunk_size_bytes: '700000'
  compressed: 'true'
  content_type: text/plain
  download_link: https://www.example.com/api/now/attachment/919d34d50706301022f9ffa08c1ed047/file
  file_name: sample_file1.txt
  hash: 6f2b0dec698566114435a23f15dcac848a40e1fd3e0eda4afe24a663dda23f2e
  image_height: ''
  image_width: ''
  size_bytes: '210'
  size_compressed: '206'
  state: pending
  sys_created_by: admin
  sys_created_on: '2021-08-17 11:18:58'
  sys_id: 919d34d50706301022f9ffa08c1ed047
  sys_mod_count: '0'
  sys_tags: ''
  sys_updated_by: admin
  sys_updated_on: '2021-08-17 11:18:58'
  table_name: cmdb_ci
  table_sys_id: 459d34d50706301022f9ffa08c1ed06a
attestation_score: ''
attested: 'false'
attested_by: ''
attested_date: ''
attributes: ''
can_print: 'false'
category: Hardware
change_control: ''
checked_in: ''
checked_out: ''
comments: ''
company: 81fca4cbac1d55eb355b4b6db0e3c80f
correlation_id: ''
cost: '1699.99'
cost_cc: USD
cost_center: d9d01546c0a80a6403e18b82250c80a1
delivery_date: '2018-07-05 07:00:00'
department: a581ab703710200044e0bfc8bcbe5de8
discovery_source: ''
dns_domain: ''
due: ''
due_in: ''
duplicate_of: ''
environment: ''
fault_count: '0'
first_discovered: ''
fqdn: ''
gl_account: ''
install_date: '2018-10-02 07:00:00'
install_status: installed
invoice_number: ''
ip_address: ''
justification: ''
last_discovered: ''
lease_id: ''
life_cycle_stage: ''
life_cycle_stage_status: ''
location: 8228cda2ac1d55eb7029baf443945c37
mac_address: ''
maintenance_schedule: ''
managed_by: ''
managed_by_group: ''
manufacturer: aa0a6df8c611227601cd2ed45989e0ac
model_id: 0c43b858c611227501522de20c61ac75
model_number: ''
monitor: 'false'
name: ThinkStation S20
operational_status: operational
order_date: '2018-06-07 07:00:00'
owned_by: ''
po_number: PO100005
purchase_date: '2018-06-22'
schedule: ''
serial_number: WCL-206-Q10853-BF
short_description: ''
skip_sync: 'false'
start_date: ''
subcategory: Computer
support_group: ''
supported_by: ''
sys_class_name: cmdb_ci_computer
sys_class_path: /!!/!2/!(
sys_created_by: admin
sys_created_on: '2012-02-18 08:14:42'
sys_domain: global
sys_domain_path: /
sys_id: 01a9ec0d3790200044e0bfc8bcbe5dc3
sys_mod_count: '6'
sys_tags: ''
sys_updated_by: system
sys_updated_on: '2021-01-16 05:50:31'
unverified: 'false'
vendor: aa0a6df8c611227601cd2ed45989e0ac
warranty_expiration: '2021-10-01'