Skip to main content

Data Source

Follow the instructions below to create a new data flow that ingests data from a Bitbucket Server source in Nexla.
bitbucket_server_api.png

Bitbucket Server

Create a New Data Flow

  1. To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Then, select the desired flow type from the list, and click the Create button.

  2. Select the Bitbucket Server connector tile from the list of available connectors. Then, select the credential that will be used to connect to the Bitbucket Server instance, and click Next; or, create a new Bitbucket Server credential for use in this flow.

  3. In Nexla, Bitbucket Server data sources can be created using pre-built endpoint templates, which expedite source setup for common Bitbucket Server endpoints. Each template is designed specifically for the corresponding Bitbucket Server endpoint, making source configuration easy and efficient.
    • To configure this source using a template, follow the instructions in Configure Using a Template.

    Bitbucket Server sources can also be configured manually, allowing you to ingest data from Bitbucket Server endpoints not included in the pre-built templates or apply further customizations to exactly suit your needs.
    • To configure this source manually, follow the instructions in Configure Manually.

Configure Using a Template

Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Bitbucket Server endpoints. Each template is designed specifically for the corresponding Bitbucket Server endpoint, making data source setup easy and efficient.

Endpoint Settings

  • Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below. Click on an endpoint to see more information about it and how to configure your data source for this endpoint.

    Get top-level entities

    This endpoint retrieves top-level entities from your Bitbucket Server instance, including SSH keys, projects, and pull requests. Use this endpoint when you need to access high-level information about your Bitbucket Server account.

    • Select the entity type you want to retrieve from the Entity Type dropdown menu. Available options include:

      • Retrieve user's SSH keys: Get SSH keys for the authenticated user (/rest/ssh/latest/keys)
      • Get projects: Retrieve projects that the user has access to (/rest/api/latest/projects)
      • Get user's pull requests: Retrieve all pull requests that the user has access to (/rest/api/latest/dashboard/pull-requests)

      This field is optional. If not specified, the endpoint will use the default entity type.

    • The endpoint uses GET requests to {base_url}/rest/{entity_type} where {base_url} is your Bitbucket Server base URL from the credential configuration and {entity_type} is the selected entity type. The endpoint URL is automatically constructed based on your credential's base URL configuration and the selected entity type.
    • The endpoint uses offset-based pagination, automatically fetching additional pages as needed using the start and limit query parameters. The endpoint starts from offset 0 and continues fetching pages until all available entities have been retrieved. By default, the endpoint retrieves up to 100 items per page.
    • The endpoint will return all entities of the selected type. The response data is extracted from the values array in the API response ($.values), with each entity record processed individually.

    This endpoint supports pagination through start and limit query parameters. Nexla automatically handles pagination to retrieve all available records by incrementing the offset until no more data is returned. The endpoint uses offset-based pagination (iteration.type: paging.incrementing.offset), starting from offset 0. By default, the endpoint retrieves up to 100 items per page (page.expected.rows: 100). The response data path is $.values, which extracts all items from the values array in the API response. For detailed information about retrieving top-level entities, see the Bitbucket Server REST API documentation.

    Get repositories

    This endpoint retrieves a list of all repositories accessible by the authenticated user. Use this endpoint when you need to access repository information across all projects in your Bitbucket Server instance.

    • This endpoint automatically retrieves all repositories accessible to the authenticated user. No additional configuration is required beyond selecting this endpoint template.
    • The endpoint uses GET requests to {base_url}/rest/api/latest/repos where {base_url} is your Bitbucket Server base URL from the credential configuration. The endpoint URL is automatically constructed based on your credential's base URL configuration.
    • The endpoint uses offset-based pagination, automatically fetching additional pages as needed using the start and limit query parameters. The endpoint starts from offset 0 and continues fetching pages until all available repositories have been retrieved. By default, the endpoint retrieves up to 100 items per page.
    • The endpoint will return all repositories accessible to the authenticated user. The response data is extracted from the values array in the API response ($.values), with each repository record processed individually.

    This endpoint supports pagination through start and limit query parameters. Nexla automatically handles pagination to retrieve all available records by incrementing the offset until no more data is returned. The endpoint uses offset-based pagination (iteration.type: paging.incrementing.offset), starting from offset 0. By default, the endpoint retrieves up to 100 items per page (page.expected.rows: 100). The response data path is $.values, which extracts all items from the values array in the API response. For detailed information about retrieving repositories, see the Bitbucket Server REST API documentation.

    Get project repos

    This endpoint retrieves a list of repositories within a specific project. Use this endpoint when you need to access repository information for a particular project in your Bitbucket Server instance.

    • Enter the project key in the Project key field. This is the unique identifier (key) of the project for which you want to retrieve repositories. Project keys are typically short, uppercase identifiers like "PROJ" or "MYPROJECT".

    • The endpoint uses GET requests to {base_url}/rest/api/latest/projects/{projectKey}/repos where {base_url} is your Bitbucket Server base URL from the credential configuration and {projectKey} is the project key you provide. The endpoint URL is automatically constructed based on your credential's base URL configuration and the project key.
    • The endpoint uses offset-based pagination, automatically fetching additional pages as needed using the start and limit query parameters. The endpoint starts from offset 0 and continues fetching pages until all available repositories have been retrieved. By default, the endpoint retrieves up to 100 items per page.
    • The endpoint will return all repositories within the specified project. The response data is extracted from the values array in the API response ($.values), with each repository record processed individually.

    Project keys can be obtained from the "Get top-level entities" endpoint by selecting "Get projects" as the entity type, which returns all projects with their corresponding keys. This endpoint supports pagination through start and limit query parameters. Nexla automatically handles pagination to retrieve all available records by incrementing the offset until no more data is returned. The endpoint uses offset-based pagination (iteration.type: paging.incrementing.offset), starting from offset 0. By default, the endpoint retrieves up to 100 items per page (page.expected.rows: 100). The response data path is $.values, which extracts all items from the values array in the API response. For detailed information about retrieving project repositories, see the Bitbucket Server REST API documentation.

    Get entities related to a repo

    This endpoint retrieves entities within a specific repository, including files, commits, pull requests, and branches. Use this endpoint when you need to access detailed repository information for a particular repository.

    • Enter the project key in the Project key field. This is the unique identifier (key) of the project that contains the repository. Project keys are typically short, uppercase identifiers like "PROJ" or "MYPROJECT".

    • Enter the repository slug in the Repository URL slug field. This is the URL-friendly identifier of the repository within the project. Repository slugs are typically lowercase identifiers that match the repository name.

    • Select the entity type you want to retrieve from the Entity type within repository dropdown menu. Available options include:

      • Files: Retrieve files in the repository (default)
      • Commits: Retrieve commit history
      • Pull-requests: Retrieve pull requests
      • Branches: Retrieve branches

      The default value is files if not specified.

    • The endpoint uses GET requests to {base_url}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/{repoEntityType} where {base_url} is your Bitbucket Server base URL from the credential configuration, {projectKey} is the project key, {repositorySlug} is the repository slug, and {repoEntityType} is the selected entity type. The endpoint URL is automatically constructed based on your credential's base URL configuration and the provided parameters.
    • The endpoint uses offset-based pagination, automatically fetching additional pages as needed using the start and limit query parameters. The endpoint starts from offset 0 and continues fetching pages until all available entities have been retrieved. By default, the endpoint retrieves up to 100 items per page.
    • The endpoint will return all entities of the selected type within the specified repository. The response data is extracted from the values array in the API response ($.values), with each entity record processed individually.

    Project keys and repository slugs can be obtained from the "Get project repos" endpoint, which returns all repositories within a project with their corresponding project keys and repository slugs. This endpoint supports pagination through start and limit query parameters. Nexla automatically handles pagination to retrieve all available records by incrementing the offset until no more data is returned. The endpoint uses offset-based pagination (iteration.type: paging.incrementing.offset), starting from offset 0. By default, the endpoint retrieves up to 100 items per page (page.expected.rows: 100). The response data path is $.values, which extracts all items from the values array in the API response. For detailed information about retrieving repository entities, see the Bitbucket Server REST API documentation.

