Skip to content

Commit 9697cf2

Browse files
committed
Update documentation to include sync apiproduct command
1 parent 94607a9 commit 9697cf2

8 files changed

Lines changed: 101 additions & 23 deletions

docs/flashpipe-cli.md

Lines changed: 88 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@ _FlashPipe_ provides a fully functional CLI with the following commands to inter
55
- **[update package](#2-update-package)**
66
- **[deploy](#3-deploy)**
77
- **[sync](#4-sync)**
8-
- **[sync apim](#5-sync-apim)**
9-
- **[snapshot](#6-snapshot)**
10-
- **[snapshot restore](#7-snapshot-restore)**
8+
- **[sync apiproxy](#5-sync-apiproxy)**
9+
- **[sync apiproduct](#6-sync-apiproduct)**
10+
- **[snapshot](#7-snapshot)**
11+
- **[snapshot restore](#8-snapshot-restore)**
1112

1213

1314
These commands perform the _magic_ that significantly simplifies the steps required to execute the build and deploy steps in a CI/CD pipeline.
@@ -326,19 +327,19 @@ Environment variables set before call:
326327
FLASHPIPE_SYNC_PACKAGE_DETAILS: true
327328
```
328329
329-
### 5. sync apim
330-
This command is used to sync API Management artifacts between a tenant and a Git repository. It will compare any differences (new, deleted, changed) in files between tenant and the Git repository before synchronising them.
330+
### 5. sync apiproxy
331+
This command is used to sync API Proxies from API Management between a tenant and a Git repository. It will compare any differences (new, deleted, changed) in files between tenant and the Git repository before synchronising them.
331332
- dependent artifacts of the API Proxy are included like API Provider, Key Value Maps
332333
333334
#### Usage
334335
```bash
335-
flashpipe sync apim -h
336+
flashpipe sync apiproxy -h
336337
337-
Synchronise API Management artifacts between SAP Integration Suite
338+
Synchronise API Management proxies (with dependent artifacts) between SAP Integration Suite
338339
tenant and a Git repository.
339340
340341
Usage:
341-
flashpipe sync apim [flags]
342+
flashpipe sync apiproxy [flags]
342343
343344
Flags:
344345
--dir-artifacts string Directory containing contents of artifacts
@@ -348,7 +349,7 @@ Flags:
348349
--git-commit-msg string Message used in commit (default "Sync repo from tenant")
349350
--git-commit-user string User used in commit (default "github-actions[bot]")
350351
--git-skip-commit Skip committing changes to Git repository
351-
-h, --help help for apim
352+
-h, --help help for apiproxy
352353
--ids-exclude strings List of excluded artifact IDs
353354
--ids-include strings List of included artifact IDs
354355
--target Target of sync. Allowed values: git, tenant (default "git")
@@ -364,7 +365,7 @@ Global Flags:
364365
```
365366
366367
#### CLI flags and environment variables list
367-
The following is the list of flags for the `sync apim` command and their corresponding environment variable name. The fourth column indicates whether the flag is valid for the specific value of --target.
368+
The following is the list of flags for the `sync apiproxy` command and their corresponding environment variable name. The fourth column indicates whether the flag is valid for the specific value of --target.
368369
369370
| CLI flag name | Environment variable name | Mandatory | Applicable for value of --target | Shell expansion supported |
370371
|------------------|----------------------------|-----------|----------------------------------|---------------------------|
@@ -381,23 +382,95 @@ The following is the list of flags for the `sync apim` command and their corresp
381382
382383
#### Example (OAuth with CLI flags)
383384
```bash
384-
flashpipe sync apim --tmn-host ***.hana.ondemand.com --oauth-host ***.authentication.<region>.hana.ondemand.com --oauth-clientid <clientid> --oauth-clientsecret <clientsecret> --dir-git-repo "FlashPipe APIM Demo"
385+
flashpipe sync apiproxy --tmn-host ***.hana.ondemand.com --oauth-host ***.authentication.<region>.hana.ondemand.com --oauth-clientid <clientid> --oauth-clientsecret <clientsecret> --dir-git-repo "FlashPipe APIM Demo"
385386
```
386387
387388
#### Example (OAuth with environment variables)
388389
```bash
389-
flashpipe sync apim
390+
flashpipe sync apiproxy
390391
391392
Environment variables set before call:
392393
FLASHPIPE_TMN_HOST: ***.hana.ondemand.com
393394
FLASHPIPE_OAUTH_HOST: ***.authentication.<region>.hana.ondemand.com
394395
FLASHPIPE_OAUTH_CLIENTID: <clientid>
395396
FLASHPIPE_OAUTH_CLIENTSECRET: <clientsecret>
396397
FLASHPIPE_DIR_GIT_REPO: "FlashPipe APIM Demo"
397-
FLASHPIPE_DIR_ARTIFACTS: "FlashPipe APIM Demo/Contents"
398+
FLASHPIPE_DIR_ARTIFACTS: "FlashPipe APIM Demo/APIProxies"
398399
```
399400
400-
### 6. snapshot
401+
### 6. sync apiproduct
402+
This command is used to sync API Products from API Management between a tenant and a Git repository. It will compare any differences (new, deleted, changed) between tenant and the Git repository before synchronising them.
403+
404+
_NOTE:_ Due to limitation of SAP's public API, updates are not synced to tenant.
405+
406+
#### Usage
407+
```bash
408+
flashpipe sync apiproduct -h
409+
410+
Synchronise API Management products between SAP Integration Suite
411+
tenant and a Git repository.
412+
413+
Usage:
414+
flashpipe sync apiproduct [flags]
415+
416+
Flags:
417+
--dir-artifacts string Directory containing contents of artifacts
418+
--dir-git-repo string Directory of Git repository
419+
--dir-work string Working directory for in-transit files (default "/tmp")
420+
--git-commit-email string Email used in commit (default "41898282+github-actions[bot]@users.noreply.github.com")
421+
--git-commit-msg string Message used in commit (default "Sync repo from tenant")
422+
--git-commit-user string User used in commit (default "github-actions[bot]")
423+
--git-skip-commit Skip committing changes to Git repository
424+
-h, --help help for apiproduct
425+
--ids-exclude strings List of excluded artifact IDs
426+
--ids-include strings List of included artifact IDs
427+
--target Target of sync. Allowed values: git, tenant (default "git")
428+
429+
Global Flags:
430+
--config string config file (default is $HOME/flashpipe.yaml)
431+
--debug Show debug logs
432+
--oauth-clientid string Client ID for using OAuth
433+
--oauth-clientsecret string Client Secret for using OAuth
434+
--oauth-host string Host for OAuth token server excluding https://
435+
--oauth-path string Path for OAuth token server (default "/oauth/token")
436+
--tmn-host string Host for API Portal for API Management excluding https://
437+
```
438+
439+
#### CLI flags and environment variables list
440+
The following is the list of flags for the `sync apiproduct` command and their corresponding environment variable name. The fourth column indicates whether the flag is valid for the specific value of --target.
441+
442+
| CLI flag name | Environment variable name | Mandatory | Applicable for value of --target | Shell expansion supported |
443+
|------------------|----------------------------|-----------|----------------------------------|---------------------------|
444+
| dir-git-repo | FLASHPIPE_DIR_GIT_REPO | Yes | git, tenant | Yes |
445+
| dir-artifacts | FLASHPIPE_DIR_ARTIFACTS | No | git, tenant | Yes |
446+
| target | FLASHPIPE_TARGET | No | git, tenant | No |
447+
| ids-include | FLASHPIPE_IDS_INCLUDE | No | git, tenant | No |
448+
| ids-exclude | FLASHPIPE_IDS_EXCLUDE | No | git, tenant | No |
449+
| git-commit-msg | FLASHPIPE_GIT_COMMIT_MSG | No | git | No |
450+
| git-commit-user | FLASHPIPE_GIT_COMMIT_USER | No | git | No |
451+
| git-commit-email | FLASHPIPE_GIT_COMMIT_EMAIL | No | git | No |
452+
| git-skip-commit | FLASHPIPE_GIT_SKIP_COMMIT | No | git | No |
453+
| dir-work | FLASHPIPE_DIR_WORK | No | git, tenant | Yes |
454+
455+
#### Example (OAuth with CLI flags)
456+
```bash
457+
flashpipe sync apiproduct --tmn-host ***.hana.ondemand.com --oauth-host ***.authentication.<region>.hana.ondemand.com --oauth-clientid <clientid> --oauth-clientsecret <clientsecret> --dir-git-repo "FlashPipe APIM Demo"
458+
```
459+
460+
#### Example (OAuth with environment variables)
461+
```bash
462+
flashpipe sync apiproduct
463+
464+
Environment variables set before call:
465+
FLASHPIPE_TMN_HOST: ***.hana.ondemand.com
466+
FLASHPIPE_OAUTH_HOST: ***.authentication.<region>.hana.ondemand.com
467+
FLASHPIPE_OAUTH_CLIENTID: <clientid>
468+
FLASHPIPE_OAUTH_CLIENTSECRET: <clientsecret>
469+
FLASHPIPE_DIR_GIT_REPO: "FlashPipe APIM Demo"
470+
FLASHPIPE_DIR_ARTIFACTS: "FlashPipe APIM Demo/APIProducts"
471+
```
472+
473+
### 7. snapshot
401474
This command is used to capture a snapshot of the Cloud Integration tenant's artifacts and integration package details (optional) to a Git repository. It will compare any differences (new, deleted, changed) in files from tenant and commit/push to the Git repository.
402475
403476
@@ -471,7 +544,7 @@ Environment variables set before call:
471544
FLASHPIPE_DIR_GIT_REPO: "TrialTenant"
472545
```
473546
474-
### 7. snapshot restore
547+
### 8. snapshot restore
475548
This command is used to restore a snapshot of the Cloud Integration artifacts and integration package details from a Git repository back to the tenant. It will compare any differences (new, deleted, changed) in files from Git repository and update to the tenant.
476549
477550

docs/github-actions-sync-apim.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,13 @@ Skip the templates and choose `set up a workflow yourself`.
3939

4040
Provide a suitable name for the workflow file e.g. `sync-apim-to-git.yml` and replace the default content with the code sample below. Replace the tenant and authentication details accordingly - note that the host refers to the management node of the API Portal which differs from the tenant management node of Cloud Integration.
4141

42-
**NOTE** - FlashPipe comes with companion GitHub Action [engswee/flashpipe-action](https://github.com/engswee/flashpipe-action) that simplifies usage in a workflow. The following action is used in the workflow:
43-
- [engswee/flashpipe-action/sync/apim@v1](https://github.com/engswee/flashpipe-action#sync-apim)
42+
**NOTE** - FlashPipe comes with companion GitHub Action [engswee/flashpipe-action](https://github.com/engswee/flashpipe-action) that simplifies usage in a workflow. The following actions are used in the workflow:
43+
- [engswee/flashpipe-action/sync/apiproxy@v1](https://github.com/engswee/flashpipe-action#sync-apiproxy)
44+
- [engswee/flashpipe-action/sync/apiproduct@v1](https://github.com/engswee/flashpipe-action#sync-apiproduct)
4445

4546
![Sync Workflow](images/setup/git-sync-apim/04b_sync_apim_git_workflow.png)
4647

47-
<script src="https://gist.github.com/engswee/044767991065f41991b2c6a9fd8262c0.js"></script>
48+
<script src="https://gist.github.com/engswee/1a06264333060f8eb5c02690cb55957e.js"></script>
4849

4950
Save and commit the new workflow file.
5051

@@ -59,7 +60,8 @@ In the GitHub repository, go to `Actions`, select the workflow and click `Run wo
5960
### 6. View execution results
6061

6162
During or upon completion of the workflow run, the logs can be viewed by clicking on the workflow run.
62-
![Workflow Logs](images/setup/git-sync-apim/06a_logs_apim.png)
63+
![Workflow Logs APIProxy](images/setup/git-sync-apim/06a_logs_apim.png)
64+
![Workflow Logs APIProduct](images/setup/git-sync-apim/06a_logs_apiproduct.png)
6365

6466
The APIM artifact files have now been downloaded from the tenant and committed to the repository.
6567
![IFlow Files](images/setup/git-sync-apim/06b_apim_files.png)
@@ -76,7 +78,7 @@ Provide a suitable name for the workflow file e.g. `sync-apim-to-tenant.yml` and
7678

7779
![Sync Workflow](images/setup/git-sync-apim/b_01_sync_apim_to_tenant_workflow.png)
7880

79-
<script src="https://gist.github.com/engswee/72d0a121f6c8c924cf771fb4d1d65573.js"></script>
81+
<script src="https://gist.github.com/engswee/4271fbcef81db0ec719bc8cc46bc1d69.js"></script>
8082

8183
Save and commit the new workflow file.
8284

@@ -89,6 +91,9 @@ In the GitHub repository, go to `Actions`, select the workflow and click `Run wo
8991
### 3. View execution results
9092

9193
During or upon completion of the workflow run, the logs can be viewed by clicking on the workflow run.
92-
![Workflow Logs](images/setup/git-sync-apim/b_03_sync_tenant_logs.png)
94+
![Workflow Logs APIProxy](images/setup/git-sync-apim/b_03_sync_tenant_logs.png)
95+
![Workflow Logs APIProduct](images/setup/git-sync-apim/b_03_sync_tenant_logs_apiproduct.png)
9396

94-
As seen from the logs, changes in the APIM artifact were synced to the tenant.
97+
As seen from the logs, APIM artifacts were synced to the tenant.
98+
99+
_NOTE:_ Due to limitation of SAP's public API, updates of API Products are not synced to tenant, instead these will be skipped.
43.6 KB
Loading
356 KB
Loading
-54.1 KB
Loading
165 KB
Loading
529 KB
Loading

docs/release-notes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
- 🔥🔥 Hot new feature 🔥🔥 - _FlashPipe_ now supports syncing of API Products from **API Management**
88
- New `sync apiproduct` command
9-
- Rename of `sync apim` command to `sync apiproxy` for handling API Proxies.
9+
- Rename of `sync apim` command to `sync apiproxy` for handling API Proxies
1010
- `sync apim` still works for backward compatibility
1111
- Update to latest Go version 1.24.4 and dependencies
1212

0 commit comments

Comments
 (0)