Skip to content

Commit db72b68

Browse files
authored
Merge pull request #404 from rpscodes/master
Create new flows without Gogs
2 parents ef32c66 + 329efad commit db72b68

16 files changed

+128
-214
lines changed
Loading
Loading
Loading
Loading
Loading
Loading

docs/labs/developer-track/lab01/walkthrough.adoc

+6-6
Original file line numberDiff line numberDiff line change
@@ -67,15 +67,15 @@ Let's start verifying your API.
6767

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

7272
. 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.
7373
+
74-
image::images/api-dsigner-id-int32.png[api-dsigner-id-int32, role="integr8ly-img-responsive"]
74+
image::images/api-designer-path.png[api-designer-path, role="integr8ly-img-responsive"]
7575

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

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

8888
. 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.
8989
+
90-
image::images/api-designer-location-datatype.png[api-designer-location-datatype, role="integr8ly-img-responsive"]
90+
image::images/api-designer-location.png[api-designer-location, role="integr8ly-img-responsive"]
9191

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

9696
=== Step 4: Verify the /locations path
9797

9898
. 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.
9999
+
100-
image::images/api-designer-locations-path-methods.png[api-designer-locations-path-methods, role="integr8ly-img-responsive"]
100+
image::images/api-designer-get-post.png[api-designer-get-post, role="integr8ly-img-responsive"]
101101

102102
[type=verification]
103103
Did you locate the `get` and `post` requests in the source for `/locations`?
Loading
Loading
Loading
Loading
Loading
Loading
Loading

docs/labs/developer-track/lab02/walkthrough.adoc

+13-100
Original file line numberDiff line numberDiff line change
@@ -39,78 +39,8 @@ Your password is: `{user-password}`
3939
* link:{microcks-url}[Microcks Console, window="_blank"]
4040
****
4141

42-
[type=walkthroughResource]
43-
.Gogs
44-
****
45-
* link:{gogs-url}[Gogs Console, window="_blank"]
46-
****
47-
48-
[time=5]
49-
[id="Prerequisite"]
50-
== Prerequisite: Setup the collaboration environment using Git (Gogs)
51-
52-
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.
53-
54-
Follow this instructions to set up the repository.
55-
56-
. Click on the *Gogs Console* link, located on the right of this walkthrough.
57-
58-
. Click on *Sign In*.
59-
+
60-
image::images/gogs-signin-link.png[microcks-signin-link, role="integr8ly-img-responsive"]
61-
62-
. Log into Gogs using `{user-username}` and `{user-password}`. You should see the repository dashboard.
63-
+
64-
image::images/gogs-dashboard.png[gogs-dashboard, role="integr8ly-img-responsive"]
65-
66-
. In the main page, click in the + sign in the right top corner to display the New menu. Click the *New Migration* option.
67-
+
68-
image::images/gogs-new-migration.png[gogs-new-migration, role="integr8ly-img-responsive"]
69-
70-
. Fill in the information of the repository migration with the following values:
71-
** Clone Address: *https://github.com/RedHatWorkshops/dayinthelife-openapi.git*
72-
** Owner: *`{user-username}`*
73-
** Repository Name: *locations-api*
74-
+
75-
image::images/gogs-migrate-repository.png[gogs-migrate-repository, role="integr8ly-img-responsive"]
76-
77-
. Click on *Migrate Repository* to fork the GitHub repo into Gogs.
78-
. Switch to branch `dev-track-lab-02`
79-
+
80-
image::images/gogs-switch-branch.png[gogs-switch-branch, role="integr8ly-img-responsive"]
81-
82-
. Open the `locations-api` folder and click on the filename link *Locations-userX.json* to open and review the file.
83-
+
84-
image::images/gogs-locations-userX.png[gogs-locations-userX, role="integr8ly-img-responsive"]
85-
86-
. Click the *pencil* button to edit the file.
87-
+
88-
image::images/gogs-locations-userX-edit.png[gogs-locations-userX-edit, role="integr8ly-img-responsive"]
8942

90-
. Replace all occurances of *userX* with your user number i.e. ``{user-username}``.
91-
+
92-
image::images/gogs-locations-userX-replace.png[gogs-locations-userX-replace, role="integr8ly-img-responsive"]
93-
94-
. Scroll down to bottom of the page and click *Commit Changes*.
95-
+
96-
image::images/gogs-locations-userX-commit.png[gogs-locations-userX-commit, role="integr8ly-img-responsive"]
9743

