CA Service Management

Expand all | Collapse all

Select Box in Catalog invoke REST or Curl

Jump to Best Answer
  • 1.  Select Box in Catalog invoke REST or Curl

    Posted 05-11-2018 01:10 PM

    Is it possible through a form with a select box from the Service Catalog I invoke a REST or Curl call?
    I ask this because I want a form field to bring the information of the Cluster on a given vCenter.

     

     

    I have the REST request:

    https://172.1.1.1/rest/vcenter/cluster?filter.datacenters=datacenter-2
    and return the Response:

    {
      "value": [
        {
          "drs_enabled": true,
          "cluster": "domain-1",
          "name": "VDI-01",
          "ha_enabled": true
        },
        {
          "drs_enabled": true,
          "cluster": "domain-2",
          "name": "VDI-02",
          "ha_enabled": false
        }
      ]
    }


  • 2.  Re: Select Box in Catalog invoke REST or Curl

    Posted 05-11-2018 03:07 PM

    Hi,

     

    Yes you can do this using AJAX. In your form script create a function to query your web service.  Then have the function called on change of your select field.



  • 3.  Re: Select Box in Catalog invoke REST or Curl

    Posted 05-15-2018 01:59 PM

    Would you have any examples of how to do this?



  • 4.  Re: Select Box in Catalog invoke REST or Curl

    Posted 05-15-2018 02:10 PM

    Yep no problem, here's a service offering/form which queries https://ipinfo.io/json and sets text fields based off the response.



  • 5.  Re: Select Box in Catalog invoke REST or Curl

    Broadcom Employee
    Posted 05-16-2018 11:36 AM

    Everton........

     

    Does the information provided by gbruneau help achieve your requirement?



  • 6.  Re: Select Box in Catalog invoke REST or Curl

    Posted 05-16-2018 11:41 AM

    Not exactly because I was not able to direct the values of the retry rest to values in a combo select



  • 7.  Re: Select Box in Catalog invoke REST or Curl
    Best Answer

    Posted 05-16-2018 11:48 AM

    Do you want to fill the text box with the response from vcenter or another select box? To fill a select box you'll need to use a java plugin as CA doesn't have a ca_fdSetOptions function. I suggest you vote for the idea to expose the SetOptions function.

    Create javascript API function ca_fdSetOptions