Technology Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
Muniyappan
Active Contributor
1,529

The CPI trial comes with a time limit and gets deleted once the time limit is crossed. You'll have to perform all tasks again when you subscribe after deletion. One of the tasks is to create instances.

Let us say you want to create service instance for plan api and integration-flow. Usually we use btp cockpit to create it and it is easy to set up. What if you have to repeat the same, once trial tenant is deleted. Creating instances using commands can be easy and we can run the same command every time we set up the trial account.

Usually we need three instances creation for setting up the trial tenant to get started with development.

  1. Plan api ( access cloud integration artifacts)
  2. Plan integration-flow ( sending message to cpi flow)
  3. Plan apiportal-apiaccess ( accessing APIM artifacts )

I am making use of CLI command for creating the instances. 

Install CLI command

https://help.sap.com/docs/btp/sap-business-technology-platform/download-and-install-cloud-foundry-co...

Once installed check if it is available

Muniyappan_1-1747071579664.png

 

or you can make use of SAP business application studio and it comes with installed cf

https://help.sap.com/docs/bas/sap-business-application-studio/terminal

Login

When you log in for the first time, you need to add your api endpoint. You will find it in the BTP cockpit.

Muniyappan_0-1747147212091.png

Click on the link shown in the terminal. 

Muniyappan_3-1747071601859.png

login with your user

Muniyappan_2-1747071587817.png

copy this key and paste it in your terminal

 

Muniyappan_4-1747071615871.png

Muniyappan_0-1747071990543.png

My space is dev and all the instances will be created under dev space.

Create instance for plan api

When you create instance we need to provide some parameters and these parameters are kept in json format. Instead of complicating things, First we create a one instance using BTP cockpit ui. Let us call it test_blog and I have assigned one role once create this is how it looks like

Muniyappan_1-1747072003690.pngMuniyappan_2-1747072009400.png

Copy the json file and put it in the folder and file name is instance-api.json

Json

{
    "grant-types": [
        "client_credentials"
    ],
    "redirect-uris": [],
    "roles": [
        "AuthGroup_IntegrationDeveloper"
    ],
    "token-validity": 43200
}

Now we will use json as parameter file for creating a new instance.

cf create-service it-rt api odata-api -c instance-api.json
cf create-service-key odata-api key-01
Muniyappan_3-1747072025531.pngMuniyappan_4-1747072031834.png

 

Create instance for plan integration-flow

Repeat the same step here as well to get the json file.

json file

{
    "grant-types": [
        "client_credentials"
    ],
    "redirect-uris": [],
    "roles": [
        "ESBMessaging.send"
    ],
    "token-validity": 3600
}

 

Iflow
cf create-service it-rt integration-flow iflow_blog -c instance-integration-flow.json
cf create-service-key iflow_blog key-01
 

Muniyappan_5-1747072043567.png

You can view the instance and key.

Muniyappan_6-1747072050518.png

 

https://help.sap.com/docs/integration-suite/sap-integration-suite/specifying-service-instance-and-se...

APIM plan apiportal-apiaccess

Json

{
	    "role": "APIPortal.Administrator"
	}

 

cf create-service apimanagement-apiportal-trial apiportal-apiaccess apim_odata -c instance-api-access.json
cf create-service-key apim_odata key-01

Muniyappan_7-1747072097665.png

https://help.sap.com/docs/integration-suite/sap-integration-suite/api-access-plan-for-api-portal

Please be aware sometimes btp trial is giving error when creating this instance be it from cockpit or from terminal. I had a issue and posted here and after sometime it starts working again. 
https://community.sap.com/t5/technology-q-a/instance-creation-for-apiportal-apiaccess-plan-in-btp-tr...

View Keys

Once you are done with creating keys you can run this command to view the keys.

cf service-key odata-api key-01
Muniyappan_0-1747071554553.png

Conclusion

Once you are done with settting up the commands, next time trial account is deleleted, you can make use of the commands instead of creating them from btp cockpit. 

1 Comment