98-
. Click the *RAW* button to get the raw download version of the file.
99-
+
100-
image::images/gogs-locations-userX-raw.png[gogs-locations-userX-raw, role="integr8ly-img-responsive"]
101-
102-
. 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:
103-
+
104-
[source,bash,subs="attributes+"]
105-
----
106-
http://gogs.{openshift-app-host}/{user-username}/locations-api/raw/dev-track-lab-02/locations-api/Locations-{user-username}.json
107-
----
108-
109-
[type=verification]
110-
Did you confirm the URL of the raw file matches the example shown?
111-
112-
[type=verificationFail]
113-
Try to redo this section, if any problem persists have your instructor check the Kubernetes pod that contains the Gogs application.
11444

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

131-
. Click the *Create* button to create your first job.
132-
+
133-
image::images/microcks-import-job-create.png[microcks-import-job-create, role="integr8ly-img-responsive"]
134-
135-
. In the _Create a New Job_ dialog, type in the following information. Click *Next*.
136-
** Name: *`Locations-{user-username}`*
137-
** Repository URL: *`http://gogs.{openshift-app-host}/{user-username}/locations-api/raw/dev-track-lab-02/locations-api/Locations-{user-username}.json`*
138-
139-
. Click *Next* for the Authentication options.
61+
. Click the *upload* button to create your first job.
14062
+
141-
image::images/microcks-import-form.png[microcks-import-form, role="integr8ly-img-responsive"]
63+
image::images/api-mocking-upload.png[api-mocking-upload, role="integr8ly-img-responsive"]
14264

143-
. Leave Authentication options unchanged and click *Next*.
144-
145-
. Review the details and click on *Create* to create the job.
65+
. 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:
66+
** Url: `+https://raw.githubusercontent.com/RedHat-Middleware-Workshops/dayinthelife-integration/master/docs/labs/developer-track/resources/Locations.yaml+`
14667
+
147-
image::images/microcks-import-job-complete.png[microcks-import-job-complete, role="integr8ly-img-responsive"]
68+
image::images/api-mocking-file.png[api-mocking-file, role="integr8ly-img-responsive"]
14869

149-
. Click on the *kebab menu* (three dots), then select the *Force Import* option. This will start the synchronization job.
70+
. After the upload is complete, click on APIs|Services tab to locate your mock API
15071
+
151-
image::images/microcks-job-force-import.png[microcks-job-force-import, role="integr8ly-img-responsive"]
152-
153-
. Refresh your window to get it to the latest state.
72+
image::images/api-mocking-apis-services.png[api-mocking-apis-services, role="integr8ly-img-responsive"]
15473

155-
. You will see three labels next to your job. Click the *Services* label.
74+
. Click on the API that is listed
15675
+
157-
image::images/microcks-import-services.png[microcks-import-services, role="integr8ly-img-responsive"]
158-
159-
. In the dialog you will see your service listed. Click on the *Locations-{user-username} - 1.0.0* link.
160-
+
161-
image::images/microcks-service-link.png[microcks-service-link, role="integr8ly-img-responsive"]
162-
163-
. Click *Close* to dismiss the dialog.
76+
image::images/api-mocking-locate-api.png[api-mocking-locate-api, role="integr8ly-img-responsive"]
16477

16578
. 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.
16679
+
16780
image::images/microcks-expand-get-operation.png[microcks-expand-get-operation, role="integr8ly-img-responsive"]
16881

16982
. 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.
17083
+
171-
image::images/microcks-mock-service-url.png[microcks-mock-service-url, role="integr8ly-img-responsive"]
84+
image::images/api-mocking-get-location.png[api-mocking-get-location, role="integr8ly-img-responsive"]
17285

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

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

196109
. 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.
197110
+
198-
image::images/online-curl-response.png[online-curl-response, role="integr8ly-img-responsive"]
111+
image::images/req-bin-result.png[req-bin-result, role="integr8ly-img-responsive"]
199112

200113
[type=verification]
201114
Did the response include the example JSON added during the design phase?

0 commit comments

Comments
 (0)