# mulesoft CloudHub Connector - Full Documentation --- product: CloudHub Connector version: 1.2 is-latest-version: true --- # CloudHub Connector 1.2 > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for CloudHub (CloudHub Connector) enables you to connect to the CloudHub API from your Mule application. For information about compatibility and fixed issues, see the [CloudHub Connector Release Notes](https://docs.mulesoft.com/release-notes/connector/cloudhub-connector-release-notes-mule-4). > [!NOTE] CloudHub Connector is supported only on CloudHub 1.0. CloudHub Connector isn’t supported > on CloudHub 2.0 or Runtime Fabric. For more information about feature comparison, see > [Features of CloudHub 2.0](https://docs.mulesoft.com/cloudhub-2/ch2-features). ## Create the CloudHub Configuration CloudHub Connector connections use the following authentication types: - Basic Authentication Uses a username and password for authentication - OAuth Client Credentials Delegates user authentication to the service hosting the user account The basic CloudHub configuration has the following properties: - Connection Provider One of the authentication types (Basic Authentication or OAuth Client Credentials) - Credentials Depending on the authentication type selected, you must specify your username and password or client ID and client secret. - Environment The CloudHub environment to use. By default this is the environment defined as the default in Anypoint Platform. CloudHub Configuration using Basic Authentication example: ```xml ``` CloudHub Configuration using OAuth Client Credentials Authentication example: ```xml ``` ## POM File Information If you create your app outside of Anypoint Studio, update your POM file as follows: ```xml com.mulesoft.connectors mule-cloudhub-connector x.x.x mule-plugin ``` Replace `x.x.x` with the version that corresponds to the connector you are using. To obtain the most up-to-date `pom.xml` file information: 1. Go to [Anypoint Exchange](https://www.mulesoft.com/exchange/). 2. In Exchange, click **Login** and supply your Anypoint Platform username and password. 3. In Exchange, search for `cloudhub`. 4. Click **Dependency Snippets**. ## List Available Environments After the credentials are configured correctly, you can retrieve the available environments for easier configuration. ![Available Environments](/mulesoft/current/en-us/cloudhub-connector/latest/_images/cloudhub-environments-value-provider.gif) CloudHub Connector is sometimes unable to fetch the available environments from the `/account` API endpoint, resulting in an empty dropdown list. If you are using the **OAuth Client Credentials** connection type, the **Environment** field is optional so an empty dropdown list should not cause any issues. > [!NOTE] The dropdown list will be populated with those environments belonging to the main business > group of the configured credential’s user. To use an environment from a child business group, that > the same user has access to, manually specify its ID on either this field or corresponding XML > attribute. ## Use the CloudHub Environment To specify the app deployment environment, use the [`environment.id`](#environment.id-sysprop) system property. Using the deployment environment ```xml ``` ## Creating a Notification To create a notification, the user must have the Runtime Manager `Read application` permission for the specified environment. For information about assigning permissions to users, see [Granting Permissions and Roles to Users](https://docs.mulesoft.com/access-management/users#granting-permissions-and-roles-to-users). To create a notification, use the Create Notification operation. This operation requires the notification message and the associated domain. You can specify the domain using the [`domain`](#domain-sysprop) system property. You can also configure: - **Custom properties** An open object to provide additional information about the created notification - **Priority** Specify the priority of the notification: - ERROR - INFO - WARN - Transaction ID The transaction ID associated with the created notification ```xml ``` ![Creating a Notification](/mulesoft/current/en-us/cloudhub-connector/latest/_images/cloudhub-create-notification.png) Figure 1. Configuring in Studio ## List Notifications To consume notifications, use the List Notifications operation. This operation requires only that you specify the domain from which to retrieve notifications. You can specify the domain using the [`domain`](#domain-sysprop) system property. You can also configure: - Limit Specifies the number of notifications to retrieve (default `-1`, which indicates all available notifications) - Status Filters the notifications to retrieve as unread, read, or all (default `unread`, which retrieves only notifications marked as unread - Search Retrieves only notifications that contain the specified text ```xml ``` ![Listing Notifications](/mulesoft/current/en-us/cloudhub-connector/latest/_images/cloudhub-list-notifications.png) Figure 2. Configuring in Studio This operation returns a list of notifications with the following structure: ```yaml Notification: type: object properties: id: string domain: string priority?: string read: boolean readOn?: datetime createdAt: datetime href: string properties: object ``` ## Mark a Notification as Read Use the Mark Notification operation to mark the notification as read. After a notification is consumed, mark a notification as read so that the next time notifications are read, only the unread ones are retrieved. The Mark Notification operation requires only the notification ID, which you can obtain from the `id` property of a [Notification object](#notification-object). Example of marking notifications as read ```xml ``` ## List Applications Using the connector, you can retrieve all available applications in the given environment. No configuration is required. ```xml ``` You can customize how information is retrieved to get less or more information about the applications. ## Retrieve an Application The connector retrieves information about an application’s deployment. The only required configuration is to specify the domain and the application name. You can specify the domain using the [`domain`](#domain-sysprop) system property. ```xml ``` This operation returns all information about the application deployment. ## Useful CloudHub System Properties
NameInformationUsage

