Getting started with API controller


Red Hat Connectivity Link 1.0

API creation and management

Red Hat Connectivity Link documentation team

Abstract

This guide describes how to get started with using Connectivity Link.

Preface

Providing feedback on Red Hat documentation

Red Hat appreciates your feedback on product documentation.

To propose improvements, open a Jira issue and describe your suggested changes. Provide as much detail as possible to help the documentation team to address your request quickly.

Prerequisite

  • You have a Red Hat Customer Portal account. This account enables you to log in to the Red Hat Jira Software instance. If you do not have an account, you will be prompted to create one.

Procedure

  1. Click the following link: Create issue.
  2. In the Summary text box, enter a brief description of the issue.
  3. In the Description text box, provide the following information:

    • The URL of the page where you found the issue.
    • A detailed description of the issue. You can leave the information in any other fields at their default values.
  4. In the Reporter field, enter your Jira username.
  5. Click Create to submit the Jira issue to the documentation team.

Thank you for taking the time to provide feedback.

Chapter 1. What is API controller?

API controller enables you to manage the lifecycle of schemas and API definitions. You can design artifacts using Apicurio Studio and manage those artifacts using Apicurio Registry.

This release is a Developer Preview of API controller.

Important

Developer Preview features are not supported by Red Hat in any way and are not functionally complete or production-ready. Do not use Developer Preview features for production or business-critical workloads. Developer Preview features provide early access to functionality in advance of possible inclusion in a Red Hat product offering. Customers can use these features to test functionality and provide feedback during the development process.

Developer Preview features might not have any documentation, are subject to change or removal at any time, and have received limited testing. Red Hat might provide ways to submit feedback on Developer Preview features without an associated SLA. For more information, see Red Hat Developer Preview - Scope of Support.

After you have created an API or schema with API controller, you can use that artifact with Connectivity Link to:

  • Secure your applications with TLSPolicy
  • Protect your applications with AuthPolicy
  • Protect your applications with RateLimitPolicy
  • Connect your applications with DNSPolicy

Connectivity Link also provides observability using Grafana, Prometheus, and Alertmanager.

Apicurio Studio provides a UI to collaborate on draft artifacts as you design APIs and schemas. After you finalize a design, you can further manage that artifact in Apicurio Registry.

Chapter 2. Installing API controller

To install API controller use the community Operator.

Prerequisites

  • cluster-admin access to an OpenShift cluster.

