cmci_get – Query CICS and CICSPlex SM resources and definitions¶
Synopsis¶
Get information about installed and definitional CICS® and CICSPlex® SM resources from CICS regions, by initiating GET requests via the CMCI REST API. The CMCI REST API can be configured in CICSPlex SM or stand-alone regions (SMSS). For information about the API, see CMCI REST API. For information about how to compose GET requests, see CMCI GET requests.
Parameters¶
- cmci_cert
Location of the PEM-formatted certificate chain file to be used for HTTPS client authentication.
Can also be specified using the environment variable CMCI_CERT.
Required if cmci_key is specified.
Authentication prioritises certificate authentication if cmci_cert and cmci_key are provided, then basic authentication if cmci_user and cmci_password are provided, and then unauthenticated if none is provided.
required: Falsetype: str- cmci_host
The TCP/IP host name of CMCI connection.
required: Truetype: str- cmci_key
Location of the PEM-formatted file storing your private key to be used for HTTPS client authentication.
Can also be specified using the environment variable CMCI_KEY.
Required if cmci_cert is specified.
Authentication prioritises certificate authentication if cmci_cert and cmci_key are provided, then basic authentication if cmci_user and cmci_password are provided, and then unauthenticated if none is provided.
required: Falsetype: str- cmci_password
The password of cmci_user to pass HTTP basic authentication.
Can also be specified using the environment variable CMCI_PASSWORD.
Required if cmci_user is specified.
Authentication prioritises certificate authentication if cmci_cert and cmci_key are provided, then basic authentication if cmci_user and cmci_password are provided, and then unauthenticated if none is provided.
required: falsetype: str- cmci_port
The port number of the CMCI connection.
required: Truetype: int- cmci_user
The user ID under which the CMCI request will run.
Can also be specified using the environment variable CMCI_USER.
Required if cmci_password is specified.
Authentication prioritises certificate authentication if cmci_cert and cmci_key are provided, then basic authentication if cmci_user and cmci_password are provided, and then unauthenticated if none is provided.
required: falsetype: str- context
If CMCI is installed in a CICSPlex® SM environment, context is the name of the CICSplex or CMAS associated with the request, for example,
PLEX1
. To determine whether a CMAS can be specified as context, see the CMAS context entry in the CICSPlex SM resource table reference of a resource. For example, according to the PROGRAM resource table, CMAS context is not supported for PROGRAM.If CMCI is installed in a single region (SMSS), context is the APPLID of the CICS region associate with the request.
The value of context must contain no spaces. context is not case-sensitive.
required: Truetype: str- fail_on_nodata
Specifies whether the module should fail if no data is returned by the query. If set to true, the module will fail if no data is returned.
Default behaviour is for the module to fail if no data is returned. When set to false, the module will return OK, just with no records.
required: Falsetype: booldefault: True- insecure
When set to
true
, disables SSL certificate trust chain verification when using HTTPS.required: Falsetype: bool- record_count
Identifies a subset of records in the results cache, starting either from the first record in the results cache or from the record specified by the index parameter. If not specified, all the records are returned by default.
A negative number indicates a count back from the last record; for example,
-1
means the last record,-2
the last record but one, and so on.The count value must be an integer; a value of zero is not permitted.
required: Falsetype: int- resources
Options that specify a target resource.
required: Falsetype: dict- complex_filter
A dictionary representing a complex filter expression. Complex filters are composed of filter expressions, represented as dictionaries. Each dictionary can specify either an attribute expression, a list of filter expressions to be composed with the
and
operator, or a list of filter expressions to be composed with theor
operator.The
attribute
,and
andor
options are mutually exclusive with each other.Can contain one or more filters. Multiple filters must be combined using
and
oror
logical operators.Filters can be nested.
When supplying the
attribute
option, you must also supply avalue
for the filter. You can also override the default operator of=
with theoperator
option.For examples, see “Examples” in ibm.ibm_zos_cics.cmci_get.
required: Falsetype: dict- and
A list of filter expressions to be combined with an
and
operation.Filter expressions are nested
complex_filter
elements. Each nested filter expression can be either anattribute
,and
oror
complex filter expression.required: Falsetype: list- attribute
The name of a resource table attribute on which to filter.
For supported attributes of different resource types, see their resource table reference, for example, PROGDEF resource table reference.
required: Falsetype: str- operator
These operators are accepted:
<
orLT
(less than),<=
orLE
(less than or equal to),=
orEQ
(equal to),>
orGT
(greater than),>=
orGE
(greater than or equal to),==
orIS
(is),¬=
,!=
, orNE
(not equal to). If not supplied whenattribute
is used,EQ
is assumed.required: Falsetype: strchoices: <, >, <=, >=, =, ==, !=, ¬=, EQ, GT, GE, LT, LE, NE, IS- or
A list of filter expressions to be combined with an
or
operation.Filter expressions are nested
complex_filter
elements. Each nested filter expression can be either anattribute
,and
oror
complex filter expression.required: Falsetype: list- value
The value by which you are to filter the resource attributes.
The value must be a valid one for the resource table attribute as documented in the resource table reference, for example, PROGDEF resource table reference.
required: Falsetype: str
- filter
A dictionary with attribute names as keys, and target values, to be used as criteria to filter the set of resources returned from CICSPlex SM.
Filters implicitly use the
=
operator.Filters for
string
type attributes can use the*
and+
wildcard operators.*
is a wildcard representing an unknown number of characters, and must appear at the end of the value.+
is a wildcard representing a single character, and can appear in any place in the value, potentially multiple times.To use more complicated filter expressions, including a range of different filter operators, and the ability to compose filters with
and
andor
operators, see thecomplex_filter
parameter.For more details, see How to build a filter expression.
For examples, see ibm.ibm_zos_cics.cmci_get.
For supported attributes of different resource types, see their resource table reference, for example, PROGDEF resource table reference.
required: Falsetype: dict- get_parameters
A list of one or more parameters with optional values used to identify the resources for this request. Eligible parameters for identifying the target resources can be found in the resource table reference for the target resource type, as valid parameters for the GET operation in the “Valid CPSM operations” table. For example, the valid parameters for identifying a PROGDEF resource are CICSSYS, CSDGROUP and RESGROUP, as found in the PROGDEF resource table reference.
required: Falsetype: list- name
Parameter name available for the GET operation.
required: Truetype: str- value
Parameter value if any.
required: Falsetype: str
- scheme
The HTTP scheme to use when establishing a connection to the CMCI REST API.
required: falsetype: strdefault: httpschoices: http, https- scope
Specifies the name of a CICSplex, CICS region group, CICS region, or logical scope that is associated with the query.
scope is a subset of context and limits the request to particular CICS systems or resources.
scope is optional. If it’s not specified, the request is limited by the value of context alone.
The value of scope must contain no spaces. scope is not case-sensitive.
required: falsetype: str- timeout
HTTP request timeout in seconds
required: Falsetype: intdefault: 30- type
The CMCI external resource name that maps to the target CICS or CICSPlex SM resource type. For a list of CMCI external resource names, see CMCI resource names.
required: Truetype: str
Examples¶
- name: get 2 LOCFILEs from a CICSplex
cmci_get:
cmci_host: "winmvs2c.hursley.ibm.com"
cmci_port: 10080
cmci_user: "ibmuser"
cmci_password: "123456"
context: "iyk3z0r9"
type: CICSLocalFile
record_count: 2
resource:
filter:
dsname: "CTS*"
- name: get a localfile in a CICS region
cmci_get:
cmci_host: "winmvs2c.hursley.ibm.com"
cmci_port: 10080
cmci_cert: "./sec/ansible.pem"
cmci_key: "./sec/ansible.key"
context: "iyk3z0r9"
type: "CICSLocalFile"
resources:
filter:
dsname: "XIAOPIN*"
file: "DFH*"
record_count: 1
- name: get a progdef from a CSD
cmci_get:
cmci_host: "winmvs2c.hursley.ibm.com"
cmci_port: 10080
cmci_cert: "./sec/ansible.pem"
cmci_key: "./sec/ansible.key"
context: "iyk3z0r9"
type: cicsdefinitionprogram
resources:
filter:
name: MYPROG
get_parameters:
- name: csdgroup
value: MYGRP
record_count: 1
- name: pass module even if bundle definition is not found
cmci_get:
cmci_host: "winmvs2c.hursley.ibm.com"
cmci_port: 10080
cmci_cert: "./sec/ansible.pem"
cmci_key: "./sec/ansible.key"
context: "iyk3z0r9"
type: cicsdefinitionbundle
resources:
filter:
name: MYBUNDLE
get_parameters:
- name: csdgroup
value: MYGRP
record_count: 1
fail_on_nodata: "false"
- name: Using complex_filter to combine filter expressions and change operators
cmci_get:
cmci_host: "winmvs2c.hursley.ibm.com"
cmci_port: 10080
cmci_cert: "./sec/ansible.pem"
cmci_key: "./sec/ansible.key"
context: "iyk3z0r9"
type: "CICSRegion"
resources:
complex_filter:
or:
[
{ attribute: "currtasks", value: "10", operator: "<" },
{ attribute: "currtasks", value: "100", operator: ">" },
]
record_count: 1
Return Values¶
- changed
True if the state was changed, otherwise False.returned: alwaystype: bool- failed
True if the query job failed, otherwise False.returned: alwaystype: bool- connect_version
Version of the CMCI APIreturned: successtype: str- cpsm_reason
The character value of the REASON code returned by each CICSPlex SM API command. For a list of REASON character values, see https://www.ibm.com/docs/en/cics-ts/latest?topic=values-eyuda-reason-in-alphabetical-order.returned: successtype: str- cpsm_reason_code
The numeric value of the REASON code returned by each CICSPlex SM API command. For a list of REASON numeric values, see https://www.ibm.com/docs/en/cics-ts/latest?topic=values-eyuda-reason-in-numerical-order.returned: successtype: int- cpsm_response
The character value of the RESPONSE code returned by each CICSPlex SM API command. For a list of RESPONSE character values, see https://www.ibm.com/docs/en/cics-ts/latest?topic=values-eyuda-response-in-alphabetical-order.returned: successtype: str- cpsm_response_code
The numeric value of the RESPONSE code returned by each CICSPlex SM API command. For a list of RESPONSE numeric values, see https://www.ibm.com/docs/en/cics-ts/latest?topic=values-eyuda-response-in-numerical-order.returned: successtype: str- http_status
The message associated with HTTP status code that is returned by CMCI.returned: successtype: str- http_status_code
The HTTP status code returned by CMCI.returned: successtype: int- record_count
The number of records returned.returned: successtype: int- records
A list of the returned records.returned: successtype: listsample:[{"_keydata": "C1D5E2C9E3C5E2E3", "aloadtime": "00:00:00.000000", "apist": "CICSAPI", "application": "", "applmajorver": "-1", "applmicrover": "-1", "applminorver": "-1", "basdefinever": "0", "cedfstatus": "CEDF", "changeagent": "CSDAPI", "changeagrel": "0730", "changetime": "2020-12-15T02:34:31.000000+00:00", "changeusrid": "YQCHEN", "coboltype": "NOTAPPLIC", "concurrency": "QUASIRENT", "copy": "NOTREQUIRED", "currentloc": "NOCOPY", "datalocation": "ANY", "definesource": "ANSITEST", "definetime": "2020-12-15T02:34:29.000000+00:00", "dynamstatus": "NOTDYNAMIC", "entrypoint": "FF000000", "execkey": "USEREXECKEY", "executionset": "FULLAPI", "eyu_cicsname": "IYCWEMW2", "eyu_cicsrel": "E730", "eyu_reserved": "0", "fetchcnt": "0", "fetchtime": "00:00:00.000000", "holdstatus": "NOTAPPLIC", "installagent": "CSDAPI", "installtime": "2020-12-15T02:34:33.000000+00:00", "installusrid": "YQCHEN", "jvmclass": "", "jvmserver": "", "language": "NOTDEFINED", "length": "0", "library": "", "librarydsn": "", "loadpoint": "FF000000", "lpastat": "NOTAPPLIC", "newcopycnt": "0", "operation": "", "pgrjusecount": "0", "platform": "", "program": "ANSITEST", "progtype": "PROGRAM", "remotename": "", "remotesystem": "", "removecnt": "0", "rescount": "0", "residency": "NONRESIDENT", "rloading": "0.000", "rplid": "0", "rremoval": "0.000", "runtime": "UNKNOWN", "ruse": "0.000", "sharestatus": "PRIVATE", "status": "DISABLED", "transid": "", "useagelstat": "0", "usecount": "0", "usefetch": "0.000"}]- request
Information about the request that was made to CMCI.returned: successtype: dict
- body
The XML body sent with the request, if any.returned: successtype: str- method
The HTTP method used for the request.returned: successtype: str- url
The URL used for the request.returned: successtype: str- feedback
Diagnostic data from FEEDBACK records associated with the requestreturned: cmci errortype: list
- action
The name of the action that has failed.returned: cmci errortype: str- attribute1
The name of one of up to six attributes associated with the error.returned: cmci errortype: str- attribute2
The name of one of up to six attributes associated with the error.returned: cmci errortype: str- attribute3
The name of one of up to six attributes associated with the error.returned: cmci errortype: str- attribute4
The name of one of up to six attributes associated with the error.returned: cmci errortype: str- attribute5
The name of one of up to six attributes associated with the error.returned: cmci errortype: str- attribute6
The name of one of up to six attributes associated with the error.returned: cmci errortype: str- eibfn
The function code associated with the request.returned: cmci errortype: str- eibfn_alt
The name of the function associated with the request.returned: cmci errortype: str- errorcode
The CICSPlex® SM error code associated with the resource.returned: cmci errortype: str- eyu_cicsname
The name of the CICS region or CICSplex associated with the error.returned: cmci errortype: str- keydata
A string of data that identifies the instance of a resource associated with the error.returned: cmci errortype: str- resp
The CICS RESP code or the CICSPlex SM API EYUDA response code as a numeric value.returned: cmci errortype: str- resp2
The CICS RESP2 code or the CICSPlex SM API EYUDA reason code as a numeric value.returned: cmci errortype: str- resp_alt
The text equivalent for the resp value. For example, the text equivalent of a resp value of 16 is INVREQ.returned: cmci errortype: str- installerror
Contains diagnostic data from a BINSTERR record associated with a CICS® management client interface PUT install request.returned: cmci errortype: list
- eibfn
The function code associated with the request.returned: cmci errortype: str- eyu_cicsname
The name of the CICS region or CICSplex associated with the installation error.returned: cmci errortype: str- cresp1
The CICS RESP code or the CICSPlex® SM API EYUDA response code as a numeric value.returned: cmci errortype: str- cresp2
The CICS RESP2 code or the CICSPlex SM API EYUDA reason code as a numeric value.returned: cmci errortype: str- errorcode
The CICSPlex SM error code associated with the resource.returned: cmci errortype: str- ressname
The name of the resource associated with the error.returned: cmci errortype: str- resver
The version number of the resource associated with the error.returned: cmci errortype: str- inconsistentscope
Contains diagnostic data from a BINCONSC record associated with a CICS® management client interface PUT request.returned: cmci errortype: list
- eibfn
The function code associated with the request.returned: cmci errortype: str- eyu_cicsname
The name of the CICS region or CICSplex associated with the installation error.returned: cmci errortype: str- erroroperation
A numeric value that identifies the operation being performed when the error occurred.returned: cmci errortype: str- errorcode
The CICSPlex® SM error code associated with the resource.returned: cmci errortype: str- targetassignment
The assignment for the target scope.returned: cmci errortype: str- targetdescription
The resource description for the target scope.returned: cmci errortype: str- relatedassignment
The resource assignment for the related scope.returned: cmci errortype: str- relateddescription
The resource description for the related scope.returned: cmci errortype: str- relatedscope
The name of the related scope.returned: cmci errortype: str- inconsistentset
Contains diagnostic data from a BINCONRS record associated with a CICS® management client interface PUT request.returned: cmci errortype: list
- candidatename
The name of the candidate resource.returned: cmci errortype: str- candidateversion
The version number of the candidate resource.returned: cmci errortype: str- candidategroup
The resource group of the candidate resource.returned: cmci errortype: str- candidateassignment
The assignment of the candidate resource.returned: cmci errortype: str- candidatedescription
The description of the candidate resource.returned: cmci errortype: str- candidateusage
The assignment usage of the candidate resource.returned: cmci errortype: str- candidatesystemgroup
The system group of the candidate resource.returned: cmci errortype: str- candidatetype
The system type of the candidate resource.returned: cmci errortype: str- candidateoverride
The assignment override of the candidate resource.returned: cmci errortype: str- eyu_cicsname
The name of the CICS region associated with the installation error.returned: cmci errortype: str- erroroperation
A numeric value that identifies that the operation being performed when the error occurredreturned: cmci errortype: str- existingname
The name of the existing resource.returned: cmci errortype: str- existingversion
The version number of the existing resource.returned: cmci errortype: str- existinggroup
The resource group of the existing resource.returned: cmci errortype: str- existingassignment
The assignment of the existing resource.returned: cmci errortype: str- existingdescription
The description of the existing resource.returned: cmci errortype: str- existingusage
The assignment usage of the existing resource.returned: cmci errortype: str- existingsystemgroup
The system group of the existing resource.returned: cmci errortype: str- existingtype
The system type of the existing resource.returned: cmci errortype: str- existingoverride
The assignment override of the existing resource.returned: cmci errortype: str