Developer Activity: Import API and Component
In this module, you will import an existing API and an existing Service using the Software Templates that you setup as the Platform Engineer in the previous section.
Please make sure to log in as a Developer with dev1/{common_password} . If you are unsure how to, please refer to the below note.
|
Click here to view instructions to login as the Developer.
Login as Developer
-
You will perform this activity as a Developer.
-
Logout from Red Hat Developer Hub
-
Navigate to the Settings menu at the bottom right side of Red Hat Developer Hub and click on the kebab menu in the Profile card
-
Sign out of Red Hat Developer Hub from the Settings section as shown in the screenshot below.
-
-
Logout from GitLab
-
Click on the Profile icon, and Sign out from the dropdown as shown in the screenshot below.
-
-
Login back as a Developer to to Red Hat Developer Hub and GitLab using the credentials
dev1/{common_password}
Import parasol-store-api OpenAPI
-
Access Red Hat Developer Hub (click here). If prompted login using
dev1/{common_password}
-
Click on the Create menu on the left-hand navigation, and click the Choose button on the Import Existing API Template.
-
You will be presented with the Software Template wizard.
A number of these fields have been prepopulated with default values for convenience. In reality, developers will need provide almost all of the values that are needed to import existing apps/APIs.
-
Step 1: Information about your existing API. Fill out the following values and click Next.
Field Description Value GitLab hostname
Keep default value
https://gitlab-gitlab.{openshift_cluster_ingress_domain}
GitLab Organization of Existing API
Keep default value
parasol
Repository name of Existing API
Keep default value
parasol-store-api
API specification path
Enter full path of the API
https://gitlab-gitlab.{openshift_cluster_ingress_domain}/parasol/parasol-store-api/-/blob/main/openapi.yaml
Type Of API
Keep default value
openapi
-
Step 2: New Component details.
Provide information about the new component you are registering. Fill out the following values and click ReviewField Description Value Component GitLab Organization
Keep default value
parasol
Component Repository name
Keep default value
envelope-parasol-catalog
Component Name of API
Keep default value
parasol-store-api
System Name
System (auto-populated)
system:default/parasol-system
Owner
Choose from dropdown
group:default/dev1
A Short Description Of This Component
Enter a suitable description
Open API specification for the parasol-store application
Lifecycle
Enter value. Can be any lifecycle value, but take great care to establish a proper taxonomy for these. (Well-known values
experimental
,production
anddeprecated
)production
-
Step 3: Review & Create.
Review the fields, and click on the Create button -
Run of import-api-catalog:
You are presented with a Component Merge Request URL -
Click on the link to open the merge request, and complete the merge by click on the Merge button.
-
You can navigate to the envelope-parasol-catalog repo to see that a new folder named
parasol-store-api
has been creates with acatalog-info.yaml
and a docs folder forTechDocs
.
Explore the parasol-store-api
component in the APIs section
-
The Parasol Store API that you just imported will appear in the APIs section automatically shortly. This is because of the auto-discover feature that you had enabled in the previous steps
-
Click on
parasol-store-api
and explore the component. The Docs tab displays the skeleton techdocs that was added. -
The Definition tab showcases the OpenAPI spec nicely formatted. This is due to the fact that you selected
openapi
as the API type while importing the API.
-
Import parasol-store service
-
From the Create left side menu of Red Hat Developer Hub, click on the Choose button of the
Import Existing Application
template. -
Fill out the following values in the Software Template wizard.
A number of these fields have been prepopulated with default values for convenience. In reality, developers will need provide almost all of the values that are needed to import existing apps/APIs.
-
Step 1: Information about your existing application:
Provide information about your existing serviceField Description Value GitLab Hostname
Keep default value
GitLab Organization
Keep default value
parasol
Repository Name
Keep default value
parasol-store
-
Step 2: New Component details:
Provide information about your existing appField Description Value Component GitLab Organization
Keep default value
parasol
Component Repository Name
Keep default value
envelope-parasol-catalog
Component Name of the App
Keep default value
parasol-store
System name
System (auto-populated)
system:default/parasol-system
Owner
Keep default value
group:default/dev1
A Short Description Of This Component
Keep default value
Core services for the Parasol application
-
Step 3: Additional Component details:
Provide additional information about the new componentField Description Value Does this repo contain manifests?
This option conditionally auto-generates the metadata with the right labels which will be used to pull in CI/CD, Deployment and other details
Make sure to check the box
Type
The type of component. Well-known and common values: service, website, library.
service
Indentify the APIs consumed by this component
This multi-select allows you to attach APIs to the component
Choose
parasol-store-api
Check to add TechDocs
Conditionally auto-generates TechDocs skeleton for the component
Check the box
Lifecycle
Choose from dropdown
production
-
Step 4: Review
Review the fields, and click on the Create button -
Run of import-existing-app-template In the final step you are presented with a Merge Request.
-
Click on Component Merge Request link to open the merge request on GitLab, and complete the merge by clicking on the Merge button
. The Parasol Store service that you just imported will appear in the Red Hat Developer Hub Catalog shortly.
Explore the parasol-store
component in the Catalog section
-
In a few minutes the
parasol-store
Component you just imported will start appearing in the Catalog section of Red Hat Developer Hub automatically.
Click on the parasol-store
link to view the component. You can step through each of the tabs to see how RHDH provides a single pane of glass to see
-
Topology showing the deployments on OpenShift
-
CI showing Pipeline Runs is currently empty, because there are no pipeline runs yet.
-
CD tab showing the deployed components/systems using ArgoCD plugin
-
The Api tab shows the Consumed API
parasol-store-api
. Explore the Dependencies tab as well. -
The Docs contains the skeleton TechDocs created by the template. You can click on the
Pencil icon
to edit the docs.