Procedure

  1. In the OpenShift Container Platform web console, log in with cluster-admin privileges.
  2. In the left navigation menu, click Operators > OperatorHub.
  3. In the Filter by keyword text box, enter Apicurio to find the Apicurio API Controller.
  4. Read the information about the Operator, and click Install to display the Operator subscription page.
  5. Accept the default subscription settings noting the following:

    • Installation mode: All namespaces on the cluster (default).
    • Installed namespace: Select the namespace where you want to install the Operator, for example, api-controller. If the namespace does not already exist, click this field and select Create Project to create the namespace.
    • Approval Strategy: Select Automatic or Manual.
  6. Click Install, and wait a few moments until the Operator is installed and ready for use.
  7. Verify that the Operator is installed. After you have installed the Operator, click Operators > Installed Operators to verify that the Apicurio API Controller is installed in your selected namespace, for example api-controller.
  8. Change to the Developer view in the OpenShift Container Platform web console to apply the YAML required for installation.
  9. Create a PostgreSQL database using the following YAML in the api-controller namespace:

    apiVersion: v1
    kind: PersistentVolumeClaim
    metadata:
      name: registry-pvc
      namespace: api-controller
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 1Gi  # Adjust the storage size as needed
    ---
    apiVersion: apps/v1
    kind: Deployment
    metadata:
      namespace: "api-controller"
      labels:
        app: postgresql
      name: postgresql
    spec:
      replicas: 1
      selector:
        matchLabels:
          app: postgresql
      template:
        metadata:
          labels:
            app: postgresql
        spec:
          initContainers:
            - name: init-data
              image: busybox
              command: ['sh', '-c', 'rm -rf /var/lib/postgresql/data/* && mkdir -p /var/lib/postgresql/data/pgdata']
              volumeMounts:
                - mountPath: "/var/lib/postgresql/data"
                  name: "registry-pgdata"
          containers:
            - name: postgresql
              image: quay.io/debezium/postgres:13-alpine
              ports:
                - containerPort: 5432
              env:
                - name: POSTGRES_DB
                  value: registry
                - name: POSTGRES_USER
                  value: apicurio
                - name: POSTGRES_PASSWORD
                  value: registry
                - name: PGDATA
                  value: "/var/lib/postgresql/data/pgdata"
              volumeMounts:
                - mountPath: "/var/lib/postgresql/data"
                  name: "registry-pgdata"
          volumes:
            - name: registry-pgdata
              persistentVolumeClaim:
                claimName: registry-pvc
    ---
    apiVersion: v1
    kind: Service
    metadata:
      namespace: "api-controller"
      labels:
        app: postgresql
      name: postgresql-service
    spec:
      ports:
        - name: http
          port: 5432
          protocol: TCP
          targetPort: 5432
      selector:
        app: postgresql
      type: ClusterIP
    Copy to Clipboard Toggle word wrap
  10. Create a CR named apicurio, and the required Routes using the following YAML in the api-controller namespace:

    Note

    Replace mycluster.example.com with your cluster hostname.

    # Replace mycluster.example.com with your cluster hostname
    # Create an API Controller custom resource
    apiVersion: registry.apicur.io/v1
    kind: ApicurioRegistry3
    metadata:
      name: apicurio
      namespace: api-controller
    spec:
      studioUi:
        enabled: true
        env:
          - name: APICURIO_REGISTRY_API_URL
            value: 'https://api-controller-app.apps.mycluster.example.com/apis/registry/v3'
          - name: APICURIO_REGISTRY_UI_URL
            value: 'https://api-controller-ui.apps.mycluster.example.com'
      ui:
        env:
          - name: REGISTRY_API_URL
            value: 'https://api-controller-app.apps.mycluster.example.com/apis/registry/v3'
      app:
        sql:
          dataSource:
            username: apicurio
            password: registry
            url: 'jdbc:postgresql://postgresql-service:5432/registry'
    ---
    # Create a route for the Apicurio Registry API
    apiVersion: route.openshift.io/v1
    kind: Route
    metadata:
      name: api-controller-registry-api
      namespace: api-controller
    spec:
      host: api-controller-app.apps.mycluster.example.com
      path: /
      to:
        kind: Service
        name: apicurio-app-service
      port:
        targetPort: http
      tls:
        termination: edge
        insecureEdgeTerminationPolicy: Redirect
      wildcardPolicy: None
    ---
    # Create a route for the Apicurio Registry UI
    apiVersion: route.openshift.io/v1
    kind: Route
    metadata:
      name: api-controller-registry-ui
      namespace: api-controller
    spec:
      host: api-controller-ui.apps.mycluster.example.com
      path: /
      to:
        kind: Service
        name: apicurio-ui-service
      port:
        targetPort: http
      tls:
        termination: edge
        insecureEdgeTerminationPolicy: Redirect
      wildcardPolicy: None
    ---
    # Create a route for the Apicurio Studio UI
    apiVersion: route.openshift.io/v1
    kind: Route
    metadata:
      name: api-controller-studio-ui
      namespace: api-controller
    spec:
      host: api-controller-studio-ui.apps.mycluster.example.com
      path: /
      to:
        kind: Service
        name: apicurio-studio-ui-service
      port:
        targetPort: http
      tls:
        termination: edge
        insecureEdgeTerminationPolicy: Redirect
      wildcardPolicy: None
    Copy to Clipboard Toggle word wrap

Verification

Navigate to the api-controller-studio-ui Route and click the Location URL. The Apicurio Studio console should be displayed.

Chapter 3. Getting started with Apicurio Studio

3.1. What is Apicurio Studio?

Apicurio Studio enables you to design schemas and API definitions. It provides a web console to make it easy for API owners and developers to manage the content of event schemas and API definitions.

You can use Apicurio Studio to create a schema or API design from a simple template, use one of the detailed templates provided, or import an existing design to edit it. As you evolve your design, it is saved automatically to Apicurio Registry as DRAFT. When you are happy with your content, you can promote your design to ENABLED in Apicurio Registry.

Apicurio Studio is based on the Apicurio Studio open source community project.

Key concepts

To understand how Apicurio Studio works, it is important to understand the following key concepts:

Apicurio Studio web console

The web environment where developers create, manage, and organize their API and schema designs.

You can use the Apicurio Studio web console to complete the following tasks:

  • Browse and search the schema and API designs that are stored in Apicurio Studio
  • Add new schema and API designs and versions
  • Import content from a file, from a URL, or from a Apicurio Registry instance
  • Show the changes that you have made in your current editing session
Draft

An API design or schema design. When downloaded to a local project, or used in Apicurio Registry, designs are referred to as artifacts.

Apicurio Studio supports the following API types:

  • AsyncAPI
  • OpenAPI

Apicurio Studio supports the following schema types:

  • Apache Avro
  • JSON Schema
  • Google Protocol Buffers (Protobuf)

Apicurio Studio use cases

