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

feat: add v1beta1 api endpoints #70

Merged
merged 1 commit into from
May 24, 2018
Merged

feat: add v1beta1 api endpoints #70

merged 1 commit into from
May 24, 2018

Conversation

lance
Copy link
Member

@lance lance commented May 23, 2018

This commit adds the set of v1beta1 endpoint URLs documented here:
https://docs.openshift.com/container-platform/3.7/rest_api/index.html

The only functional endpoint at the moment is for deployments. All of
the others simply expose the endpoint URL but do expose any functional
behavior.

I've added a client.apis object which maps to the the 3 semi-supported
APIs at the moment.

client.apis.oapi // { version: config.apiVersion, baseUrl: client.apiUrl }
client.apis.kube // { version: config.apiVersion, baseUrl: client.kubeUrl }
client.apis.v1beta1 // function endpoints() returning array of endpoint URLs

Not sure if this is ready to merge or not. I think it's a good first step,
and will give me what I need in nodeshift for nodeshift/nodeshift#228
but it almost feels like there's a major refactoring that could take place
where the lib directory is split between the various supported APIs.

For example:

.
└── lib
    ├── kube
    ├── oapi
    └── v1beta1

To actually do all of this could be quite large, however. So maybe this
commit is good for a minor version release, and the bigger changes can
come later with a major version bump.

Connects to: #69

@coveralls
Copy link

coveralls commented May 23, 2018

Coverage Status

Coverage decreased (-0.07%) to 97.603% when pulling ca2d12b on add-v1beta1-apis into 5ba0109 on master.

routes: routes,
secrets: secrets,
services: services
buildconfigs,
Copy link
Member

Choose a reason for hiding this comment

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

heh, i actually have this changed in my branch where i'm switching to XO, so +1 :)

.apps}/namespaces/${clientConfig
.context.namespace}/deployments`;

console.log('find all at ', url);
Copy link
Member

Choose a reason for hiding this comment

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

probably remove this

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops - that's a stray.

@lholmquist
Copy link
Member

@lance i agree about the refactoring. in fact, there could be a lot more than just what you mentioned, that actually removes a lot of code since most, probably all, GET, POST, etc... are the same.

But you are right, that shouldn't really be part of this PR, but a major version release after the refactor.

@lholmquist
Copy link
Member

speaking of endpoints, #42.

i forgot about this one. i wonder during the refactor, if we should be changing the apis to look like this

This commit adds the set of v1beta1 endpoint URLs documented here:
https://docs.openshift.com/container-platform/3.7/rest_api/index.html

The only functional endpoint at the moment is for deployments. All of
the others simply expose the endpoint URL but do expose any functional
behavior.

I've added a `client.apis` object which maps to the the 3 semi-supported
APIs at the moment.

```js
client.apis.oapi // { version: config.apiVersion, baseUrl: client.apiUrl }
client.apis.kube // { version: config.apiVersion, baseUrl: client.kubeUrl }
client.apis.v1beta1 // function endpoints() returning array of endpoint URLs
```

Not sure if this is ready to merge or not. I think it's a good first step,
and will give me what I need in nodeshift for nodeshift/nodeshift#228
but it almost feels like there's a major refactoring that could take place
where the `lib` directory is split between the various supported APIs.

For example:

```bash
.
└── lib
    ├── kube
    ├── oapi
    └── v1beta1
```

To actually do all of this could be quite large, however. So maybe this
commit is good for a minor version release, and the bigger changes can
come later with a major version bump.
@lance lance merged commit cb8da7a into master May 24, 2018
@lance lance deleted the add-v1beta1-apis branch May 24, 2018 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants