SAP / cf-html5-apps-repo-cli-plugin

Cloud Foundry CLI plugin to work with SAP Cloud HTML5 Applications Repository
Apache License 2.0
43 stars 5 forks source link

`cf html5-list -d -u` does not show app url's #40

Closed js1972 closed 3 years ago

js1972 commented 3 years ago

Description

When I execute cf html5-list -d -u I see the following:

name   version   app-host-id   service name    destination name                     last changed   url
-      -         -             fioridemo       fioridemo_FioriDemo_html_repo_host   -              https://sap.com/DUMMY_URL
-      -         -             fioridemo       fioridemo_uaa_FioriDemo              -              https://api.authentication.eu10.hana.ondemand.com
-      -         -             cloud.service   managed-fiori-destination-html5      -              https://sap.com/DUMMY_URL
-      -         -             cloud.service   managed-fiori-destination-uaa        -              https://api.authentication.eu10.hana.ondemand.com

The line for managed-fiori-destination-html5 is the app I am interested in, but it just shows "DUMMY_URL".

If I logon to the cloud platform cockpit and navigate to my subaccount and the HTML5 Application area I can see the app and click on it and it launches just fine with this url:

https://hanatest.cpp.cfapps.eu10.hana.ondemand.com/cloudservice.demoproductsproducts-1.0.0/

Am I using the html5 plugin wrong or is it a bug that a real URL is not showing here. Please note these applications are the sap-managed html5 applications that don't use their own app runtime but instead rely on the Portal or Launchpad service.

Environment

CLI Output

Set environment variable DEBUG=1, run the flow and paste output here.

