openshift/api

no high level end user api for primary operations like application deployment

izapolsk opened this issue · 9 comments

Existing openshift's rest api is low level and doesn't allow to do primary operations like application deployment, status check, etc.
If I'd like to deploy some application from template thru api, I go through the following steps:

  1. create new project (oc new-project).
    Issues: when I create project thru api, I get project w/o role bindings.
  2. create necessary persistent volumes (oc process/create)
    Issues: there is no api to process templates, nfs/hostPath pvs cannot create folders
  3. process and deploy template (oc process/oc create/oc new-app)
    Issues: no processing templates, code should recognize type of each template object and create it by appropriate api call

So, it would be great to implement some end user api like it can be done using oc command.

Issues: when I create project thru api, I get project w/o role bindings.

We're adding a controller in 3.10. The pull is currently open for review.

Issues: no processing templates, code should recognize type of each template object and create it by appropriate api call

See /apis/template.openshift.io/v1/processedtemplates which accepts a template and processes it for you. It returns a list, which can then be generically handled if you want to create generic objects.

Are you actually asking for a way to issue a generic "create this" without indicating which API endpoint to use?

nfs/hostPath pvs cannot create folders

I don't understand what this is asking for.

See /apis/template.openshift.io/v1/processedtemplates which accepts a template and processes it for you. It returns a list, which can then be generically handled if you want to create generic objects.
I didn't manage to figure out how I can pass parameters to template before processing it by processedtemplates.

Are you actually asking for a way to issue a generic "create this" without indicating which API endpoint to use?
honestly, I'm rather asking for some api which would allow me to easily deploy app from template similar to oc new-app or oc process + oc create.

I don't understand what this is asking for.
This issue is rather related to persistent volumes than api. I mentioned it here just because I bump into it only when I use api. openshift/origin#18817

See /apis/template.openshift.io/v1/processedtemplates which accepts a template and processes it for you. It returns a list, which can then be generically handled if you want to create generic objects.
I didn't manage to figure out how I can pass parameters to template before processing it by processedtemplates.

You set the values inside of the template object before you submit it.

You set the values inside of the template object before you submit it.
sure, I had to add a procedure which would process template and replace default parameter values with my values. However, I woudn't say this is convenient. especially for parameters with 'generate' function.
That's the reason why I ask for high level api where I don't need to process templates by my own scripts or check its object type in order to figure out which api call I should use.

cben commented

Can some documentation be added for how to use /processedtemplates endpoint? Current docs are not useful, /templates and /processedtemplates endpoints as described as pretty much the same, with POST to /processedtemplates described as "Create a template". But it doesn't really create anything, just returns result of substitutions, right?
The docs also seem to have some mixup about kind.
See openshift/origin#21668 with details.

Issues go stale after 90d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle stale

Stale issues rot after 30d of inactivity.

Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.

If this issue is safe to close now please do so with /close.

/lifecycle rotten
/remove-lifecycle stale

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

@openshift-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.

Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.