Endpoint Testing

Once the selected endpoint template has been configured, Nexla can retrieve a sample of the data that will be fetched according to the current settings. This allows users to verify that the source is configured correctly before saving.

  • To test the current endpoint configuration, click the Test button to the right of the endpoint selection menu. Sample data will be fetched & displayed in the Endpoint Test Result panel on the right.

  • If the sample data is not as expected, review the selected endpoint and associated settings, and make any necessary adjustments. Then, click the Test button again, and check the sample data to ensure that the correct information is displayed.

Configure Manually

Bitbucket Server data sources can be manually configured to ingest data from any valid Bitbucket Server REST API endpoint. Manual configuration provides maximum flexibility for accessing endpoints not covered by pre-built templates or when you need custom API configurations.

With manual configuration, you can also create more complex Bitbucket Server sources, such as sources that use chained API calls to fetch data from multiple endpoints or sources that require custom authentication headers or request parameters.

API Method

  1. To manually configure this source, select the Advanced tab at the top of the configuration screen.

  2. Select the API method that will be used for calls to the Bitbucket Server API from the Method pulldown menu. The most common methods are:

    • GET: For retrieving data from the API
    • POST: For sending data to the API or triggering actions
    • PUT: For updating existing data
    • PATCH: For partial updates to existing data
    • DELETE: For removing data

API Endpoint URL

  1. Enter the URL of the Bitbucket Server API endpoint from which this source will fetch data in the Set API URL field. This should be the complete URL including the protocol (https://) and any required path parameters. Bitbucket Server API endpoints typically follow the pattern {base_url}/rest/api/latest/{endpoint_path} where {base_url} is your Bitbucket Server base URL.

Ensure the API endpoint URL is correct and accessible with your current credentials. You can test the endpoint using the Test button after configuring the URL. The endpoint requires Basic Authentication, which is handled automatically by your credential configuration. For detailed information about Bitbucket Server API endpoints and available APIs, see the Bitbucket Server REST API documentation.

Path to Data

  1. Enter the JSON path that identifies the location of the relevant data within the API response in the Path to Data field. JSON paths use dot notation to navigate through nested JSON structures.

    • For example, if your API response has the structure {"values": [...]}, you would enter $.values[*] to extract all items from the values array.
    • Use $[*] to extract all items from a root-level array.
    • Use $ to extract the entire root-level object.

JSON paths are case-sensitive and must match the exact structure of your API response. Bitbucket Server API responses typically use a values array to contain the actual data. Use the Test button to verify that your JSON path correctly extracts the desired data from the API response.

Save the Data Source

  1. Once all configuration steps have been completed, click the Save button to save your data source configuration.

  2. The data source will now be available in your data flow and will begin ingesting data according to the configured schedule and endpoint settings.