The main use cases for Apicurio Studio are as follows:

  • Contract-first application development

    You can use Apicurio Studio to visually design the API and data models (contracts) required by your applications, before you write any application code. After you define the contract, it is easier to create the application logic needed to satisfy the contract. You can generate Quarkus-based client and server applications from designs created in Apicurio Studio.

  • Population of Apicurio Registry

    All API and schema designs are saved to Apicurio Registry. You can use Apicurio Registry features, for example:

  • Creating rules for design change validation.
  • Using the Apicurio Registry REST API to dereference complex JSON Schemas.

3.2. Creating an API draft

Use the Apicurio Studio web console to create an OpenAPI or AsyncAPI definition.

Prerequisites

  • You’re logged in to the Apicurio Studio web console.

Procedure

  1. In the Apicurio Studio web console, click Create draft.
  2. Complete the wizard to provide the following details for the new draft:

    1. Specify the Draft Coordinates and click Next:

      • Group ID & Draft ID: Use the default empty settings to automatically generate an Draft ID and add the Draft to the default Draft group. Alternatively, you can enter an optional Group ID or Draft ID.
      • Version number: Optionally specify a version number.
      • Type: Use the default Auto-Detect setting to automatically detect the Draft type (not allowed if creating an empty Draft), or select the Draft type from the list, for example, OpenAPI.
    2. Specify the Draft Content and click Next:

      • From template: Choose from the list of templates.

        • From local file: Click Browse, and select a file, or drag and drop a file. For example, my-openapi.json or my-schema.proto. Alternatively, you can enter the file contents in the text box.
        • From URL: Enter a valid and accessible URL, and click Fetch. For example: https://petstore3.swagger.io/api/v3/openapi.json.
    3. Specify the Draft Metadata:

      • Name: Enter an optional friendly name for the first artifact version.
      • Description: Enter an optional description for the first artifact version.
  3. Click Create to create the draft. The Draft details view is displayed.
  4. To edit the draft, click Edit draft.

    1. Click the Design tab, and optionally edit the draft as follows:

      • Provide a version number and a description.
      • (AsyncAPI only) Define terms of service.
      • Add your contact information: name, email address, and URL.
      • Select a license.
      • (OpenAPI only) Define tags.
      • Define one or more servers.
      • Configure a security scheme.
      • (OpenAPI only) Specify security requirements.
      • (OpenAPI only) Configure vendor extensions.
    2. Click the Source tab, and review the live preview of the draft. The content of the Source tab automatically updates when you edit values on the editor page.
    3. (Optional) To see the changes that you made since the last save, click Actions > Show draft changes.
    4. (Optional) In the left pane of the draft editor, you can add the following items:

      • (OpenAPI only) Resource paths, data types, and responses
      • (AsyncAPI only) Channels, data types, messages, operation traits, and message traits
    5. Click Save.
    6. Use the breadcrumbs to navigate back to the Drafts page.

The new draft is listed on the Drafts page using the Group ID and Draft ID. You can use the options icon (three vertical dots) to view the draft details, edit the draft content, finalize the draft, view the draft in Apicurio Registry, or delete the draft.

Additional information

See Section 3.4, “Finalizing a draft”

3.3. Creating a schema draft

Use the Apicurio Studio web console to create an Apache Avro, JSON Schema, or Google Protocol Buffers (Protobuf) event schema.

Prerequisites

  • You’re logged in to the Apicurio Studio web console.

Procedure

  1. In the Apicurio Studio web console, click Create draft.
  2. Complete the wizard to provide the following details for the new draft:

    1. Specify the Draft Coordinates and click Next:

      • Group ID & Draft ID: Use the default empty settings to automatically generate an Draft ID and add the Draft to the default Draft group. Alternatively, you can enter an optional Group ID or Draft ID.
      • Version number: Optionally specify a version number.
      • Type: Use the default Auto-Detect setting to automatically detect the Draft type (not allowed if creating an empty Draft), or select the Draft type from the list, for example, Apache Avro.
    2. Specify the Draft Content and click Next:

      • From template: Choose from the list of templates.

        • From local file: Click Browse, and select a file, or drag and drop a file. For example, my-openapi.json or my-schema.proto. Alternatively, you can enter the file contents in the text box.
        • From URL: Enter a valid and accessible URL, and click Fetch. For example: https://petstore3.swagger.io/api/v3/openapi.json.
    3. Specify the Draft Metadata:

      • Name: Enter an optional friendly name for the first artifact version.
      • Description: Enter an optional description for the first artifact version.
  3. Click Create to create the draft. The Draft details view is displayed.
  4. To edit the draft, click Edit draft.

    1. Click the Design tab, and edit the draft.
    2. (Optional) To see the changes that you made since the last save, click Actions > Show draft changes.
    3. (Optional) In the left pane of the draft editor, you can add the following items:
    4. Click Save.
    5. Use the breadcrumbs to navigate back to the Drafts page.

