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

'html5-list -d -u' command is not listing the html5 applications in BAS #48

Closed PriyankaShivakumar closed 2 years ago

PriyankaShivakumar commented 3 years ago

Description

In Business Application Studio, the command cf html5-list -d -u is not listing the html5 applications. But on passing the name of the destination service instance in the command with the -di flag for eg: cf html5-list -di sap-btp-sapui5-dest-srv -u, It works as given below.

image

I also used the command cf html5-list -d -rt launchpad -u but this is also not listing any applications even though launchpad service is subscribed.

But passing the name of the destination service instance with -di flag works image

Environment

CLI Output

cf html5-list -d -u 09:01:23.473079 Running CloudFoundry html5-plugin 1.4.6 09:01:23.473145 Initializing command 'html5-list' 09:01:23.473165 Configuration file does not exist. No cache to clear 09:01:23.473185 Executing command 'html5-list': args: '[-d -u]' 09:01:23.473209 Listing HTML5 applications available via destinations 09:01:23.473219 Getting context (org/space/username) Getting list of HTML5 applications available via destinations in org EngSrvVal-E2E_extendui17 / space test as priyanka.r.s@sap.com... 09:01:23.475305 Getting HTML5 context 09:01:23.475318 Getting list of services 09:01:23.475655 Making request to: /v2/spaces/a29b9496-9c02-43c2-a0e3-d9bf3b886db9/services 09:01:25.121724 Looking for 'html5-apps-repo' service 09:01:25.121748 Getting service plans for 'html5-apps-repo' service (GUID: 3d7c607f-8b21-484d-8b95-a87caf18b6e4) 09:01:25.121754 Making request to: /v2/service_plans?q=service_guid:3d7c607f-8b21-484d-8b95-a87caf18b6e4 09:01:25.461998 Looking for app-runtime service plan 09:01:25.462017 Getting service instances of 'html5-apps-repo' service app-runtime plan (&{Name:app-runtime GUID:00b3a74e-aaa3-44a0-ad4c-1aece8a0d077}) 09:01:25.462050 Making request to: /v2/service_instances?q=service_plan_guid%20IN%2000b3a74e-aaa3-44a0-ad4c-1aece8a0d077%3Bspace_guid:a29b9496-9c02-43c2-a0e3-d9bf3b886db9 09:01:25.581074 Creating service instance of html5-apps-repo service app-runtime plan 09:01:25.581104 Making request to: /v2/service_instances 09:01:27.071565 Getting list of service keys for service app-runtime-1620810085 09:01:27.071593 Making request to: /v2/service_instances/456a0df6-af46-405e-a7bf-ef65a716a743/service_keys 09:01:27.227578 Creating service key for app-runtime-1620810085 service 09:01:27.227603 Making request to: /v2/service_keys 09:01:28.701822 Getting token for service key html5-key-1620810087 09:01:28.701845 Making request to: https://extendui17.authentication.eu10.hana.ondemand.com/oauth/token 09:01:28.949421 Access token for service key html5-key-1620810087: [ SENSITIVE DATA ] 09:01:28.949452 Getting list of services 09:01:28.950018 Returning cached list of services 09:01:28.950032 Looking for 'destination' service 09:01:28.950040 Destination service found: &{Name:destination GUID:cdc19796-58e8-47af-87d9-e72b84c3993f} 09:01:28.950057 Getting service plans for 'destination' service (GUID: cdc19796-58e8-47af-87d9-e72b84c3993f) 09:01:28.950072 Making request to: /v2/service_plans?q=service_guid:cdc19796-58e8-47af-87d9-e72b84c3993f 09:01:29.263380 Destination service 'lite' plan found: &{Name:lite GUID:4d02c12c-3a82-4c84-8828-937e48d87511} 09:01:29.263412 Getting service instances of 'destination' service 'lite' plan (&{Name:lite GUID:4d02c12c-3a82-4c84-8828-937e48d87511}) 09:01:29.263431 Making request to: /v2/service_instances?q=service_plan_guid%20IN%204d02c12c-3a82-4c84-8828-937e48d87511%3Bspace_guid:a29b9496-9c02-43c2-a0e3-d9bf3b886db9 09:01:29.571733 Using service instance of 'destination' service 'lite' plan: {Name:sap-btp-sapui5-dest-srv GUID:3f8ee814-1c02-428e-b932-316f76f8a618 UpdatedAt:2021-05-12T05:17:45Z LastOperation:{Type:create State:succeeded Description: UpdatedAt:2021-05-12T05:17:45Z CreatedAt:2021-05-12T05:17:45Z}} 09:01:29.571788 Creating service key for 'destination' service 'lite' plan 09:01:29.571804 Making request to: /v2/service_keys 09:01:30.874392 Getting token for service key html5-key-1620810089 09:01:30.874418 Making request to: https://extendui17.authentication.eu10.hana.ondemand.com/oauth/token 09:01:31.103310 Access token for service key html5-key-1620810089: [ SENSITIVE DATA ] 09:01:31.103350 Making request to: https://destination-configuration.cfapps.eu10.hana.ondemand.com/destination-configuration/v1/subaccountDestinations/ 09:01:31.146602 List of subaccount destinations: [{Name:SAP_Notifications Description:for notif Type:HTTP URL:https://notifications.cfapps.eu10.hana.ondemand.com Authentication:OAuth2UserTokenExchange ProxyType:Internet TokenServiceURL:https://extendui17.authentication.eu10.hana.ondemand.com/oauth/token TokenServiceURLType: ClientID:sb-c82210b3-b2df-42ae-b9a1-5cf83c7a5329!b85997|xfsrt-service-broker!b27765 ClientSecret:aJeX2aBb9QjDa+/paHBFy9c2VBs= Properties:map[HTML5.DynamicDestination:true Token Service URL Type:Dedicated]} {Name:bupa Description: Type:HTTP URL:http://s4h:443/ Authentication:PrincipalPropagation ProxyType:OnPremise TokenServiceURL: TokenServiceURLType: ClientID: ClientSecret: Properties:map[HTML5.DynamicDestination:true WebIDEEnabled:true WebIDESystem:S4H WebIDEUsage:odata_abap sap-client:100]}] 09:01:31.146648 Processing destination: {Name:SAP_Notifications Description:for notif Type:HTTP URL:https://notifications.cfapps.eu10.hana.ondemand.com Authentication:OAuth2UserTokenExchange ProxyType:Internet TokenServiceURL:https://extendui17.authentication.eu10.hana.ondemand.com/oauth/token TokenServiceURLType: ClientID:sb-c82210b3-b2df-42ae-b9a1-5cf83c7a5329!b85997|xfsrt-service-broker!b27765 ClientSecret:aJeX2aBb9QjDa+/paHBFy9c2VBs= Properties:map[HTML5.DynamicDestination:true Token Service URL Type:Dedicated]} 09:01:31.146662 Processing destination: {Name:bupa Description: Type:HTTP URL:http://s4h:443/ Authentication:PrincipalPropagation ProxyType:OnPremise TokenServiceURL: TokenServiceURLType: ClientID: ClientSecret: Properties:map[HTML5.DynamicDestination:true WebIDEEnabled:true WebIDESystem:S4H WebIDEUsage:odata_abap sap-client:100]} 09:01:31.146675 Deleting service key html5-key-1620810089 09:01:31.146684 Making request to (try 1/3): /v2/service_keys/af393878-db65-48fd-bb38-c72806a16da5 09:01:31.910560 Deleting service key html5-key-1620810087 09:01:31.910593 Making request to (try 1/3): /v2/service_keys/3699953f-e48f-4a1e-8d9a-7db3378d5faf 09:01:32.440200 Deleting service instance app-runtime-1620810085 09:01:32.440227 Making request to (try 1/3): /v2/service_instances/456a0df6-af46-405e-a7bf-ef65a716a743?recursive=true 09:01:33.648064 Service instance app-runtime-1620810085 successfully deleted OK

name version app-host-id service name destination name last changed url
09:01:33.648160 Disposing command 'html5-list'

micellius commented 2 years ago

@PriyankaShivakumar , thanks for reporting an issue!

The behavior you describing is not specific to BAS, it is common across all environments, where CF CLI HTML5 Plugin is used.

SAP BTP allows to define destination configuration either on the subaccount level or on the level of specific destination service instance. These types of destination configurations serve different purposes and have different life-cycle.

The command html5-list -d -u only looks through the subaccount level destinations to find those that expose HTML5 applications, while html5-list -di <destination_service_instance_name> -u looks only at service instance level destinations defined in corresponding service instance of Destination service. This is also documented in help of the command (cf html5-list -h). Since service instance level destination configurations are not present in response of subaccount level destinations API of Destination service, you will not see destinations from cf html5-list -di in the output of cf html5-list -d. This is intended behavior for current implementation. Currently it is not possible to list all service instance level destination configurations from all service instances of Destination service in the CF space, or mixture of subaccount level and service instance level destination configurations using a single command.