Configuring the CloudBees Analytics server

Service catalog

9 minute readExtensibility

The CloudBees CD/RO Service catalog helps you accelerate application deployment. This feature lets you automate routine deployment tasks and publish them as templates so that end users can use them by providing minimal information and without learning to use CloudBees CD/RO.

As shipped, CloudBees CD/RO includes five standard catalogs: Applications, Cloud Provisioning, Containers, Pipelines, and Utilities; all standard catalogs are included in the CloudBees project.

Using Service catalog

Use the information below to use service catalog features.

Service catalog
Figure 1. Service catalog
1 Use these features to:
  • Locate a specific templates by entering text into Search field.

  • Select tags to narrow displayed items.

  • Select the item link to access the catalog item template.

2 Manage catalog:
  • Create a custom catalog by selecting the New catalog New catalog.

  • Use Filters menu to:

    • Sort catalog items by chosen filter option.

    • Modify or delete a filter.

  • Create a new catalog item filter by selecting New filter New filter.

Manage catalog item filters

Use the steps in this section to create, modify or delete catalog item filters.

Adding a catalog item filer

  1. Select the New filter New filter.

  2. Select the parameter name from the Field menu.

  3. Select the parameter Operator.

  4. Enter the parameter Value.

  5. Select Apply.

  6. Select the Modify item Modify item.

  7. Enter name in Filter field.

  8. Allow other to use the filter by selecting the Shared checkbox.

  9. Select OK.

Modifying an existing item filter

  1. Select the filter name from the menu.

  2. Select the Modify item Modify item.

  3. Modify the Field, Operator, or Value field entries.

  4. Select the Apply.

  5. Select the Modify item Modify item.

  6. Choose a save option:

    • Select Save to save current changes.

    • Select Save As to modify the filter title or sharing permission.

      1. Modify the title and permission.

      2. Select OK

Removing an item filter

  1. Select the filter name from the menu.

  2. Select the Modify item Modify item.

  3. Select the Delete item Delete item.

Creating or copying a catalog

Use these steps to add or duplicate service catalog.

  1. Select the Create item Create item.

  2. Choose a catalog function.

    • Make a new catalog, by selecting the Create new

    • Duplicate an existing catalog by:

      1. Selecting Copy existing.

      2. Selecting the catalog to be copied.

      3. Selecting Copy existing.

  3. Enter catalog title in Name field.

  4. Select a name from the Project menu.

  5. Enter a catalog infomration Description in the field.

  6. Select OK.

    New catalog
    Figure 2. New catalog

Removing a custom catalog

Use these steps to delete a custom catalog:

  1. Select Default filter from the Filter menu.

  2. Select All service catalogs from the Catalog menu.

  3. Select the name of the custom catalog to be deleted.

  4. Select Catalog editor.

  5. Select Delete from the three-line three-line menu.

  6. Select OK.

Accessing catalog modification features

Use one of the following ways to access catalog editing functionality:

  • Locate the custom catalog to be modified by:

    1. Selecting Default filter from the Filter menu.

    2. Select All service catalogs from the Catalog menu.

    3. Select the name of the custom catalog to be reconfigured.

  • Select the OK button on the New catalog or the Copy existing catalog screens.

    Catalog editor
    Figure 3. Catalog editor
1 Toggle catalog view:
  • Review catalog by selecting View catalog.

  • Reconfigure catalog using UI by selecting Catalog editor.

  • Modify the catalog using DSL by selecting DSL editor.

  • Reconfigure a catalog item by selecting three-dots three-dots menu.

  • Rearrange catalog item order by selecting Move Move and dragging the item to the desired position.

2 Manage catalog attributes:
  • Create a custom catalog by selecting the New catalog New catalog.

  • Add a new catalog item by selecting New item filter New item filter.

  • Access these catalog modification features by selecting three-lines three-lines menu.

    • Details.

    • DSL export.

    • Access Control.

    • Change History.

    • Delete.

Configuring catalog item tags

  1. Select `Default filter`from the Filter menu.

  2. Select All service catalogs from the Catalog menu.

  3. Select the name of the custom catalog that contains items to be tagged.

  4. Select Catalog editor.

  5. Select Details from the three-dots three-dots menu.

  6. Select modify arrow modify arrow.

    • Modify tags:

      • Enter tag name to create a new tag.

      • Select the X button to remove the tag.

  7. Select OK.

Creating a new catalog item

Use these steps to begin adding a a new item to a catalog:

  1. Access the catalog editor for the catalog to modified.

  2. Select New item New item.

  3. Enter item title in Name field.

  4. Enter item information in Description field.

  5. Do one of the following:

    New catalog item
    Figure 4. New catalog item

Configuring item display and description

You must create the ec_customEditorData/selfServiceUIForm property. The Service Catalog UI uses this property information to render the form displayed when the Catalog item link is selected.

If the property is not found, then the Service Catalog UI tries to render the form based on the parameter definition with the exception for Credentials, Credential Parameters, and Projects types.

Use these steps to modify a catalog item display and description:

  1. Access the catalog editor for the catalog to modified.

  2. Select Definitions from the 3-dots 3-dots menu.

  3. Choose item link label from the Select Button Label menu:

    • Create.

    • Create & Deploy.

    • Execute.

    • Provision.

    • Other and Other text.

  4. Select a display icon for the item:

    • Use avaiable icons by selecting Icon Library.

    • Choose a custom icon by selecting URL link and entering icon address into URL text field.

  5. Enter catalog item usage information into the Additional information field. This data will appear in the Instructions section of the item template.

  6. Do one of the following:

    Edit catalog item
    Figure 5. Edit catalog item: Display and Additional Information

Using DSL or XML to configure item formal parameter

DSL-based catalog items are the easiest to create. This type of catalog item is made up of a DSL script accompanied by UI form metadata or formal parameters to capture the user input required by the DSL.

  • For more information, refer to Using the CloudBees CD/RO DSL.

  • You have a choice to use form XML metadata or the formal parameter panel to specify user input parameters.

You must create the ec_customEditorData/selfServiceUIForm property. The Service Catalog UI uses this property information to render the form displayed when the Catalog item link is selected.

If the property is not found, then the Service Catalog UI tries to render the form based on the parameter definition with the exception for Credentials, Credential Parameters, and Projects types.

Use these steps to modify catalog item formal parameter.

  1. Access the catalog editor for the catalog to modified.

  2. Select Definitions from the item 3-dots 3-dots menu.

  3. Scroll down to - Section 3 Definitions.

  4. Modify item formal parameters.

  5. Specify optional end-target navigation. This is where CloudBees CD/RO takes the user after the service catalog item is run and completes successfully. Refer to End-target JSON for script example.

    1. Select Use Formal Parameters.

    2. Enter end-navigation data into End Target JSON field.

  6. Select OK.

    DSL Definitions
    Figure 6. Edit catalog item: DSL, XML and End Json

Selecting a plugin as a catalog item attribute

You must create the ec_customEditorData/selfServiceUIForm property. The Service Catalog UI uses this property information to render the form displayed when the Catalog item link is selected.

If the property is not found, then the Service Catalog UI tries to render the form based on the parameter definition with the exception for Credentials, Credential Parameters, and Projects types.

Use these steps to set a plugin as a catalog item attribute:

  1. Access the catalog editor for the catalog to modified.

  2. Select Definitions from the item 3-dots 3-dots menu.

  3. Scroll down to - Section 3 Definitions.

  4. Select Plugin in the left panel.

  5. Select the category from the Select Category menu.

  6. Select plugin name from the Select Plugin menu.

  7. Select the procedure name form Select Procedure menu.

  8. Select OK.

    Plugin Definitions
    Figure 7. Edit catalog item: Plugin

Choosing a procedure as catalog item attribute

You must create the ec_customEditorData/selfServiceUIForm property. The Service Catalog UI uses this property information to render the form displayed when the Catalog item link is selected.

If the property is not found, then the Service Catalog UI tries to render the form based on the parameter definition with the exception of Credentials, Credential Parameters, and Projects types.

Use these steps to set a procedure as a catalog item attribute:

  1. Access the catalog editor for the catalog to modified.

  2. Select Definitions from the item 3-dots 3-dots menu.

  3. Scroll down to - Section 3 Definitions.

  4. Select Procedure in left panel.

  5. Select project name from the Select project menu.

  6. Select the procedure name form Select Procedure menu.

  7. Select OK.

    Procedure Definitions
    Figure 8. Edit catalog item: Procedure

Define a formal parameter as an the item attribute

Once finished specifying the DSL specifics for the catalog item template, select OK to save your work. In the upper-left corner of the catalog item editor, select Menu and select Parameters. The Parameters dialog opens.

Refer to Parameters for full details about creating formal parameters from the parameter panel.

Deployment package manager catalog items

This is a special type of catalog item that lets you deploy Java or .NET applications quickly.

Before you create this type of item, you must create the deployment package outside of CloudBees CD/RO. A deployment package is a manifest.json file plus one or more components that make up an application. After you create the deployment package, you can use it to create an application model that corresponds to the uploaded application package with little CloudBees CD/RO knowledge. For details, refer to Deployment packages.

Creating templates

