Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

Pivotal Cloud Foundry discovery

The ServiceNow Discovery application finds Pivotal Cloud Foundry (PCF) version 3 components using the Pivotal Cloud Foundry pattern. Discovering some of these resources may require updating to the latest version of the Discovery and Service Mapping Patterns application from the ServiceNow Store.

You can use this pattern on the ServiceNow AI Platform starting Kingston version.

The discovery of PCF V3 components is supported when the Discovery and Service Mapping Patterns plugin Version 1.0.99, March 2023 is installed. The Pattern continues to support the discovery of PCF V2 components.

Request apps on the Store

Visit the ServiceNow Store to view all the available apps, and for information about submitting requests to the store. For cumulative release notes information for all released apps, see the ServiceNow Store version history release notes.

Prerequisites

  • Pivotal Cloud Foundry credentials

    Create the Pivotal Cloud Foundry credentials.

    1. Navigate to Discovery > Credentials.
    2. Select New.
    3. Select CloudFoundry Credentials.
    4. On the form, fill in the fields:
FieldDescription
NameCredential name. As an example, `pcf_user credentials`
ActiveOption for enabling this credential for discovery. Select this check box to enable discovery.
Applies toCredentials that you may or may not want to apply to All MID servers in your network, or to one or more Specific MID servers. Select Specific MID servers.
OrderOrder in which the platform tries this credential as it tries to log in to devices. A smaller number indicates that the credential seems higher in the list. Establish the credential order when using large numbers of credentials or when security locks out users after three failed logins tries. If all the credentials have the same order number, or none, the instance tries the credentials in a random order. The default value is 100.
User nameName of the user of these credentials. Avoid leading or trailing spaces in user names. A warning seems if the platform detects leading or trailing spaces in the user name. An example is `pcf_user`. Use the `client_id` that is used to generate the JWT token.
PasswordPassword for the user of these credentials. Use the `client_secret` that is used to generate the JWT token.
Credential aliasAlternate name for these credentials. As an example, `cf` If this field is closed, select the unlock icon to unlock the field.
5.  Select **Update**.
  • JSON web token credentials

    To verify the JSON web token (JWT), perform the following token validation steps.

    The format of the JWT token is: https://docs.cloudfoundry.org/api/uaa/version/4.27.0/index.html#jwt-bearer-token-grant

    1. Run the following cURL script against the User Account and Authentication (UAA) server API and verify the results:

      curl -s -k https://ip_address:port/oauth/token -X; POST -H ”Content-Type: application/x-www-form-urlencoded” -H “Accept: application/json” -d “client_id=<INSERT_USER_HERE>&client_secret=<INSERT_PASS_HERE>&grant_type=client_credentials&token_format=jwt&response_type=token”

      If this command doesn’t generate a token, verify that the credentials in the ServiceNow repository are correct, otherwise go to step 2.

    2. Run the following cURL script against Pivotal Cloud Foundry API:

      curl https://ip_address:port/v3/spaces -k -v -H “Accept: application/json” -H “Authorization: bearer<INSERT TOKEN HERE>”

      If this command doesn’t retrieve the PCF spaces information, verify the credentials on the ServiceNow credentials repository.

  • Credentials for V3 API elements

    Provide a read-only user with permission to use the following API elements:

    • –/v3/organizations
    • –/v3/spaces
    • –/v3/domains
    • –/v3/routes
    • –/v3/organization_quotas
    • –/v3/space_quotas
    • –/v3/apps
    • -/v3/service_offerings
    • -/v3/service_plans
    • -/v3/service_instances
    • -/v3/droplets Note: The Pivotal Cloud Foundry Pattern also supports the PCF V2 APIs.
  • Create a serverless Discovery schedule

    1. Navigate to Discovery > Discovery Schedules.
    2. Select New.
    3. On the form, fill in the fields:

      FieldDescription
      NameEnter a unique and descriptive name for this Discovery schedule, for example, pcf
      DiscoverFor the Discover type, select Serverlesss
      MID ServerMID Servers that the credentials apply to. Specify the required MID Server, for example, Discovery_Server
      ActiveOption for enabling this credential for discovery. Select this check box to enable discovery.
      Credential aliasAlternate name for these credentials. Use the alias related with the Pivotal Cloud Foundry credentials that you created earlier.
    4. Right-click the header of the Discovery Schedule form and select Save.

Image omitted: serverless-execution-pattern.png
Serverless execution pattern
5.  Select the Serverless Execution Patterns tab.
6.  Select **New**.
7.  On the form, fill in the fields:

    |Field|Description|
    |-----|-----------|
    |Name|Enter a unique and descriptive name for this Serverless Execution Pattern, for example, `pcf1`|
    |Pattern|Select **CloudFoundry**.|
    |Proxy Host|Fully qualified domain name of the machine on which you’re installing the proxy server. Specify **Global**.|
    |Active|Check box to enable this schedule for discovery. Select this check box.|

8.  Right-click the header of the Serverless Execution Patterns form and select **Save**.
9.  Select the Serverless Execution Patterns tab
10. Create and define the serverless execution pattern as described in the product documentation.

    Configure the parameters required by the Pivotal Cloud Foundry Pattern as follows:

    |Parameter|Description|
    |---------|-----------|
    |Organization|Name of the organization that is required to be discovered, or all where the input is “\*”.|
    |CredentialAlias|Alternate name for these credentials. Use the alias related with the Pivotal Cloud Foundry credentials that you created earlier.|
    |URL\_CF|API URL of the Cloud Controller that is used to retrieve the information from Pivotal Cloud Foundry.|
    |URL\_CF\_AUTH|UAA server API​that is used to generate the token. Enter the value in the format: https://uaa.sys.dev.phx.pcf.example.com/oauth/token|

11. **Update**.
12. To start discovery, navigate to the Serverless Discovery definition and select **Discover Now**.
  • EVAL closure functions

    Use the following EVAL closure functions to concatenate all organizations with “,” as a separator.

    var rtrn = ’’;
    var organizations = ${organizations[*].name};
    var beforeReturn = ’’;
    var separator = ’’;
    for (var i = 0; i < organizations.size(); i++)   
        {
        beforeReturn += separator + organizations.get(i);  
        separator = ',';   
        }
    rtrn = beforeReturn;
    

    Use the following EVAL closure functions to return 1 if the operational status is active and 2 if it isn’t active.

    var rtrn = '';
    var currentOrgStatus = ${organizations[].operational_status};
    var status = currentOrgStatus.toLowerCase();
    if(status == "active"){  
       rtrn = "1";  
    }
    else { 
       rtrn = "2";
    }
    

    Use the following EVAL closure function to return 1 if the operational status is started and 2 if it isn’t started.

    var rtrn = '';
    var currentAppStatus = ${apps[].state};
    var status = currentAppStatus.toLowerCase();
    if(status == "started"){
       rtrn = "1";  
    }
    else {   
       rtrn = "2";   
    }
    
  • CloudFoundry Get Call

    The CloudFoundry Get Call custom operation handles the generation of tokens. It uses the credentials and URL_CF_AUTH context variable to generate a token that is used to create API calls.

    When a token is generated, the URL_CF is used to create the API calls defined in the Resource field. The custom operation also handles pagination where the response has more than one page.

    CloudFoundry Get Call parses the input JSON to populate the tables and variables.

Image omitted: cloud-foundry-custom-operation.png
Cloud Foundry custom operation

Pivotal Cloud Foundry BOSH extension section

The Pivotal Cloud Foundry BOSH is an extension section of the Pivotal Cloud Foundry Pattern.

The extension is available on the ServiceNow® Store for the June 2023 release of Discovery and Service Mapping Patterns 1.6.0.

  • Requirements for Pivotal Cloud Foundry BOSH

    Note: The following requirements are relevant only to the BOSH extension section.

    The Opsman authentication URL has to be provided as a pattern parameter with the name URL_OPSMAN_AUTH. For example: https://<opsman entry point>/uaa/oauth/token

    The added credentials must have permission to execute the following APIs:

    • /uaa/oauth/token
    • /api/v0/deployed/products Note: Custom APIs are added as Tanzu Opsman Get API step to the Pattern.

Data collected by Discovery during horizontal discovery

FieldDescription
Main CI: PCF Foundation \[cmdb\_ci\_pcf\_foundation\]
NamePivotal Cloud Foundry cluster entry name`-`
ip\_addressPivotal Cloud Foundry host IP.
portPivotal Cloud Foundry service port.
short\_descriptionPivotal Cloud Foundry service build number.
OrganizationOrganization list, managed by PCF cluster. The entries are separated using a “,” comma separator.
PCF Organization \[cmdb\_ci\_pcf\_organization\]
NameOrganization name
URLOrganization unique URL
pcf\_guidOrganization UID in CF
operational\_statusOrganization status
PCF Space \[cmdb\_ci\_pcf\_space\]
NameSpace name
URLSpace unique URL
pcf\_guidSpace UID in CF
PCF Application \[cmdb\_ci\_pcf\_appl\]
NameApplication name
URLApplication unique URL
pcf\_guidApplication UID in CF
PCF Route \[cmdb\_ci\_pcf\_route\]
NameRoute name
URLRoute unique URL
pcf\_guidRoute UID in CF
portRoute port
typeRoute type
PCF Quota \[cmdb\_ci\_pcf\_quota\]
NameQuota name
URLQuota unique URL
pcf\_guidQuota UID in CF
PCF Domain \[cmdb\_ci\_pcf\_domain\]
nameDomain name
urlDomain unique URL
pcf\_guidDomain UID in CF
PCF Space instance \[cmdb\_ci\_pcf\_space\_instance\]
nameSpace service instance name
urlSpace service instance unique URL
pcf\_guidSpace service instance UID in CF
PCF Service Plan \[cmdb\_ci\_pcf\_service\_plan\]
nameService plan instance name
urlService plan unique URL
pcf\_guidSpace service instance UID in CF
PCF Service \[cmdb\_ci\_pcf\_service\]
nameService name
urlService unique URL
pcf\_guidService UID in CF
PCF Droplet \[cmdb\_ci\_pcf\_droplet\]
nameResource URL
pcf\_guidDroplet ID
urlDroplet URL
install\_statusInstallation status: 1, "installed"
operational\_statusOperational status: 1, "operational"
Key Value \[cmdb\_key\_value\]
keyResource Tag keyNote: This data is only collected for V3 API calls.
valueResource Tag value.Note: This data is only collected for V3 API calls.
FieldDescription
BOSH Deployment \(cmdb\_ci\_bosh\_deployment\)
NameThe installation name of the resource.
object\_idThe ID of the deployed product.
install\_statusHard-coded to the value: *1= installed*.
operational\_statusHard-coded to the value: *1= operational*.
deployment\_versionThe version of the deployed product.
deployment\_typeThe type of the deployed product.