Domain

The name of the domain where the application is deployed in CloudHub.

${domain}

Environment

The ID of the environment where the application is deployed.

${environment.id}

## See Also - [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors) - [Use Exchange to Discover Connectors, Templates, and Examples](https://docs.mulesoft.com/connectors/introduction/intro-use-exchange) - [CloudHub Connector Reference](https://docs.mulesoft.com/cloudhub-connector/latest/cloudhub-connector-ref) - [CloudHub Connector in Anypoint Exchange](https://www.mulesoft.com/exchange/com.mulesoft.connectors/mule-cloudhub-connector/) - [Salesforce Help](https://help.salesforce.com) --- product: CloudHub Connector version: 1.2 is-latest-version: true --- # CloudHub Connector 1.2 Reference > For the full documentation index, see: https://docs.mulesoft.com/llms.txt Anypoint Connector for CloudHub enables you to create and list notifications and to retrieve the status of created applications that are deployed to CloudHub. Release Notes: [CloudHub Connector Release Notes](https://docs.mulesoft.com/release-notes/connector/cloudhub-connector-release-notes-mule-4) ## Configurations --- ### Default Configuration Default configuration #### Parameters
NameTypeDescriptionDefault ValueRequired

Name

String

The name for this configuration. Connectors reference the configuration with this name.

x

Connection

Connection types for this configuration.

x

Name

String

ID used to reference this configuration.

x

Expiration Policy

Configures the minimum amount of time that a dynamic configuration instance can remain idle before Mule considers it eligible for expiration. This does not mean that the platform expires the instance at the exact moment that it becomes eligible. Mule purges the instances as appropriate.

#### Connection Types ##### Basic Authentication Basic connection provider that provides CloudHub connection. ###### Parameters
NameTypeDescriptionDefault ValueRequired

Username

String

Username of the Anypoint Platform Account

x

Password

String

Password of the Anypoint Platform Account

x

Environment

String

Optionally specifies the Anypoint Platform environment to use: by default, the environment defined as the default in Anypoint Platform.

Anypoint Platform URL

String

Enables you to change between the US Anypoint Platform and the EU Anypoint Platform, if required.

https://anypoint.mulesoft.com

Reconnection

Configures a reconnection strategy to use when a connector operation fails to connect to an external server.

##### OAuth Client Credentials Connection provider that provides CloudHub connection. ###### Parameters
NameTypeDescriptionDefault ValueRequired

Anypoint Platform URL

String

Enables you to change between the US Anypoint Platform and the EU Anypoint Platform, if required.

https://anypoint.mulesoft.com

Client Id

String

OAuth client ID, as registered with the service provider.

x

Client Secret

String

OAuth client secret, as registered with the service provider.

x

Environment

String

Optionally specifies the Anypoint Platform environment to use: by default, the environment defined as the default in Anypoint Platform.

Reconnection

Configures a reconnection strategy to use when a connector operation fails to connect to an external server.

#### Associated Operations - [Create Notification](#createNotification) - [Get Application](#getApplication) - [List Applications](#listApplications) - [List Notifications](#listNotifications) - [Mark Notification](#markNotification) ## Operations ### Create Notification `` Creates a new Notification #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Domain

