Getting started with Red Hat OpenShift API Designer
Red Hat® OpenShift® API Designer is a managed cloud service that enables you to design schemas and API definitions without having to install, configure, run, and maintain your own infrastructure. Red Hat OpenShift API Designer provides a web console to make it easy for API owners and developers to manage the content of event schemas and API definitions.
To access a quick start that guides you through setup, please follow this link to the Red Hat Console.
What do you need before starting?
- Red Hat account
- Current subscription or trial access to Red Hat OpenShift Dedicated or Red Hat OpenShift Service on AWS
- A running Service Registry instance (required only if you want to export to Service Registry, see the Getting started with Service Registry quick start)
What is Red Hat OpenShift API Designer?
The OpenShift API Management service adds full API lifecycle management capabilities to Red Hat OpenShift Dedicated and Red Hat OpenShift Service on AWS. Red Hat hosts and manages both the service and the underlying OpenShift platform.
Based on the Red Hat 3scale API Management platform, the service includes API traffic control and API program management solutions like analytics, access control, developer workflows, and more, so you can:
- Build an API management program to secure and share APIs with internal and external consumers, then monitor and control usage
- Adopt an API-first approach to reuse existing systems or create modern applications that work across hybrid cloud environments
- Rapidly develop, deploy, and scale microservices-based, integrated applications through a single DevOps pipeline
In the following sections, we’ll give you some ways you can use the OpenShift API Management web console to accomplish some of these goals.
Creating an API design
Use the Red Hat OpenShift API Designer web console to create an OpenAPI or AsyncAPI definition.
- In the Red Hat OpenShift API Designer web console, click Create design.
- Complete the form to provide the following details for the new design:
- Name: Enter a unique design name, such as
My API Design
. - Description (Optional): Enter a short description of the design.
- Type: Accept the default value OpenAPI, or select another API type from the list.
- Version (OpenAPI only): Accept the default value 3.0.2, or select another version from the list.
- Template: Select the Pet Store Example template, or select another template from the list.
- Name: Enter a unique design name, such as
- Click Create. The new API design opens in the design editor.
- Select the design title and click the pen icon. Change the design title to Orders and click the Save changes icon.
NOTE: Editing the design title does not change the design name. To rename a design, click Actions > Edit design metadata, edit the design name, and click Save. - Click the Design tab, and optionally edit the design 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.
- Click the Source tab, and review the live preview of the design. The content of the Source tab automatically updates when you edit values on the editor page.
- (Optional) To see the changes that you made since the last save, click Actions > Show design changes.
- (Optional) In the left pane of the design 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
- Click Save.
The new design is listed on the API and Schema Designs page. You can use the options icon (three vertical dots) to view or edit the design details, edit the design content, export the design to Red Hat OpenShift Service Registry, download the design to a file, or delete the design.
Creating a schema design
Use the Red Hat OpenShift API Designer web console to create an Apache Avro, JSON Schema, or Google Protocol Buffers (Protobuf) event schema.
- In the Red Hat OpenShift API Designer web console, click Create design.
- Complete the form to provide the following details for the new design:
- Name: Enter a unique design name, such as
My Schema Design
. - Description (Optional): Enter a short description of the design.
- Type: From the list, select Apache Avro, or select another schema type.
- Name: Enter a unique design name, such as
- Click Create. The new schema design opens in the design editor.
- Edit the design source to provide your content.
- (Optional) To see the changes that you made since the last save, click Actions > Show design changes.
- (Optional) For Apache Avro or JSON Schema designs, you can click Actions > Format design content to insert spaces and tabs that align your design content correctly.
- Click Save.
The new design is listed on the API and Schema Designs page. You can use the options icon (three vertical dots) to view or edit the design details, edit the design content, export the design to Red Hat OpenShift Service Registry, download the design to a file, or delete the design.
Importing a schema or API design
You can import an event schema or API definition into Red Hat OpenShift API Designer from a URL, from a file, or from a running Red Hat OpenShift Service Registry instance.
In addition to the prerequisites for this Quick Start, this step requires:
- You’re logged in to the Red Hat OpenShift API Designer web console at https://console.redhat.com/application-services/api-designer/.
- You can access a running OpenShift Service Registry instance in your organization, if you want to import from Red Hat OpenShift Service Registry. For more information, see Getting started with Red Hat OpenShift Service Registry.
Steps:
- In the Red Hat OpenShift API Designer web console, click Import design, and then click one of the following options:
- Import from Service Registry: From the instances list, select a Service Registry instance. Browse the list of artifacts for that instance, and select an artifact.
- Import from URL: Enter a valid and accessible URL, and click Fetch.
- Import from file: Click Browse and select a file, or drag and drop a file.
- When prompted, provide additional information such as version (OpenAPI only), name, type, and description in the import dialog. You can overwrite any autopopulated values.
- Click Import. The design editor opens automatically.
Testing a schema or API design
You can test that your schema or API design content is valid and compatible with existing content by applying the rules of an existing Red Hat OpenShift Service Registry instance. You can test the design while working in the Red Hat OpenShift API Designer editor, without exporting the design to Red Hat OpenShift Service Registry.
In addition to the prerequisites for this Quick Start, this step requires:
- You’re logged in to the Red Hat OpenShift API Designer web console at https://console.redhat.com/application-services/api-designer/.
- You’ve created or imported a design in OpenShift API Designer.
- You can access a running OpenShift Service Registry instance in your organization. Within that instance, you know the artifact ID of an artifact with the required rules configured. For more information, see Getting started with Red Hat OpenShift Service Registry.
Steps:
- On the API and Schema Designs page of the Red Hat OpenShift API Designer web console, select the design that you want to test.
- Click the options icon (three vertical dots), and click Edit design content to open the design editor.
- From the Actions menu, click Run Service Registry check.
- From the Registry instance list, select a Service Registry instance.
- In the Group and ID fields, specify the artifact details.
- Click Test.
Exporting a schema or API design
When you’re happy with the changes to your Red Hat OpenShift API Designer event schema or API definition, and you want to use the design in your application, you can export the content to an existing Red Hat OpenShift Service Registry instance.
In addition to the prerequisites for this Quick Start, this step requires:
- You’re logged in to the Red Hat OpenShift API Designer web console at https://console.redhat.com/application-services/api-designer/.
- You’ve created or imported a design in OpenShift API Designer.
- You can access a running OpenShift Service Registry instance in your organization. For more information, see Getting started with Red Hat OpenShift Service Registry.
Steps:
- On the API and Schema Designs page of the Red Hat OpenShift API Designer web console, select the design that you want to export.
- Click the options icon (three vertical dots), and click Export design to Service Registry.
NOTE: You can also select Export design to Service Registry from the Actions menu in the design editor. - Complete the form to specify where to save the new design. Provide the following details:
NOTE: If the design was originally imported from Red Hat OpenShift Service Registry, the fields are prepopulated with the details of the original OpenShift Service Registry instance, and the Version field is blank.- Registry Instance: Select the required instance from the list.
- Group (Optional): Enter a unique group name such as
my-org
to organize the artifact in a named collection. Each group contains a logically related set of schemas or API designs, typically managed by a single entity, belonging to a particular application or organization.
NOTE: Specifying a group is optional when using the web console. If no group is specified, Service Registry uses the default group. - ID (Optional): Enter a unique ID for this artifact, such as
my-id
. If you don’t specify a unique artifact ID, Service Registry generates one automatically as a UUID. - Version (Optional): Specify the version number. If you don’t specify a version number, Service Registry sets the version to 1 for the first version, or increments the latest version by 1 for subsequent versions.
- Click Export. The exported design is listed on the artifacts page of the specified Service Registry instance.
What's next?
For additional information on getting started with OpenShift API Designer, visit the quick start hub on console.