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

get rest api to work with 4.0 api structure, also took out oapi refer… #88

Merged
merged 4 commits into from
Feb 28, 2019

Conversation

pruan-rht
Copy link
Member

@pruan-rht pruan-rht commented Feb 25, 2019

…ences since it has become obsolete. According to the upstream documentation there are still differences between k8s and openshift in term of base URL. Introduce type to use to build the url to fetch from.

@pruan-rht pruan-rht added the CoreAutomation Framework related label Feb 25, 2019
@openshift-ci-robot openshift-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Feb 25, 2019
@pruan-rht
Copy link
Member Author

Please note that this fix applies to v4 (master) branch. Another separate fix is in #87

@pruan-rht pruan-rht removed the request for review from cjryan February 25, 2019 19:33
@akostadinov
Copy link
Contributor

I have created a v3 branch but already merged your other PR. And it was filed against master. So now there might be a little mess.

@pruan-rht
Copy link
Member Author

@akostadinov thanks...I think it should be ok, since we need to maintain both v3 and v4 per your discussion. #87 should still apply to master branch. Let me just file another one for the v3 branch

@pruan-rht
Copy link
Member Author

@akostadinov ok, I've resolved the conflicts

@pruan-rht pruan-rht mentioned this pull request Feb 26, 2019
return perform(**base_opts, method: "DELETE")
end

def self.list_projects(base_opts, opts)
populate("/projects", base_opts, opts)
def self.list_projects(base_opts, opts, type="project")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that type here should not be a parameter but hardcoded when calling populate method. Why would we ever want to specify a different type when calling list_projects?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, we can put it here or at the populate method as you suggested

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, please remove this parameter type from here as well other individual calls. populate looks good.

See my other comment. I would leave it to you about merging k8s and openshift calls in same place.

Copy link
Member Author

Choose a reason for hiding this comment

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

@akostadinov ok, I fixed that now.

@openshift-ci-robot openshift-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 27, 2019
return Http.request(**base_opts, method: "GET")
end

def self.post_role_oapi(base_opts, opts)
Copy link
Contributor

Choose a reason for hiding this comment

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

@pruan-rht any replacement for this method?

Copy link
Member Author

Choose a reason for hiding this comment

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

@stuartchuan, for 4.0, oapi has been removed, that's why I took out this method

def self.populate(path, base_opts, opts)
populate_common("/oapi/<oapi_version>", path, base_opts, opts)
def self.populate(path, base_opts, opts, type)
populate_common("/apis/#{type}.openshift.io/<api_version>", path, base_opts, opts)
Copy link
Contributor

Choose a reason for hiding this comment

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

Using api_version here is not correct. In fact all these something.openshift.io APIs may use different API version. But since it is less broken than before, we can merge as is to get something working. We need more investigation to figure out what might be an approach that makes sense.

/lgtm

Copy link
Member Author

Choose a reason for hiding this comment

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

What do you mean by may use different API version? Shouldn't they all be using the same api version?

Copy link
Contributor

Choose a reason for hiding this comment

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

well initial assumpion was that there will be one global API version like 1, 2, 3. Now they have multiple something.k8s.io and somehting.openshift.io APIs and each of them can have a different independent API level. Having a single parameter for this will not work.

On the other hand it can be overridden for each call so maybe will work. As long as it works now, I'm fine.

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Feb 28, 2019
@openshift-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akostadinov, pruan-rht

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [akostadinov,pruan-rht]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit a30bcbd into openshift:master Feb 28, 2019
@pruan-rht pruan-rht deleted the rest_api branch September 1, 2020 17:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. CoreAutomation Framework related lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants