Export a defined software instance
A portable software instance is a set of portable files that represents the content of a z/OSMF software instance. An Export action on a software instance is used to create a portable software instance. You can use the POST method to perform an Export action on a software instance that is defined to z/OSMF, which generates a portable software instance descriptor file and JCL that when executed creates the archive files for a portable software instance, and store those files in a UNIX directory on the system where the software instance being exported resides.
HTTP method and URI path
POST /zosmf/swmgmt/swi/<system-nickname>/<swi-name>/export
POST /zosmf/swmgmt/swi/<swi-uuid>/export
- zosmf/swmgmt identifies the software management services.
- swi informs the service that the request is for the software instance object.
- <system-nickname>/<swi-name> further qualifies the request and
indicates the specific software instance to be exported. A software instance is uniquely identified
by its name (swi-name) and the nickname (system-nickname) of the z/OSMF host system that
has access to the volumes and data sets where the software instance resides.
To obtain information about the specified system, you can use the z/OSMF topology services. For more details, see Topology services.
In addition, the software instance UUID can be used instead of <system-nickname/swi-name> to identify a software instance.
- <swi-uuid> further qualifies the request and indicates the specific software instance to be exported. A software instance can be uniquely identified by using its UUID. A UUID is assigned to every software instance and can be obtained by using the REST API List the software instances defined to z/OSMF.
- /export indicates JCL to perform an export action for the software instance is to be generated.
Standard headers
Use the following standard HTTP headers with this request:
- Accept-Language
- Identifies the preferred language for messages that can be returned to the caller. Acceptable values are "Accept-Language: en" (English) and "Accept-Language: ja" (Japanese). Any other language value is ignored and English is used instead. In addition, if the header is not specified, then English is used.
- Content-Type
- Identifies the type of input content that is provided by the caller. The JSON content type("Content-Type: application/json") is used for the JSON document, if any, included as input with this request.
Custom headers
None.
Request content
{
"packagedir":"UNIX-directory",
"jcldataset":"data-set-name",
"includedlibs":"yes | no",
"datasetmergeallowed":"yes | no",
"signingcertificate":"certificate-label",
"keyring":"keyring-name" | "userid/keyring-name",
"jobstatement":["jclrecord"],
"unixdatasets":[{
"dsname":"data-set-name",
"mountpoint":"UNIX-path"
}],
"workdsnprefix":"data-set-name-prefix",
"workvolume":"volume-serial",
"workstorclas":"storage-class",
"zosmfuid":"user-id",
"zosmfpw":"password",
"proxyuid":"user-id",
"proxypw":"password"
}- packagedir
- UNIX directory to contain the files for the portable software instance.
- jcldataset
- Partitioned data set to contain the portable software instance descriptor file and the generated JCL.
- includedlibs
- If the software instance contains SMP/E managed software, this property indicates whether the distribution libraries and DLIB zones are to be included in the portable software instance.
- datasetmergeallowed
- Indicates whether the merging of the data sets is allowed when you deploy the portable software instance. This is an optional property. Can be "null", "yes" or "no". The default value is "no".
signingcertificate
The label to identify the certificate that is used to sign the portable software instance. This certificate is bound to the private key that is used to sign the GIMZIP package. It contains the matching public key that is used to verify the signature later. This is an optional property, but if specified, the portable software instance is digitally signed.
Certificate labels are from 1 to 32 characters in length and may include only characters X'40' through X'FE', excluding the reserved XML characters, less than (<), greater than (>), double quotation mark ("), and ampersand (&).
If you specify
signingcertificate, then you must also specifykeyring.
keyring
The security manager key ring that contains the specified signing certificate. The keyring must also contain all certificates in the certification path from the signing certificate to the issuing root CA certificate.
Key ring names are from 1 to 237 characters in length and may include only characters X'40' through X'FE', excluding the forward slash (/) and the reserved XML characters, less than (<), greater than (>), double quotation mark ("), and ampersand (&).
If the key ring is associated with a user ID other than the one that is used to execute the program GIMZIP, then the key ring name must be prefixed with the associated user ID. User IDs are from 1 to 8 alphanumeric characters in length, and can consist entirely of numbers and need not begin with any particular character. The user ID is separated from the key ring value by a forward slash (ie. userid/keyring).
If you specify keyring, then you must also specify
signingcertificate.
- jobstatement
- List of JCL cards for the JOB statement to be used in the generated JCL for the export operation.
- unixdatasets
- List of UNIX file system data sets in the software instance that are currently not mounted, and therefore, cannot be identified by z/OSMF by referencing the UNIX directories that are defined in the SMP/E target zone DDDEF entries.
- dsname
- Name of a UNIX file system data set.
- mountpoint
- Mount point for the UNIX file system data set, if the data set were mounted.
workdsnprefix
Data set name prefix for the work data sets that are created, used, and then deleted in the
generated Export JCL.
workvolume
Volume for the work data sets that are created, used, and then deleted in the generated Export
JCL.
workstorclas
Storage class for the work data sets that are created, used, and then deleted in the generated
Export JCL.
- zosmfuid
- Userid for authenticating with a remote z/OSMF instance.
- zosmfpw
- Password for authenticating with a remote z/OSMF instance.
- proxyuid
- Userid for authenticating with an HTTP proxy.
- proxypw
- Password for authenticating with an HTTP proxy.
Required authorizations
To submit requests through the software management services, the user ID initiating the request requires the same authorizations as when performing an analogous operation that uses the z/OSMF Software Management task. That is, to export a software instance, the user ID must have READ access to the Software Management task and READ access to the SAF resources for the software instance being exported. For information about access controls for the Software Management task, see Creating access controls for the Software Management task in IBM z/OS Management Facility Configuration Guide.
Usage considerations
Expected response
202 Accepted and a JSON
document containing a URL for the status monitor for the request. The client performs GET requests
to the supplied URL to monitor the status of the operation and to obtain the result set. For
example:{
"statusurl":"url"
}- statusurl
- Indicates the URL that provides status for the software instance export request.
- If the operation is not yet complete, an HTTP response code of
200 OKis returned, along with a JSON document containing status information for the operation. - If the operation has completed, then an HTTP response code of
200 OKis returned, along with a JSON document containing status information and the desired result set. - If the request has expired, then an HTTP response code of
404 Not foundis returned. That is, when the operation has completed, the z/OSMF server holds the result set for a finite length of time. After that time has passed, the result set is said to expire and will no longer be available for the client to obtain.
{
"status":"status",
"percentcomplete":"percent",
"jcl":["data-set-name(member-name)"]
}
- status
- The status of the export request. The status can be either "running" or "complete".
- percentcomplete
- The percentage of the processing that is complete for this export software instance request, expressed as a whole number from 0 to100.
- jcl
- Ordered list of generated jobs for the export action. Each job is a unique member in the JCL data set. The values are fully qualified data set and member names of the form "data-set-name(member-name)".
See Error handling for the error response document containing a reason code and a list of one or more message strings to describe the errors that are detected during processing of a request.
Example
POST /zosmf/swmgmt/swi/SYS123/DB2V9/export HTTP/1.1
Host: sys123.yourco.com
Content-Type: application/json
Accept-Language: en
{
"packagedir":"/u/userid/exportDir/",
"jcldataset":"USERID.SMJCL.CNTL",
"includedlibs":"yes",
"jobstatement":["//EXPORT JOB (123456),'USER',NOTIFY=&SYSUID,",
"// MSGCLAS=H","//*"]
}
HTTP/1.1 202 Accepted
Date: Tues, 21 November 2014 18:53:04 +00005GMT
Content-Type: application/json
Content-Language: en
Connection: close
{"statusurl":"https:\/\/sys123.yourco.com\/zosmf\/swmgt\/statusmonitor\/export\/4837290198343"}
GET /zosmf/swmgmt/statusmonitor/export/4837290198343 HTTP/1.1
Host: sys123.yourco.comHTTP/1.1 200 OK
Date: Tues, 21 November 2014 18:53:19 +00005GMT
Content-Type: application/json
Content-Language: en
Connection: close
{"status":"running", "percentcomplete":"65"}
GET /zosmf/swmgmt/statusmonitor/export/4837290198343 HTTP/1.1
Host: sys123.yourco.comHTTP/1.1 200 OK
Date: Tues, 21 November 2014 18:53:27 +00005GMT
Content-Type: application/json
Content-Language: en
Connection: close
{"status":"complete", "percentcomplete":"100",
"jcl":["USERID.SMJCL.CNTL(IZUD01EX)"]
}
Usage notes
The POST method to generate JCL that exports a software instance requires the subject software instance to be already defined to z/OSMF. If the software instance is not already defined, you can use the POST method to Add a new software instance to z/OSMF, followed by the PUT method to Load the products, features, and FMIDs for the new software instance if that software instance contains SMP/E managed software. Then, you can use the POST method to Export the software instance. For example:
POST /zosmf/swmgmt/swi HTTP/1.1
Host: sys123.yourco.com
Content-Type: application/json
Accept-Language: en
{
"name":"DB2V9",
"system":"sys123",
"description":"DB2",
"globalzone":"DB2.GLOBAL.CSI",
"targetzones":["DB2TGT"],
}PUT /zosmf/swmgmt/swi/sys123/DB2/products HTTP/1.1
Host: sys123.yourco.comPOST /zosmf/swmgmt/swi/sys123/DB2/export HTTP/1.1
Host: sys123.yourco.com
Content-Type: application/json
Accept-Language: en
{
"packagedir":"/u/userid/exportDir/",
"jcldataset":"USERID.SMJCL.CNTL",
"includedlibs":"yes",
,
"jobstatement":["//EXPORT JOB (123456),'USER',NOTIFY=&SYSUID,",
"// MSGCLAS=H","//*"]
}The response from the POST method to create JCL to export the software instance specifies the members in the JCL data set that contains the generated jobs to perform the export action. You can use the z/OS jobs REST interface to submit and obtain the status of the export job. For example:
PUT /zosmf/restjobs/jobs HTTP/1.1
Host: sys123.yourco.com
Content-Type: application/json
{
"file":"//'USERID.SMJCL.CNTL(IZUD01EX)'"
}The response to this PUT method provides the job ID and the job name for the submitted job.
GET /zosmf/restjobs/jobs/IZUD01EX/job-id HTTP/1.1
Host: sys123.yourco.comSample REXX exec
- Add a software instance.
- Load the SMP/E Products, Features, and FMIDs for the software instance.
- Generate JCL to export the software instance.
- Run the generated JCL to create a portable software instance.