YaaS in a Nutshell
The Basics of YaaS
Simply put, YaaS is a marketplace for services. As a developer, you can create and sell a service, and as a business user, you can consume a service. Additionally, you can create what we call a Builder module using the Builder CLI, and use the Builder to manage these services. On the YaaS Market, you can sell or subscribe to a package, which can contain both services and Builder modules. Developers use the Dev Portal to learn how to build and document their service or Builder module. So in reality, YaaS encompasses all of these things.
YaaS is all about packages
YaaS centers around packages because they are the main commodity. You can use existing packages by subscribing to them in the YaaS Market, or you can create your own packages using the Builder. A package is a bundle that contains at least one service or Builder module, as described below:
The services in YaaS are microservices. They are small, isolated applications that are responsible for a single piece of functionality. They are exposed over a RESTful API. For detailed information about the microservice architecture in YaaS, see the Architecture documentation.
The Builder and Builder modules
The difference between the Builder and Builder modules is simple. The Builder is the main tool you use to build, manage, and publish packages if you're a developer, or manage a project as a business user. The URL for the Builder is http://builder.yaas.io. Builder modules, on the other hand, are created with the Builder CLI and registered in the Builder. They provide a user interface to easily manage your service. For more information and to learn more Builder terminology, see the Builder documentation.
An illustration of a package is shown below:
The YaaS Market
The YaaS Market is where you share your package that others can subscribe to, or subscribe to a package created by others. The URL for the YaaS Market is http://market.yaas.io. For example, an existing package that is offered by SAP Hybris in the YaaS Market is the Site Management package, which includes services for managing an e-commerce site. You can subscribe to this package in the YaaS Market, and then utilize the services in your projects that you manage in the Builder. The Site Management package includes five services to help you set up shipping methods, manage site settings, create and manage tax codes, calculate taxes for orders, and capture customer payments using Stripe. If you navigate to the YaaS Market, and select Site Management, you get more detailed information as shown in the screenshot below:
As another example, the Product Content package provides services and Builder modules to support back-office management tasks, display of product data, and search within the product data.
The Dev Portal
You have already found your way to the Dev Portal because you are reading this overview document. But it is important to note that all of the API documentation is kept on the Dev Portal, and is located at http://devportal.yaas.io/services. If you are on a YaaS Market package listing page, and click on each included service, you are redirected to the API documentation for that service so that you can read in-depth about each service included in the package. For instance, in the example screenshot above, if you click on the Shipping service, you are redirected to the Shipping API documentation. The API Documentation includes the API Console, API Reference, a link to the RAML file, and much more detailed information and tutorials.
Also kept on the Dev Portal are important guidelines and resources such as SDKs.
Key Concepts in YaaS
To drill down a little bit further into YaaS, it is important to understand the key concepts below:
The permission settings in YaaS are called, scopes. A scope is a permission setting that specifies access to resources and methods in a service. It is used in combination with authorization. APIs are secured using the OAuth 2.0 protocol, which provides account authentication and authorization with the use of a bearer access token. In order to use the APIs, you need a client ID, which can be found in your project in the Builder. After successful authentication, the service verifies project members and grants the required scopes.
Single-tenancy and Multi-tenancy
When you create a Project in the Builder, you are this project's Owner. You can assign user roles, invite other developers to your project, subscribe to packages or Builder modules, and add clients. Use the client's Client ID and Client Secret to obtain an access token from the OAuth2 service, which allows you to access YaaS APIs within the scope of the client's parent project. This is Single-tenancy in YaaS.
Once you are familiar with the concepts and principles of the YaaS API environment, you can create services and Builder modules and wrap them into packages. Use them as private packages, or monetize your ideas on the YaaS Market.
Multi-tenancy is another key concept in YaaS. In the software industry, it is usually defined as a main principle in architecture where a single instance of the software runs on a server, serving multiple client-organizations, or tenants. On the YaaS platform, which brings developers and business together, the client-organization concept is redefined as a project.
To work with services created by a different tenant, subscribe to a package that includes that specific service within your project. With each subscription, the subscriber acknowledges that a service can obtain access tokens to interact within YaaS in the name of the subscribing tenant. This is multi-tenancy in YaaS.
Example 1Mary, a developer in the assegai project, creates a package that contains the superpoke service. Arun, a developer from a different organization creates a project named, thewicked that subscribes to the package that contains the superpoke service. Afterwards, the superpoke service requests an access token with the hybris.tenant=thewicked scope, and receives it. Without this package subscription in place, the authorization service returns an error code of
400. If you do not pass any value to the hybris.tenant scope in the requests for access tokens, it is set by default to the parent project of the client. In this example, the assegai project.
Example 2A package contains a client named, confrep that requires the hybris.configuration_manage and hybris.repository_manage scopes. After the project named, myshop subscribes to the package containing the confrep client, it requests an access token with the hybris.tenant=myshop, hybris.configuration_manage, and hybris.repository_manage scopes, and receives it. This token cannot be issued without the myshop project or tenant subscription.
For more information about scopes, see the Scopes documentation.
In YaaS, an event is created frequently, such as when a customer redeems a coupon, or when you create a tenant. The message channels used to communicate specific events have topic owners, such as hybris.customer. Each topic owner can have multiple event types, such as customer-login. Therefore, the specific event name is a combination of the topic owner and the event type. For instance, when a customer attempts a login, the event created is named hybris.customer.customer-login. The events created be each service are listed in the API Documentation by topic owner, such as Customer events. All of the YaaS events are published by the PubSub service so that other services can consume them.
In the Builder, you register clients for APIs. API Management is the service used in the following areas in YaaS:
- Create, update, and delete clients and services
- Create, update, and delete credentials of clients
- Update and delete credentials of services (basic authentication)
- Retrieve service scopes defined for a given project
For more information, see the API Management documentation.
When you’re ready to publish, you can package your services and sell them on the YaaS Market. Only people with a subscription to your package can access them, thanks to the OAuth2 authorization flows. These flows are also what you use to define rate plans and metrics for billing, and then you can start to make money.
For more information, see the Authorization Flows in the Builder documentation.
More YaaS Tools
YaaS has some very useful toolkits available to use, and even a storefront template as described below:
The Service Software Development Kit (SDK) provides helper modules so that you can work around any restrictions involved in running a service in the SAP Hybris cloud without having to make many modifications to the application itself. These helper modules are organized into libraries and plug-ins. There is currently an implementation for Java. However, it is not mandatory to use this SDK if you prefer to have more freedom in your design.
If you want to create your own user interfaces to manage your services in the Builder, use the Builder SDK CLI. The Builder SDK is a command-line interface that runs the Builder in developer mode. You can test your Builder module while developing it, and preview how your Builder module appears to others who subscribe to the package containing your Builder module.
The Partial storefronttemplate_YaaSStorefront doesn't exist is a ready-to-use template. It can be set up as a fully transactional storefront within minutes, or you can use the template as a starting point to customize your own features and functionality. Its architecture makes the YaaS Storefront easy to extend with the creation and implementation of new or existing services.
How to Get Started
What can I do with my YaaS account?
Each user has their own account in YaaS, which is used to log in to the Builder. Each account can be used in different organizations, teams, and projects. Each account can have different roles, so one account is used in multiple contexts:
- Contractors can work on different projects.
- Multiple projects are managed without having to maintain multiple accounts.
- People can upgrade their role, such as developers growing into managing their own startup organization.
How do I start developing?
If you're ready to dive in and try out YaaS, check out the Getting Started Guides. These guides include step-by-step tutorials about how to use YaaS, and start developing your own service or Builder modules.
The diagram below puts all of the pieces of YaaS together in an overview:
As a user, you can be part of an organization with projects, or be a staff member in a project. In projects, you create new packages, or subscribe to existing packages, which contain at last one service or Builder module. The projects use clients to access the services. Use the Service SDK to create services, and use the Builder SDK to create Builder modules, which are displayed in the Builder application. If you create a new package, you can publish it to the YaaS Market so others can subscribe to it.
If you find any information that is unclear or incorrect, please let us know so that we can improve the Dev Portal content.
Use our private help channel. Receive updates over email and contact our specialists directly.
If you need more information about this topic, visit hybris Experts to post your own question and interact with our community and experts.