3 Replies Latest reply on May 2, 2019 3:36 AM by TimDScott

    Setting vRA service icons from vRO

    TimDScott Novice

      Hi All,

       

      I'm working on creating vRA services from a vRO workflow.

       

      The service creation is working fine, but I need to set the service's icon. I found this:

       

      https://michaelpoore.com/2017/03/how-to-change-the-vra-7-2-all-services-icon-using-vro/

       

      This changes the "All services" icon. I just want to change the icon of the service that I'm creating, basically I think I need a different Id for this line in the example above:

       

      iconObj.setId("cafe_default_icon_genericAllServices");

       

      Any ideas?

       

      Thanks,

       

      Tim.

       

        • 1. Re: Setting vRA service icons from vRO
          eoinbyrne Hot Shot

          What happens if you specify your own ID there? As in, generate an ID string and try the Icon upload.

           

          When it comes to a single service, the API docs indicate that the service definition includes the ID of the Icon to display. From doing this via the UI in vRA you can upload your choice of icon file which implies that the ID is just generated after the upload and then it is attached to the service definition afterwards?

           

          The constant key string in the example from @mpoore most likely relates to a global internal constant value in vRA

          • 2. Re: Setting vRA service icons from vRO
            iiliev Champion
            VMware EmployeesCommunity Warriors

            Hi Tim,

             

            Yes, you need a different ID here. Pick one that is likely to be unique to your service, like "timscott_default_icon_myCustomService".

             

            Another important point - you'll need a code to attach this icon to your service. You haven't shown your service creation code, but I think you'll need to call the method vCACCAFEService#setIconId(...) on your service when you are creating it.

             

            I haven't tested this, but in theory it should work.

            • 3. Re: Setting vRA service icons from vRO
              TimDScott Novice

              Thanks Llian, I understand now!