You can use Self service catalog items to create templates. Templates you create display as an option in the Create object dialog. To make a service catalog item appear in this way, you must edit the DSL for the catalog item, adding templateObjectType = 'release', for example. CloudBees CD/RO currently only supports releases templates. For details, refer to Catalog API.

DSL Example 1: Create an application in the default project folder

The following is a simple DSL script. This creates an application in the default project folder:

 /* args.appName is user entered value passed in as argument */
def appName = args.appName;

application appName, {
   projectName = "Default"
}

DSL Example 2: Create a simple application object in custom catalog

This is sample code to create a catalog item in the Custom catalog. This DSL-based catalog item creates a simple application object.

catalog 'Custom', {
  description = 'Catalog item description'
  iconUrl = 'icon'
  projectName = 'CloudBees'
  catalogItem 'Sample Catalog Item', {
    description = '''<xml>
         <title>This is the short description that is shown in the Service catalog UI as part of this catalog item</title>
         <htmlData>
           <![CDATA[<div>
              This is the html stylized text based on catalog item details that gets show when the user clicks the more link.
           </div>]>
         </htmlData>
    </xml>'''
    buttonLabel = 'Create'
    catalogName = 'Custom'
    dslParamForm = '''{
      \"sections\": {
        \"section\": [{
          \"name\": \"Application details\",
          \"instruction\": \"Provide Application details\",
          \"ec_parameterForm\": \"<editor> <formElement> <label>Application Name</label> <property>appName</property> <documentation>Name of the application to be created.</documentation> <type>entry</type> <required>1</required> </formElement> </editor>\"
        }],
        \"endTarget\": {
          \"object\": \"application\",
          \"formValue\": \"appName\"
        }
      }
    }'''
    dslString = '''def appName = args.appName;
        application appName, {
           projectName = "Default"
     }'''
    iconUrl = 'public/app/assets/img/taskicon.png'
    projectName = 'CloudBees'
    subpluginKey = null
    subprocedure = null
    subproject = null
  }
}

DSL Example 3: Create a catalog item with access to the myProject catalog item

This is sample code to create a catalog item with access to the myProject catalog item.

catalog 'CD 10.7 SSC Parameter Enhancements', {
    projectName = 'Default'

    catalogItem 'myProject usage', {
        description = "Creates a pipeline in the catalog project"
        dslString = '''\
            def projName = getProperty("/myProject/projectName").value
            pipeline "createdFromSSC", projectName: projName
        '''.stripIndent()
    }
}

XML Example 1: Create a Pipeline Name parameter

The example below shows details for the Pipeline Name parameter:

 {
    "sections":
    {
       "section":
    [{
        "name": "Pipeline Details",
        "ec_parameterForm": "
                <editor>
                  <formElement>
                    <property>pipelineProjName</property>
                    <label>Pipeline Project Name</label>
                    <type>project</type>
                    <required>1</required>
                  </formElement>
                  <formElement>
                    <property>pipelineName</property>
                    <label>Pipeline Name</label>
                    <type>entry</type>
                    <required>1</required>
                  </formElement>
                </editor>"
    }]
       "endTarget": {
            "source": "form",
            "object": "pipeline",
            "objectName": "pipelineName",
            "objectProjectName": "pipelineProjName"
    }

     }
   }
  • section allows groupings of user input parameters into different sections.

  • ec_parameterForm specifies the form XML that defines the user input form relevant to a section.

  • endTarget specifies where to take the user once the service catalog item is run and has completed successfully. Refer to Example: End-target navigation for details.

Example: End-target navigation

Optionally specify the end-target navigation in the End Target JSON field. This is where CloudBees CD/RO takes the user after the service catalog item is run and completes successfully. The end target JSON has the following format:

{
     "source": "<source>",
      "object": "<objectType>",
      "objectName ": "<objectName>",
      "objectProjectName ": "<objectProjectName>",
      "objectId" : "<objectId>"
}

where:

  • <source> is one of:

    • parameter —use values supplied with objectName, objectProjectName, and objectId ` as fields in the formal parameter; set `useFormalParameter to true.

    • form —use values supplied with objectName, objectProjectName, and objectId ` as fields in the form XML; set `useFormalParameter to false.

    • property —use values supplied with objectName, objectProjectName, and `objectId ` as properties.

    • name —use values supplied with objectName, objectProjectName, and `objectId ` as literal strings.

  • `<objectType> ` is the type of object.

  • <objectName> is the name of the object. Can be a literal string, property, or formal parameter field based on <source> type.

  • <objectProjectName> is the project. Can be a literal string, property, or formal parameter field based on <source> type.

  • <objectId> is the object id. Can be a literal string, property, or formal parameter field based on <source> type.