The new draft is listed on the Drafts page using the Group ID and Draft ID. You can use the options icon (three vertical dots) to view the draft details, edit the draft content, finalize the draft, view the draft in Apicurio Registry, or delete the draft.

Additional information

See Section 3.4, “Finalizing a draft”

3.4. Finalizing a draft

Use the Apicurio Studio web console to finalize a draft. This action changes the status of the artifact in Apicurio Registry from DRAFT to ENABLED.

Prerequisites

  • You’re logged in to the Apicurio Studio web console.

Procedure

  1. Navigate to the draft in Apicurio Studio. For example:

    1. Set Filter by to Name
    2. Enter the name of the draft in the search field.
    3. Click the Search icon or press Return.
  2. You can finalize a draft in two ways:

    • From the search results, click the options icon (three vertical dots) and choose Finalize draft.
    • Click on the draft coordinates listed in the search results to see the draft details page and then click the Finalize draft button.

    The Final draft? modal is displayed.

  3. Confirm that you want to finalize the draft.

    A Dry run only option allows you to validate the draft before finalizing it.

    A confirmation page appears with the details of the artifact.

    Important

    After a draft is finalized, you can no longer view or edit that artifact in Apicurio Studio. You must use Apicurio Registry to perform further edits.

  4. Navigate to the artifact in Apicurio Registry. From the confirmation page, you can navigate to the artifact in Apicurio Registry by selecting View in Registry from the options menu (three vertical dots).

Chapter 4. Getting started with Apicurio Registry

Apicurio Registry is a powerful tool for managing and storing data schemas, API designs, or any structured content in a centralized repository. It supports a wide variety of artifact types, including Avro, Protobuf, JSON Schema, and OpenAPI definitions.

Additional information

4.1. Exploring artifacts

Artifacts are the building blocks of Apicurio Registry. They represent data structures, API designs, or schema definitions stored in the registry for reuse and collaboration. You can upload, update, and retrieve artifacts, view their version history, and manage their lifecycle.

4.2. Managing groups

Groups allow you to organize artifacts logically, making it easier to manage and retrieve them. Each artifact belongs to a group, and groups can represent domains, projects, or teams. Grouping provides isolation while enabling fine-grained control over access and usage policies.

4.3. Managing rules

Rules in Apicurio Registry help enforce consistency and quality by validating artifacts against defined standards. You can apply global rules for the entire registry or configure specific rules for individual groups and artifacts.

4.4. Configuring settings

The configuration options in Apicurio Registry allow you to tailor the registry to your specific needs. Adjust operational parameters, integrate with external systems, or configure advanced settings to enhance performance and security.

4.5. Using the API

Apicurio Registry provides a robust REST API to interact with the registry programmatically. Developers can automate artifact management, integrate registry features into CI/CD pipelines, or build custom tools to enhance schema governance.

Appendix A. Using your Red Hat subscription

Red Hat Connectivity Link is provided through a software subscription. To manage your subscriptions, access your account at the Red Hat Customer Portal.

Managing your subscriptions

  1. Go to access.redhat.com.
  2. If you do not already have an account, create one.
  3. Log in to your account.
  4. In the menu bar, click Subscriptions to view and manage your subscriptions.

Revised on 2024-12-09 19:07:14 UTC

Legal Notice

Copyright © 2024 Red Hat, Inc.
The text of and illustrations in this document are licensed by Red Hat under a Creative Commons Attribution–Share Alike 3.0 Unported license ("CC-BY-SA"). An explanation of CC-BY-SA is available at http://creativecommons.org/licenses/by-sa/3.0/. In accordance with CC-BY-SA, if you distribute this document or an adaptation of it, you must provide the URL for the original version.
Red Hat, as the licensor of this document, waives the right to enforce, and agrees not to assert, Section 4d of CC-BY-SA to the fullest extent permitted by applicable law.
Red Hat, Red Hat Enterprise Linux, the Shadowman logo, the Red Hat logo, JBoss, OpenShift, Fedora, the Infinity logo, and RHCE are trademarks of Red Hat, Inc., registered in the United States and other countries.
Linux® is the registered trademark of Linus Torvalds in the United States and other countries.
Java® is a registered trademark of Oracle and/or its affiliates.
XFS® is a trademark of Silicon Graphics International Corp. or its subsidiaries in the United States and/or other countries.
MySQL® is a registered trademark of MySQL AB in the United States, the European Union and other countries.
Node.js® is an official trademark of Joyent. Red Hat is not formally related to or endorsed by the official Joyent Node.js open source or commercial project.
The OpenStack® Word Mark and OpenStack logo are either registered trademarks/service marks or trademarks/service marks of the OpenStack Foundation, in the United States and other countries and are used with the OpenStack Foundation's permission. We are not affiliated with, endorsed or sponsored by the OpenStack Foundation, or the OpenStack community.
All other trademarks are the property of their respective owners.
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat