Skip to content

Commit

Permalink
Merge pull request #404 from rpscodes/master
Browse files Browse the repository at this point in the history
Create new flows without Gogs
  • Loading branch information
hguerrero authored Mar 16, 2022
2 parents ef32c66 + 329efad commit db72b68
Show file tree
Hide file tree
Showing 16 changed files with 128 additions and 214 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 6 additions & 6 deletions docs/labs/developer-track/lab01/walkthrough.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ Let's start verifying your API.

. Time to verify our data definitions for the API. Click on the `+location/phone/{id}+` link under the _Paths_.
+
image::images/api-designer-location-path.png[api-designer-location-path, role="integr8ly-img-responsive"]
image::images/api-designer-location-phone.png[api-designer-location-phone, role="integr8ly-img-responsive"]

. Notice that this API path has a single path parameter (`id` defined as an `int32`) and a single GET operation defined. Click on the GET operation, then click the location drop-down which is part of the 200 OK response.
+
image::images/api-dsigner-id-int32.png[api-dsigner-id-int32, role="integr8ly-img-responsive"]
image::images/api-designer-path.png[api-designer-path, role="integr8ly-img-responsive"]

. Notice that this API path has a single response defined (a `200 OK` response) and the type that is returned is a `location` object.
+
image::images/api-dsigner-location-response.png[api-dsigner-location-response, role="integr8ly-img-responsive"]
image::images/api-designer-response.png[api-designer-response, role="integr8ly-img-responsive"]

[type=verification]
Did you verify the `200 OK` response returns a `location`?
Expand All @@ -87,17 +87,17 @@ Have your instructor check the Kubernetes pod that contains the API Designer app

. Click on the `</> location` object link under the _Data Types_ section. Notice that the object has a bunch of properties defined which make up the object.
+
image::images/api-designer-location-datatype.png[api-designer-location-datatype, role="integr8ly-img-responsive"]
image::images/api-designer-location.png[api-designer-location, role="integr8ly-img-responsive"]

. Click on the source link and notice that we have both YAML and JSON schemas generated by our object design:
+
image::images/api-designer-source.png[api-designer-source, role="integr8ly-img-responsive"]
image::images/api-designer-json-yaml.png[api-designer-json-yaml, role="integr8ly-img-responsive"]

=== Step 4: Verify the /locations path

. Click the */locations* path. Then click on the source tab. Notice that we have both a GET and POST request defined, together with a couple of example requests. Using a POST method, we can insert a new record into our sample database with Fuse.
+
image::images/api-designer-locations-path-methods.png[api-designer-locations-path-methods, role="integr8ly-img-responsive"]
image::images/api-designer-get-post.png[api-designer-get-post, role="integr8ly-img-responsive"]

[type=verification]
Did you locate the `get` and `post` requests in the source for `/locations`?
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
113 changes: 13 additions & 100 deletions docs/labs/developer-track/lab02/walkthrough.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -39,78 +39,8 @@ Your password is: `{user-password}`
* link:{microcks-url}[Microcks Console, window="_blank"]
****

[type=walkthroughResource]
.Gogs
****
* link:{gogs-url}[Gogs Console, window="_blank"]
****

[time=5]
[id="Prerequisite"]
== Prerequisite: Setup the collaboration environment using Git (Gogs)

For the Developer track, we require a collaboration environment based on Git. For this purpose, we decided to use Gogs which is a hosted, lighter-weight version of Gitlab. This lab environment has created a user for you in Gogs.

Follow this instructions to set up the repository.

. Click on the *Gogs Console* link, located on the right of this walkthrough.

. Click on *Sign In*.
+
image::images/gogs-signin-link.png[microcks-signin-link, role="integr8ly-img-responsive"]

. Log into Gogs using `{user-username}` and `{user-password}`. You should see the repository dashboard.
+
image::images/gogs-dashboard.png[gogs-dashboard, role="integr8ly-img-responsive"]

. In the main page, click in the + sign in the right top corner to display the New menu. Click the *New Migration* option.
+
image::images/gogs-new-migration.png[gogs-new-migration, role="integr8ly-img-responsive"]

. Fill in the information of the repository migration with the following values:
** Clone Address: *https://github.com/RedHatWorkshops/dayinthelife-openapi.git*
** Owner: *`{user-username}`*
** Repository Name: *locations-api*
+
image::images/gogs-migrate-repository.png[gogs-migrate-repository, role="integr8ly-img-responsive"]

. Click on *Migrate Repository* to fork the GitHub repo into Gogs.
. Switch to branch `dev-track-lab-02`
+
image::images/gogs-switch-branch.png[gogs-switch-branch, role="integr8ly-img-responsive"]

. Open the `locations-api` folder and click on the filename link *Locations-userX.json* to open and review the file.
+
image::images/gogs-locations-userX.png[gogs-locations-userX, role="integr8ly-img-responsive"]

. Click the *pencil* button to edit the file.
+
image::images/gogs-locations-userX-edit.png[gogs-locations-userX-edit, role="integr8ly-img-responsive"]

. Replace all occurances of *userX* with your user number i.e. ``{user-username}``.
+
image::images/gogs-locations-userX-replace.png[gogs-locations-userX-replace, role="integr8ly-img-responsive"]

