A macOS/iOS/iPadOS/tvOS/watchOS Swift-written library for z/OSMF REST API
The Zowe Swift Client SDK is an open-source Swift package for z/OSMF REST API. It allows you to leverage mainframe capabilities from your Swift applications with minimum effort.
Fore more details on Zowe Swift Client SDK debug version installation, follow this INSTALL.md
Start by importing the ZoweSDK class.
import ZoweSDK
Then create an object that will be the handler for all z/OSMF requests.
let z = ZoweSDK(
host: "<zosmf host>",
port: "<zosmf port>",
user: "<zosmf user>",
password: "<zosmf password>")
The SDK supports both manual authentication and Zowe z/OSMF mobile profiles. To create a Zowe z/OSMF mobile profile, use a regular Dictionary and store it in UserDefaults under the key with your chosen profile name.
let zoweProfile = [
"host": "<zosmf host>",
"port": "<zosmf port>",
"user": "<zosmf user>",
"password": "<zosmf password>"]
UserDefaults.standard.set(zoweProfile, forKey: "<profile name>")
Then to use a Zowe z/OSMF profile, simply inform the profile name while creating the object.
let z = ZoweSDK(profileName: "<profile name>")
Currently, the Zowe Swift Client SDK supports the following interfaces:
- z/OSMF information retrieval service
- Data sets and data set members creation/listing/reading/writing/deletion
- Jobs listing/submission/status retrieval/deletion, job spool files listing, job spool files/JCL contents retrieval
To retrieve information about z/OSMF on a particular z/OS system:
z.zosmf.getInfo() { response in
print(response)
}
Fore more details on z/OSMF for Zowe SDK package usage, follow this README.md
To create a data set (binary, C, classic, partitioned and sequential data set creation is currently supported):
z.files.createDsn(
datasetName: "<data set name>",
datasetType: .<binary|c|classic|partitioned|sequential>,
datasetAttributes: [<attributes dictionary>]
) { response in
print(response)
}
Fore more details on z/OS Files for Zowe SDK package usage, follow this README.md
To list the jobs for an owner, prefix, max-jobs and/or user-correlator:
z.jobs.listJobs(
owner: [<owner>],
prefix: [<prefix>],
maxJobs: [<max-jobs>],
userCorrelator: [<user-correlator>]
) { response in
print(response)
}
Fore more details on z/OS Jobs for Zowe SDK package usage, follow this README.md
- Make sure to check out the Zowe project!
- For further information on z/OSMF REST API, click HERE