String

Name of the application to bind the new notification

x

Message

String

Notification’s message

#[payload]

Custom Properties

Object

Additional properties for the notification

Priority

Enumeration, one of:

  • ERROR

  • INFO

  • WARN

Priority of the notification to create.

Transaction Id

String

Transaction ID for the Notification

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Error Mappings

Array of Error Mapping

Set of error mappings.

Reconnection Strategy

A retry strategy in case of connectivity errors

#### For Configurations - [Default Configuration](#config) #### Throws - CLOUDHUB:CONNECTIVITY - CLOUDHUB:EXECUTION - CLOUDHUB:RETRY\_EXHAUSTED ### Get Application `` Retrieves a single application by name. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Domain

String

The name of the application

x

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configure if repeatable streams should be used and their behavior

Target Variable

String

The name of a variable on which the operation’s output will be placed

Target Value

String

An expression that will be evaluated against the operation’s output and the outcome of that expression will be stored in the target variable

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

Reconnection Strategy

A retry strategy in case of connectivity errors

#### Output

Type

Any

#### For Configurations - [Default Configuration](#config) #### Throws - CLOUDHUB:CONNECTIVITY - CLOUDHUB:EXECUTION - CLOUDHUB:RETRY\_EXHAUSTED ### List Applications `` Retrieves all applications in the specified environment. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Retrieve Log Levels

Boolean

Whether should retrieve Application log levels

true

Retrieve Tracking Settings

Boolean

Whether should retrieve Application tracking settings

true

Retrieve IP Addresses

Boolean

Whether should retrieve Application IP Addresses

true

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configure if repeatable streams should be used and their behavior

Retrieve Statistics

Boolean

Whether should retrieve Application statistics

false

Period

Number

Time of statistics to gather

1

Period Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

Time Unit of the period

HOURS

Target Variable

String

The name of a variable on which the operation’s output will be placed

Target Value

String

An expression that will be evaluated against the operation’s output and the outcome of that expression will be stored in the target variable

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

Reconnection Strategy

A retry strategy in case of connectivity errors

#### Output

Type

Any

#### For Configurations - [Default Configuration](#config) #### Throws - CLOUDHUB:CONNECTIVITY - CLOUDHUB:EXECUTION - CLOUDHUB:RETRY\_EXHAUSTED ### List Notifications `` Lists all the available notifications for a giver domain. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Domain

String

Name of the application to gather notifications from

x

Limit

Number

Number of notifications to retrieve. -1 means everything available.

-1

Page Size

Number

Size of the page to retrieve per iteration. This only should be changed for performance purposes.

25

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Streaming Strategy

Configure if repeatable streams should be used and their behavior

Status

Enumeration, one of:

  • READ

  • UNREAD

  • ALL

Filters the notifications by status. Read, Unread or All.

UNREAD

Search

String

If specified, only return notifications where the message contains this string. (Case Insensitive)

Target Variable

String

The name of a variable on which the operation’s output will be placed

Target Value

String

An expression that will be evaluated against the operation’s output and the outcome of that expression will be stored in the target variable

#[payload]

Error Mappings

Array of Error Mapping

Set of error mappings.

Reconnection Strategy

A retry strategy in case of connectivity errors

#### Output

Type

Array of Notification

#### For Configurations - [Default Configuration](#config) #### Throws - CLOUDHUB:CONNECTIVITY - CLOUDHUB:EXECUTION ### Mark Notification `` Marks a notification as Read or Unread. #### Parameters
NameTypeDescriptionDefault ValueRequired

Configuration

String

The name of the configuration to use.

x

Notification Id

String

ID of the notification

x

Mark As

Enumeration, one of:

  • READ

  • UNREAD

Action to do. Mark as Read or Unread

x

Config Ref

ConfigurationProvider

Name of the configuration to use to execute this component.

x

Error Mappings

Array of Error Mapping

Set of error mappings.

Reconnection Strategy

A retry strategy in case of connectivity errors