. Scroll down to bottom of the page and click *Commit Changes*.
+
image::images/gogs-locations-userX-commit.png[gogs-locations-userX-commit, role="integr8ly-img-responsive"]

. Click the *RAW* button to get the raw download version of the file.
+
image::images/gogs-locations-userX-raw.png[gogs-locations-userX-raw, role="integr8ly-img-responsive"]

. Copy the browser tab URL. Store that URL address as you will use it in the next steps of the lab. The URL should look like the following:
+
[source,bash,subs="attributes+"]
----
http://gogs.{openshift-app-host}/{user-username}/locations-api/raw/dev-track-lab-02/locations-api/Locations-{user-username}.json
----

[type=verification]
Did you confirm the URL of the raw file matches the example shown?

[type=verificationFail]
Try to redo this section, if any problem persists have your instructor check the Kubernetes pod that contains the Gogs application.

[time=6]
[id="Microcks setup"]
Expand All @@ -128,47 +58,30 @@ image::images/microcks-login-page.png[microcks-login-page.png, role="integr8ly-i
+
image::images/microcks-importers-link.png[microcks-importers-link, role="integr8ly-img-responsive"]

. Click the *Create* button to create your first job.
+
image::images/microcks-import-job-create.png[microcks-import-job-create, role="integr8ly-img-responsive"]

. In the _Create a New Job_ dialog, type in the following information. Click *Next*.
** Name: *`Locations-{user-username}`*
** Repository URL: *`http://gogs.{openshift-app-host}/{user-username}/locations-api/raw/dev-track-lab-02/locations-api/Locations-{user-username}.json`*

. Click *Next* for the Authentication options.
. Click the *upload* button to create your first job.
+
image::images/microcks-import-form.png[microcks-import-form, role="integr8ly-img-responsive"]
image::images/api-mocking-upload.png[api-mocking-upload, role="integr8ly-img-responsive"]

. Leave Authentication options unchanged and click *Next*.

. Review the details and click on *Create* to create the job.
. Upload the Locations.yaml file(Open API specification file) we used with the API Designer in the preious lab here. In case you skipped the previous lab you can download the file from here:
** Url: `+https://raw.githubusercontent.com/RedHat-Middleware-Workshops/dayinthelife-integration/master/docs/labs/developer-track/resources/Locations.yaml+`
+
image::images/microcks-import-job-complete.png[microcks-import-job-complete, role="integr8ly-img-responsive"]
image::images/api-mocking-file.png[api-mocking-file, role="integr8ly-img-responsive"]

. Click on the *kebab menu* (three dots), then select the *Force Import* option. This will start the synchronization job.
. After the upload is complete, click on APIs|Services tab to locate your mock API
+
image::images/microcks-job-force-import.png[microcks-job-force-import, role="integr8ly-img-responsive"]

. Refresh your window to get it to the latest state.
image::images/api-mocking-apis-services.png[api-mocking-apis-services, role="integr8ly-img-responsive"]

. You will see three labels next to your job. Click the *Services* label.
. Click on the API that is listed
+
image::images/microcks-import-services.png[microcks-import-services, role="integr8ly-img-responsive"]

. In the dialog you will see your service listed. Click on the *Locations-{user-username} - 1.0.0* link.
+
image::images/microcks-service-link.png[microcks-service-link, role="integr8ly-img-responsive"]

. Click *Close* to dismiss the dialog.
image::images/api-mocking-locate-api.png[api-mocking-locate-api, role="integr8ly-img-responsive"]

. This is your new REST mock service based on the OpenAPI definition you just loaded to Microcks. Click on the arrow to expand the *GET /locations* operation.
+
image::images/microcks-expand-get-operation.png[microcks-expand-get-operation, role="integr8ly-img-responsive"]

. You can check that the example we added to the definition in Lab 1 will be used to return the mock values. Scroll down, copy and save the *Mock URL*, we will use that endpoint to test the REST mock service.
+
image::images/microcks-mock-service-url.png[microcks-mock-service-url, role="integr8ly-img-responsive"]
image::images/api-mocking-get-location.png[api-mocking-get-location, role="integr8ly-img-responsive"]

[type=verification]
Did you copy the *Mock URL*?
Expand All @@ -189,13 +102,13 @@ We now have a working REST mock service listening for requests. We will use an o
curl https://microcks.{openshift-app-host}/rest/Locations-{user-username}/1.0.0/locations
----

. Click the *Send* button.
. Click the *Run* button.
+
image::images/online-curl-test.png[online-curl-test, role="integr8ly-img-responsive"]
image::images/req-bin-run.png[req-bin-run, role="integr8ly-img-responsive"]

. The page will load the response information from the service. The _Content_ tab contains the examples we added during the design phase. You can also review the _Headers_ tab if you'd like.
+
image::images/online-curl-response.png[online-curl-response, role="integr8ly-img-responsive"]
image::images/req-bin-result.png[req-bin-result, role="integr8ly-img-responsive"]

[type=verification]
Did the response include the example JSON added during the design phase?
Expand Down
Loading

0 comments on commit db72b68

Please sign in to comment.