CI relationships

These relationships are created to support Pivotal Cloud Foundry discovery.

CIRelationshipCI
PCF Space \[cmdb\_ci\_pcf\_space\]
cmdb\_ci\_pcf\_spaceContains::Contained bycmdb\_ci\_pcf\_organization
PCF Application \[cmdb\_ci\_pcf\_appl\]
cmdb\_ci\_pcf\_applContains::Contained bycmdb\_ci\_pcf\_space
PCF Route \[cmdb\_ci\_pcf\_route\]
cmdb\_ci\_pcf\_routeContains::Contained bycmdb\_ci\_pcf\_foundation
PCF Quota \[cmdb\_ci\_pcf\_quota\]
cmdb\_ci\_pcf\_quotaUses::Used bycmdb\_ci\_pcf\_spacecmdb\_ci\_pcf\_organization
PCF Domain \[cmdb\_ci\_pcf\_domain\]
cmdb\_ci\_pcf\_domainUses::Used bycmdb\_ci\_pcf\_route
Owns::Owned bycmdb\_ci\_pcf\_organization
Contains::Contained bycmdb\_ci\_pcf\_foundation
PCF Space instance \[cmdb\_ci\_pcf\_space\_instance\]
cmdb\_ci\_pcf\_space\_instanceContains::Contained bycmdb\_ci\_pcf\_space
PCF Service Plan \[cmdb\_ci\_pcf\_service\_plan\]
cmdb\_ci\_pcf\_service\_planUses::Used bycmdb\_ci\_pcf\_space\_instance
PCF Service \[cmdb\_ci\_pcf\_service\]
cmdb\_ci\_pcf\_serviceUses::Used bycmdb\_ci\_pcf\_service\_plan
PCF Droplet \[cmdb\_ci\_pcf\_droplet\]
cmdb\_ci\_pcf\_applContains::Contained bycmdb\_ci\_pcf\_droplet
Key Value \[cmdb\_key\_value\]
cmdb\_key\_valueReference only.For example: configuration\_itemcmdb\_ci\_pcf\_droplet
cmdb\_key\_valueReference only.For example: configuration\_itemcmdb\_ci\_pcf\_organization
cmdb\_key\_valueReference only.For example: configuration\_itemcmdb\_ci\_pcf\_space
cmdb\_key\_valueReference only.For example: configuration\_itemcmdb\_ci\_pcf\_domain
cmdb\_key\_valueReference only.For example: configuration\_itemcmdb\_ci\_pcf\_route
cmdb\_key\_valueReference only.For example: configuration\_itemcmdb\_ci\_pcf\_appl
cmdb\_key\_valueReference only.For example: configuration\_itemcmdb\_ci\_pcf\_service
cmdb\_key\_valueReference only.For example: configuration\_itemcmdb\_ci\_pcf\_service\_plan
cmdb\_key\_valueReference only.For example: configuration\_itemcmdb\_ci\_pcf\_space\_instance

Pivotal Cloud Foundry BOSH relationships

These relationships are created to support Pivotal Cloud Foundry BOSH extension section discovery.

CIRelationshipCI
Cloud Foundry Cluster \[cmdb\_ci\_pcf\_foundation\]Contains::Contained byBOSH Deployment \[cmdb\_ci\_bosh\_deployment\]

Parent Topic:Available on-premise discovery patterns

sndocs is an independent community mirror and is not affiliated with or endorsed by ServiceNow.

ServiceNow, the ServiceNow logo, Now, and other ServiceNow marks are trademarks and/or registered trademarks of ServiceNow, Inc., in the United States and/or other countries. Other company and product names may be trademarks of the respective companies with which they are associated.

© 2026 ServiceNow, Inc. All rights reserved.

Documentation content is redistributed under the Apache License 2.0 from the ServiceNowDocs repository.