#### For Configurations - [Default Configuration](#config) #### Throws - CLOUDHUB:CONNECTIVITY - CLOUDHUB:EXECUTION - CLOUDHUB:RETRY\_EXHAUSTED ## Types ### Reconnection
FieldTypeDescriptionDefault ValueRequired

Fails Deployment

Boolean

When the application is deployed, a connectivity test is performed on all connectors. If set to true, deployment will fail if the test doesn’t pass after exhausting the associated reconnection strategy

Reconnection Strategy

The reconnection strategy to use

### Reconnect
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often to reconnect (in milliseconds).

Count

Number

The number of reconnection attempts to make.

blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

true

### Reconnect Forever
FieldTypeDescriptionDefault ValueRequired

Frequency

Number

How often in milliseconds to reconnect.

blocking

Boolean

If false, the reconnection strategy runs in a separate, non-blocking thread.

true

### Expiration Policy
FieldTypeDescriptionDefault ValueRequired

Max Idle Time

Number

A scalar time value for the maximum amount of time a dynamic configuration instance should be allowed to be idle before it’s considered eligible for expiration

Time Unit

Enumeration, one of:

  • NANOSECONDS

  • MICROSECONDS

  • MILLISECONDS

  • SECONDS

  • MINUTES

  • HOURS

  • DAYS

A time unit that qualifies the maxIdleTime attribute

### Error Mapping
FieldTypeDescriptionDefault ValueRequired

Source

Enumeration, one of:

  • ANY

  • REDELIVERY_EXHAUSTED

  • TRANSFORMATION

  • EXPRESSION

  • SECURITY

  • CLIENT_SECURITY

  • SERVER_SECURITY

  • ROUTING

  • CONNECTIVITY

  • RETRY_EXHAUSTED

  • TIMEOUT

Source.

Target

String

Target.

x

### Repeatable In Memory Stream
FieldTypeDescriptionDefault ValueRequired

Initial Buffer Size

Number

This is the amount of memory that will be allocated in order to consume the stream and provide random access to it. If the stream contains more data than can be fit into this buffer, then the buffer expands according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize.

Buffer Size Increment

Number

This is by how much will be buffer size expands if it exceeds its initial size. Setting a value of zero or lower will mean that the buffer should not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error will be raised when the buffer gets full.

Max Buffer Size

Number

This is the maximum amount of memory that will be used. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error will be raised. A value lower or equal to zero means no limit.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

The unit in which all these attributes are expressed

### Repeatable File Store Stream
FieldTypeDescriptionDefault ValueRequired

Max In Memory Size

Number

Defines the maximum memory that the stream should use to keep data in memory. If more than that is consumed then it will start to buffer the content on disk.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

The unit in which maxInMemorySize is expressed

### Notification
FieldTypeDescriptionDefault ValueRequired

Id

String

x

Domain

String

x

Message

String

Priority

String

Properties

Any

Read

Boolean

x

Read On

DateTime

Created At

DateTime

x

Href

String

x

### Repeatable In Memory Iterable
FieldTypeDescriptionDefault ValueRequired

Initial Buffer Size

Number

This is the amount of instances to be initially allowed to be kept in memory in order to consume the stream and provide random access to it. If the stream contains more data than can fit into this buffer, then it expands according to the bufferSizeIncrement attribute, with an upper limit of maxInMemorySize. Default value is 100 instances.

Buffer Size Increment

Number

This is by how much the buffer size expands if it exceeds its initial size. Setting a value of zero or lower means that the buffer should not expand, meaning that a STREAM_MAXIMUM_SIZE_EXCEEDED error will be raised when the buffer gets full. Default value is 100 instances.

Max Buffer Size

Number

This is the maximum amount of memory that will be used. If more than that is used then a STREAM_MAXIMUM_SIZE_EXCEEDED error will be raised. A value lower or equal to zero means no limit.

### Repeatable File Store Iterable
FieldTypeDescriptionDefault ValueRequired

Max In Memory Size

Number

This is the maximum amount of instances that will be kept in memory. If more than that is required, then it will start to buffer the content on disk.

Buffer Unit

Enumeration, one of:

  • BYTE

  • KB

  • MB

  • GB

The unit in which maxInMemorySize is expressed

## See Also [Salesforce Help](https://help.salesforce.com)