From 90505a1a27ad8999b059c0049ba4ec9f672e5571 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Fri, 2 Sep 2022 16:58:34 -0400 Subject: [PATCH 1/4] Add swagger for dataset create api Signed-off-by: 1000TurquoisePogs --- plugins/zlux-agent/doc/swagger/fileapi.yaml | 159 +++++++++++++++++++- 1 file changed, 158 insertions(+), 1 deletion(-) diff --git a/plugins/zlux-agent/doc/swagger/fileapi.yaml b/plugins/zlux-agent/doc/swagger/fileapi.yaml index 5aa3bb67..2b13c790 100644 --- a/plugins/zlux-agent/doc/swagger/fileapi.yaml +++ b/plugins/zlux-agent/doc/swagger/fileapi.yaml @@ -169,7 +169,7 @@ paths: consumes: - application/json produces: - - text/json + - application/json responses: '200': description: successful operation @@ -177,6 +177,163 @@ paths: type: string '404': description: File could not be opened or does not exist + put: + summary: Creates a dataset + tags: + - Dataset + parameters: + - name: dataset + in: path + description: Cache results for future + required: true + type: string + - name: body + in: body + required: true + schema: + type: object + properties: + dsorg: + type: string + enum: [PS, PO] + blksz: + type: string + lrecl: + description: Desired record length as a number string + type: string + volser: + type: string + recfm: + type: string + enum: [A, B, F, U, V] + blkln: + description: The average data block length as a number string + type: string + ndisp: + type: string + default: CATLG + enum: [KEEP, CATLG] + unit: + description: Used to tell the system to place the data set on a specific device or group. Not needed when using SMS, use strcls instead. + type: string + strcls: + description: Desired SMS storage class + type: string + mngcls: + description: Desired SMS management class + type: string + datacls: + description: Desired SMS data class + type: string + space: + type: string + enum: [CYL, TRK] + dir: + type: string + prime: + type: string + description: Desired primary space quantity + secnd: + type: string + description: Desired secondary space quantity + avgr: + type: string + description: Specifies which allocation unit to be used + enum: [M, K, U] + dsnt: + type: string + description: Specifies which data set type to create + enum: [PDSE, PDS, HFS, EXTREQ, EXTPPREF, BASIC, LARGE] + consumes: + - application/json + produces: + - text/plain + responses: + '200': + description: Successfully created dataset + schema: + type: string + '400': + description: Invalid JSON + schema: + type: string + examples: + No JSON: + Cannot update file without JSON formatted record request + Invalid JSON: + Invalid JSON request body + '500': + description: Internal Server Error + schema: + type: string + examples: + DD Allocation Error: + Unable to allocate a DD for ACB + Unalloc error: + "error: ds unalloc dsn={dataset} dd=ddname, rc=rc sysRC=rc, sysRSN=rsn" + delete: + summary: Updates contents of dataset + tags: + - Dataset + parameters: + - name: dataset + in: path + description: The dataset (and optionally member name) to be deleted + required: true + type: string + consumes: + - application/json + produces: + - application/json + - text/plain + responses: + '200': + description: OK + schema: + type: object + properties: + msg: + type: string + examples: + Member deletion: + {msg: Data set member membername was deleted successfully} + Dataset deletion: + {msg: Data set dataset was deleted successfully} + '400': + description: VSAM dataset detected. Please use regular dataset route + schema: + type: string + '401': + description: Dataset {dataset} busy (%s) + schema: + type: string + '404': + description: Not found + schema: + type: string + examples: + Dataset not found: + Dataset or member does not exist {dataset} + Member not found: + Data set member does not exist + Device not available: + Device not available for dataset {dataset} + Catalog not available: + Catalog not available for dataset {dataset} + '500': + description: Internal Server Error + schema: + type: string + examples: + Dataset could not be opened: + Dataset could not be opened + Could not allocate member name: + Could not allocate member name + Member could not be deleted: + Member membername could not be deleted + DYNALLOC failure: + DYNALLOC failed with RC = rc, DYN RC = rc, RSN = rsn, dsn={dataset}, (site) + '/VSAMdatasetContents/{dataset}': get: summary: Get a VSAM dataset From d26892633b382594598ee8e92b6ebefa2c753cc9 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Fri, 2 Sep 2022 21:02:43 +0000 Subject: [PATCH 2/4] Update fileapi.yaml Signed-off-by: 1000TurquoisePogs --- plugins/zlux-agent/doc/swagger/fileapi.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/zlux-agent/doc/swagger/fileapi.yaml b/plugins/zlux-agent/doc/swagger/fileapi.yaml index 2b13c790..999e8cc4 100644 --- a/plugins/zlux-agent/doc/swagger/fileapi.yaml +++ b/plugins/zlux-agent/doc/swagger/fileapi.yaml @@ -272,7 +272,7 @@ paths: Unalloc error: "error: ds unalloc dsn={dataset} dd=ddname, rc=rc sysRC=rc, sysRSN=rsn" delete: - summary: Updates contents of dataset + summary: Delete a dataset or member tags: - Dataset parameters: From bbce08bdc4dc1867b658bb7d1a5d80646298afe3 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Mon, 12 Sep 2022 16:56:23 -0400 Subject: [PATCH 3/4] Update api to state which params are now numbers Signed-off-by: 1000TurquoisePogs --- plugins/zlux-agent/doc/swagger/fileapi.yaml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/plugins/zlux-agent/doc/swagger/fileapi.yaml b/plugins/zlux-agent/doc/swagger/fileapi.yaml index 999e8cc4..4acaac31 100644 --- a/plugins/zlux-agent/doc/swagger/fileapi.yaml +++ b/plugins/zlux-agent/doc/swagger/fileapi.yaml @@ -197,18 +197,18 @@ paths: type: string enum: [PS, PO] blksz: - type: string + type: number lrecl: - description: Desired record length as a number string - type: string + description: Desired record length + type: number volser: type: string recfm: type: string enum: [A, B, F, U, V] blkln: - description: The average data block length as a number string - type: string + description: The average data block length + type: number ndisp: type: string default: CATLG @@ -229,12 +229,12 @@ paths: type: string enum: [CYL, TRK] dir: - type: string + type: number prime: - type: string + type: number description: Desired primary space quantity secnd: - type: string + type: number description: Desired secondary space quantity avgr: type: string From ccedf85006e53bb995bfea8f442536546c89cd55 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Mon, 12 Sep 2022 17:02:25 -0400 Subject: [PATCH 4/4] Remove unit parameter Signed-off-by: 1000TurquoisePogs --- plugins/zlux-agent/doc/swagger/fileapi.yaml | 3 --- 1 file changed, 3 deletions(-) diff --git a/plugins/zlux-agent/doc/swagger/fileapi.yaml b/plugins/zlux-agent/doc/swagger/fileapi.yaml index 4acaac31..42eab10e 100644 --- a/plugins/zlux-agent/doc/swagger/fileapi.yaml +++ b/plugins/zlux-agent/doc/swagger/fileapi.yaml @@ -213,9 +213,6 @@ paths: type: string default: CATLG enum: [KEEP, CATLG] - unit: - description: Used to tell the system to place the data set on a specific device or group. Not needed when using SMS, use strcls instead. - type: string strcls: description: Desired SMS storage class type: string