云服务器价格_云数据库_云主机【优惠】最新活动-搜集站云资讯

金山云_数据库插入数据_怎么申请

小七 141 0

Something has been bothering me for the last several weeks.  I’ve learned that when I get this itchy feeling, it’s best to pursue it to it’s end so that I can remove it from my consciousness and move on to other things.

Such is the case of the headless chrome-man.

I’ve been working on a series of blog posts with accompanying project that demonstrates what a successful partner provided SaaS offering with multitenancy should look like.  You can follow my story here:

If you look at the topic of multitant application development, you quickly realize that there is a needed interaction with the supporting platform.  The way multitenant applications work is integrated with the concept of subaccounts existing within a global account on a particular landscape.   The multitenant application account itself is deployed into a provider subaccount and registers itself with the system such that client subaccounts under the same global account can subscribe themselves to it.

Each subaccount currently must be created manually through the SAP Cloud Platform Cockpit user interface prior to it being subscribed to the multitenant app running in the provider subaccount(again within the same global account).

This poses a dilemma.  What if I want my prospect clients to be able to sign up for my SaaS offering without any manual intervention?  I don’t want to have to have a human in the workflow slowing things down.  I want my clients to immediately start benefitting from my offering.

Currently there is no public API for programmatically managing the lifecycle of subaccounts.  The manual process for creating a new subaccount looks like this.

Log into the SAP Cloud Platform Cockpit as a user with administrative rights to the global account.

This goes through an SSO authentication process that eventually lands you on the main page for the region in which the global account is hosted.

Select your global account.

Pick on the subaccounts link in the Info section or on the left-side menu bar.

This is the current url.

https://account.us1.hana.ondemand.com/cockpit/#/globalaccount//subaccounts

Notice it is at this point you can create a new subaccount with the "New Subaccount" button.

We can effectively start with this as our starting url and if we aren’t authorized in our current browser session, we’ll be relocated to our SSO sign-in screen and then relocated back to this screen.

What’s important to understand is that in an authorized mode, the browser contains cookies that allow further actions with the server because it’s maintaining a session context with the server.  If you loose(or have never established) a session, you’ll get an unauthorized response.  This is why you can’t just use curl and basic-auth to simulate these steps.

Just to show you what the next step looks like, we’ll click on the button and we get presented with the following popover dialog box.  There are a few mandatory text fields you need to enter and a few combobox fields that allow you to select the environment, provider, and region.  Depending on your choices, the dialog changes to allow for specifying a mandatory subdomain field.  As long as the subdomain is unique to the landscape, clicking the "Create" button with result in a successfully created new subaccount.

Easy right?  Now how would you go about automating that set of actions in a browser???

My first inclination is to bring out the SAP toolbox and see what I can wield to accomplish the task.

Intelligent Robotic Process Automation(iRPA) seems like it might fit the bill nicely.

iRPA does its work by controlling Windows based applications(including browsers) by understanding those applications structure and using windows system provided mechanisms to replicate user actions.  Once a set of tasks is defined, it’s uploaded to a SAP Cloud Platform side component to manage and schedule the jobs(tasks).

In addition, it can work in a user-centric way that guides a windows user to automate portions of their work and assist with hints and desktop integration with AI agents.

While I think iRPA can be used to accomplish my needs, it seems like a lot to have to set up a whole Windows desktop environment and to keep it available 24/7 in order to do something as simple as creating a subaccount.  Also, as of the time of this writing there is no API for triggering a iRPA job programmatically but that I’m told that this is a feature of an upcoming release.  Be sure to check with the iRPA roadmap to see if this has come to pass.  Stay tuned as I may revisit this with a future blog post.

But wait, since we’re talking about a process that happens in a browser and don’t most modern web app use a framework that relies on some sort of RESTful interface to the backend anyway?  Why can’t we just inspect the POST and replicate it with our application?