Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API for Dataset/Dataset Member Allocation #473

Open
wants to merge 8 commits into
base: v2.x/staging
Choose a base branch
from

Conversation

aditya-ranshinge
Copy link
Contributor

@aditya-ranshinge aditya-ranshinge commented May 16, 2022

Proposed changes

API for Dataset/Dataset Member Allocation was implemented in #351 this PR , which was reviewed by Leonty.
This PR is continuation of above mentioned PR where Allocation Unit, Average Record Unit, Primary Space, Secondary Space, Directory Blocks, Dataset Name Type attributes added for dataset creation.

This pull request implements the following feature:

  • API which enables the allocation of datasets and dataset members.
  • Add 'PUT' method to /datasetContents, accepts JSON body to specify dataset parameters

This PR depends upon the following PRs:
zowe/zowe-common-c#292

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Change in a documentation
  • Refactor the code
  • Chore, repository cleanup, updates the dependencies.
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

PR Checklist

Please delete options that are not relevant.

  • If the changes in this PR are meant for the next release / mainline, this PR targets the "staging" branch.
  • My code follows the style guidelines of this project (see: Contributing guideline)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • New and existing unit tests pass locally with my changes
  • video or image is included if visual changes are made
  • Relevant update to CHANGELOG.md
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works, or describe a test method below

Testing

Further comments

…Directory Blocks, Dataset Name Type attributes for dataset creation

Signed-off-by: Aditya Ranshinge <[email protected]>
Signed-off-by: Aditya Ranshinge <[email protected]>
@aditya-ranshinge aditya-ranshinge marked this pull request as ready for review May 17, 2022 11:36
@ifakhrutdinov
Copy link
Contributor

ifakhrutdinov commented May 23, 2022

I'll review this once the zowe-common-c PR has been figured out.

Signed-off-by: Aditya Ranshinge <[email protected]>
…emoved unwanted functions and macros

Signed-off-by: Aditya Ranshinge <[email protected]>
Signed-off-by: Aditya Ranshinge <[email protected]>
c/datasetjson.c Outdated
rc = setTextUnit(TEXT_UNIT_INT24, 0, NULL, toi, DALBLKLN, configsCount, inputTextUnit);
}
}
} else if(!strcmp(propString, "status")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be called disp, not status, because disp is the term that everyone knows.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

c/datasetjson.c Outdated
} else if (!strcmp(propString, "ndisp")) {
if (!strcmp(valueString, "UNCATLG")){
parmDefn = DISP_UNCATLG;
} else if (!strcmp(valueString, "DELETE")){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if delete deletes... this shouldnt be in the PUT api at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will remove it from PUT api

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

}
rc = setTextUnit(TEXT_UNIT_CHAR, 0, NULL, parmDefn, DALSTATS, configsCount, inputTextUnit);
} else if (!strcmp(propString, "ndisp")) {
if (!strcmp(valueString, "UNCATLG")){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'd like to know more about uncatalog to know if this is something we should be allowing the users to do.

Copy link
Contributor Author

@aditya-ranshinge aditya-ranshinge Aug 3, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is very limited IBM documentation about UNCATLG parameter.
Explanation of other parameters is present but links pointing to UNCATLG doesn't have contents like this link https://www.ibm.com/docs/en/zos/2.1.0?topic=parameter-uncataloging-data-set

But what I have got so far is "In UNCATLG case the data set exists but it deletes the catalog entry from the catalog file. "

@1000TurquoisePogs
Copy link
Member

I didn't mark this PR as bad or good but rather just saw some things that made me thing we should ask a senior mainframe user to get opinions on whether we should restrict the API to avoid people accidentally doing things they will regret due to having options they dont understand.

if (valueStrLen <= CLASS_WRITER_SIZE){
rc = setTextUnit(TEXT_UNIT_STRING, valueStrLen, &(valueString)[0], 0, DALSPGNM, configsCount, inputTextUnit);
}
} else if(!strcmp(propString, "close")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

meaning "autounallocate"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want me to add "autounallocate" comment here?
I have referred these docs https://www.ibm.com/docs/en/zos/2.4.0?topic=units-unallocation-close-specification-key-001c

c/datasetjson.c Outdated
if (valueStrLen <= DD_NAME_LEN){
rc = setTextUnit(TEXT_UNIT_STRING, DD_NAME_LEN, &(valueString)[0], 0, DALRTDDN, configsCount, inputTextUnit);
}
} else if(!strcmp(propString, "spin")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resolved

Signed-off-by: Aditya Ranshinge <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants