<div dir="ltr"><div><div><div><div>Hey Siamak,<br><br></div>In the apb tool, there's the command ```apb serviceinstance```. It will generate 'most' of a serviceinstance template.  You will still need to lookup the external name, so I recommend using ```oc get clusterserviceclass -o custom-columns=Name:spec.externalName,externalID:spec.externalID,Broker:spec.clusterServiceBrokerName```.<br><br></div>The 'serviceinstance' <a href="https://github.com/ansibleplaybookbundle/ansible-playbook-bundle/blob/master/src/apb/engine.py#L1235">command</a> has a lot of potential improvement, so if you have anything you want to contribute feel free to!<br><br></div>Thanks,<br></div>-Ryan<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 16, 2018 at 8:41 AM, Siamak Sadeghianfar <span dir="ltr"><<a href="mailto:ssadeghi@redhat.com" target="_blank">ssadeghi@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>I have been trying to use oc to create services so that it can be automated in Jenkins, etc. There is a flow that works but leaves quite a lot to be desired. Is there a better way to do this with "oc new-app" similar to images, imagestreams and templates?</div><div><br></div><div>Here is the flow:</div><div><br></div><div><div>1. List APBs</div><div><br></div><div><font face="monospace">oc get clusterserviceclasses --all-namespaces -o custom-columns=NAME:.<a href="http://metadata.name" target="_blank">metadata.<wbr>name</a>,DISPLAYNAME:spec.<wbr>externalMetadata.displayName | grep APB</font></div><div><br></div><div>2. Find out the selected APB's external name</div><div><br></div><div><font face="monospace">oc get clusterserviceclasses e171fe1a84c3750a0957e7e917af95<wbr>30 -o yaml</font></div><div><br></div><div>3. Find the source of the APB (apb.yml) to figure out the parameter names and plans e.g.</div><div><a href="https://github.com/ansibleplaybookbundle/postgresql-apb/blob/master/apb.yml" target="_blank">https://github.com/<wbr>ansibleplaybookbundle/<wbr>postgresql-apb/blob/master/<wbr>apb.yml</a></div><div><br></div><div>4. Create a yml file for the serviceinstance, specifying values for external apb name, params, plans, etc</div><div><br></div><div>5. Create the service instance using CLI</div><div><font face="monospace">oc create -f postgresql-si.yml</font></div></div><div><font face="monospace"><br></font></div><div><font face="monospace"><br></font></div><div>Kind Regards,</div><div><div dir="ltr"><div dir="ltr"><div dir="ltr"><div><font face="arial, helvetica, sans-serif">Siamak Sadeghianfar</font></div><div><font face="arial, helvetica, sans-serif">Principal Technical Marketing Manager</font></div><div><span style="font-family:arial,helvetica,sans-serif">OpenShift, Red Hat Inc.</span></div><div><font face="arial, helvetica, sans-serif">M: <a href="tel:+46%2073%20183%2055%2053" value="+46731835553" target="_blank">+46-73-183-5553</a> | T: @siamaks<br></font></div><div><font face="arial, helvetica, sans-serif"><a href="http://redhat.com" target="_blank">redhat.com</a> | TRIED. TESTED. TRUSTED.</font><br></div></div>
<br></div></div></div><div><font face="monospace"><br></font></div><div><font face="monospace"><br></font></div></div>
<br>______________________________<wbr>_________________<br>
Ansible-service-broker mailing list<br>
<a href="mailto:Ansible-service-broker@redhat.com">Ansible-service-broker@redhat.<wbr>com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/ansible-service-broker" rel="noreferrer" target="_blank">https://www.redhat.com/<wbr>mailman/listinfo/ansible-<wbr>service-broker</a><br>
<br></blockquote></div><br></div>