❯ DEBUG=1 cf html5-list -d -u
Initializing command 'html5-list'
Executing command 'html5-list': args: '[-d -u]'
Listing HTML5 applications available via destinations
Getting context (org/space/username)
Getting list of HTML5 applications available via destinations in org SAP CP CustomerSuccessTeam_hanatest / space hana_cloud_demo as jason.scott@sap.com...
Getting list of services
Making request to: /v2/services
Looking for 'html5-apps-repo' service
Getting service plans for 'html5-apps-repo' service (GUID: 3d7c607f-8b21-484d-8b95-a87caf18b6e4)
Making request to: /v2/service_plans?q=service_guid:3d7c607f-8b21-484d-8b95-a87caf18b6e4
Looking for app-runtime service plan
Getting service instances of 'html5-apps-repo' service app-runtime plan (&{Name:app-runtime GUID:00b3a74e-aaa3-44a0-ad4c-1aece8a0d077})
Making request to: /v2/service_instances?q=service_plan_guid%20IN%2000b3a74e-aaa3-44a0-ad4c-1aece8a0d077%3Bspace_guid:15742f31-c052-4ec5-a2c5-39d942642f36
Creating service key for bookshop_html5_repo_runtime service
Making request to: /v2/service_keys
Getting token for service key html5-key-1602729555
Making request to: https://hanatest.authentication.eu10.hana.ondemand.com/oauth/token
Access token for service key html5-key-1602729555: <redacted>
Getting list of services
Making request to: /v2/services
Looking for 'destination' service
Destination service found: &{Name:destination GUID:cdc19796-58e8-47af-87d9-e72b84c3993f}
Getting service plans for 'destination' service (GUID: cdc19796-58e8-47af-87d9-e72b84c3993f)
Making request to: /v2/service_plans?q=service_guid:cdc19796-58e8-47af-87d9-e72b84c3993f
Destination service 'lite' plan found: &{Name:lite GUID:4d02c12c-3a82-4c84-8828-937e48d87511}
Getting service instances of 'destination' service 'lite' plan (&{Name:lite GUID:4d02c12c-3a82-4c84-8828-937e48d87511})
Making request to: /v2/service_instances?q=service_plan_guid%20IN%204d02c12c-3a82-4c84-8828-937e48d87511%3Bspace_guid:15742f31-c052-4ec5-a2c5-39d942642f36
Using service instance of 'destination' service 'lite' plan: {Name:FioriDemo-destination-service GUID:02c3cfeb-e447-45ef-b46b-82289d82fd51 UpdatedAt:2020-09-25T02:16:55Z LastOperation:{Type:update State:succeeded Description: UpdatedAt:2020-09-25T02:17:23Z CreatedAt:2020-09-25T02:17:23Z}}
Creating service key for 'destination' service 'lite' plan
Making request to: /v2/service_keys
Getting token for service key html5-key-1602729565
Making request to: https://hanatest.authentication.eu10.hana.ondemand.com/oauth/token
Access token for service key html5-key-1602729565: <redacted>
Making request to: https://destination-configuration.cfapps.eu10.hana.ondemand.com/destination-configuration/v1/subaccountDestinations/
List of subaccount destinations: [{Name:BallanceData Description:Ballance data Type:HTTP URL:https://ballancebackend.cfapps.eu10.hana.ondemand.com Authentication:NoAuthentication ProxyType: TokenServiceURL: TokenServiceURLType: ClientID: ClientSecret: Properties:map[ProxyType:Internet]} {Name:ES5 Description:SAP Gateway ES5 Type:HTTP URL:https://sapes5.sapdevcenter.com Authentication:BasicAuthentication ProxyType: TokenServiceURL: TokenServiceURLType: ClientID: ClientSecret: Properties:map[HTML5.DynamicDestination:true Password:<redacted> ProxyType:Internet User:I540401 WebIDEEnabled:true WebIDESystem:Gateway WebIDEUsage:odata_abap sap-client:002 sap-platform:ABAP]} {Name:Estimator Description: Type:HTTP URL:https://cloudplatform.sap.com Authentication:NoAuthentication ProxyType: TokenServiceURL: TokenServiceURLType: ClientID: ClientSecret: Properties:map[ProxyType:Internet WebIDEEnabled:true WebIDESystem:API]} {Name:Northwind Description:Automatically generated Northwind destination Type:HTTP URL:https://services.odata.org Authentication:NoAuthentication ProxyType: TokenServiceURL: TokenServiceURLType: ClientID: ClientSecret: Properties:map[HTML5.DynamicDestination:true ProxyType:Internet]} {Name:fioridemo_FioriDemo_html_repo_host Description: Type:HTTP URL:https://sap.com/DUMMY_URL Authentication:OAuth2ClientCredentials ProxyType: TokenServiceURL:https://hanatest.authentication.eu10.hana.ondemand.com/oauth/token TokenServiceURLType: ClientID:sb-00f01838-d2e7-4248-b190-166f4b360c65!b18738|html5-apps-repo-uaa!b1685 ClientSecret:<redacted> Properties:map[ProxyType:Internet ServiceKeyName:FioriDemo_html_repo_host-key app_host_id:00f01838-d2e7-4248-b190-166f4b360c65 content_endpoint:https://html5-apps-repo-dt.cfapps.eu10.hana.ondemand.com sap.cloud.service:fioridemo uri:https://html5-apps-repo-dt.cfapps.eu10.hana.ondemand.com]} {Name:fioridemo_uaa_FioriDemo Description: Type:HTTP URL:https://api.authentication.eu10.hana.ondemand.com Authentication:OAuth2UserTokenExchange ProxyType: TokenServiceURL:https://hanatest.authentication.eu10.hana.ondemand.com/oauth/token TokenServiceURLType: ClientID:sb-fioridemo!t18738 ClientSecret:<redaceted> Properties:map[ProxyType:Internet ServiceKeyName:uaa_FioriDemo-key sap.cloud.service:fioridemo verificationkey:-----BEGIN PUBLIC KEY-----<redacted>-----END PUBLIC KEY----- xsappname:fioridemo!t18738]} {Name:managed-fiori-destination-html5 Description: Type:HTTP URL:https://sap.com/DUMMY_URL Authentication:OAuth2ClientCredentials ProxyType: TokenServiceURL:https://hanatest.authentication.eu10.hana.ondemand.com/oauth/token TokenServiceURLType: ClientID:sb-04ae20c2-fbe5-4384-bd27-ea952dec4ff4!b18738|html5-apps-repo-uaa!b1685 ClientSecret:<redacted> Properties:map[ProxyType:Internet ServiceKeyName:managed-fiori-html5-repo-host-key app_host_id:04ae20c2-fbe5-4384-bd27-ea952dec4ff4 content_endpoint:https://html5-apps-repo-dt.cfapps.eu10.hana.ondemand.com sap.cloud.service:cloud.service uri:https://html5-apps-repo-dt.cfapps.eu10.hana.ondemand.com]} {Name:managed-fiori-destination-uaa Description: Type:HTTP URL:https://api.authentication.eu10.hana.ondemand.com Authentication:OAuth2UserTokenExchange ProxyType: TokenServiceURL:https://hanatest.authentication.eu10.hana.ondemand.com/oauth/token TokenServiceURLType: ClientID:sb-managed_fiori!t18738 ClientSecret:Yd7lS/SAgtRxXSc3qPwvo29cZew= Properties:map[ProxyType:Internet ServiceKeyName:managed-fiori-uaa-key sap.cloud.service:cloud.service verificationkey:-----BEGIN PUBLIC KEY-----<redacted>-----END PUBLIC KEY----- xsappname:managed_fiori!t18738]} {Name:python-test Description: Type:HTTP URL:https://python-test-docker.cfapps.eu10.hana.ondemand.com Authentication:NoAuthentication ProxyType: TokenServiceURL: TokenServiceURLType: ClientID: ClientSecret: Properties:map[ProxyType:Internet]}]
Deleting service key html5-key-1602729565
Making request to (try 1/3): /v2/service_keys/f0330f30-06d8-42f2-a104-94f74ad01b16
Deleting service key html5-key-1602729555
Making request to (try 1/3): /v2/service_keys/5228f0b6-4aed-4a7b-99e3-bffe7b1b2395
OK

name   version   app-host-id   service name    destination name                     last changed   url
-      -         -             fioridemo       fioridemo_FioriDemo_html_repo_host   -              https://sap.com/DUMMY_URL
-      -         -             fioridemo       fioridemo_uaa_FioriDemo              -              https://api.authentication.eu10.hana.ondemand.com
-      -         -             cloud.service   managed-fiori-destination-html5      -              https://sap.com/DUMMY_URL
-      -         -             cloud.service   managed-fiori-destination-uaa        -              https://api.authentication.eu10.hana.ondemand.com
 ~/dev/html5apps/managed-html5-runtime-fiori-mta  on fiori !5 ?7 
micellius commented 3 years ago

@js1972 , thanks for reporting an issue!

You can check the version of plugin with cf plugins command that lists all commands and version of corresponding plugin that exposed each command.

The issue you experience was fixed in v1.4.1. You can download latest version (currently v.1.4.3) of html5-plugin for your operating system from assets section of Releases. After you download the binary of html5-plugin, you can install it with cf install-plugin -f <path_to_binary>

js1972 commented 3 years ago

I was already on 1.4.1 as it turns out, but updating to 1.4.3 fixes the issue. Brilliant. thx.