Cloud Services

Service Provider

Service provider APIs
Published On May 16, 2024 - 12:19 PM

Service provider APIs

Understand the APIs to create, update, or delete a customer tenant.
Service Provider is currently a
Tech Preview
to provide you with access to new features so that Kyndryl Modern Operations Applications hears your feedback and works on delivering features that meet your needs.
APIs allow you to configure certain actions in the Service Provider Administration portal, while a user interface is created. As a service provider administrator, you can perform the following actions via APIs:
To access the Developer Console, follow these steps:
  1. Click the
    user profile icon
    in the upper-right side of the Kyndryl Modern Operations Applications portal.
  2. Select
    Developer Console
    .

Managing customer tenants

As a service provider administrator, you have the ability to create, update, return, and delete customer tenants using APIs.
To select the proper application and service in the Developer Console, note the following:
  • From the Application dropdown menu, select
    Platform
    .
  • From the Service dropdown menu, select
    IAM
    .
  • Scroll to the
    Tenants
    section.

Creating a customer tenant

There are several steps required for the creation of a tenant. These steps depend whether or not the new tenant is a basic setup with no applications deployed, or if it is a full setup including the required applications that you need to enable for your customer tenant.
This API creates a tenant, and it should only be used from the service provider tenant.
  • Method:
    POST
  • API:
    /tenants
  • Parameters:
Name
Required
Description
Type
dry_run
No
The ID of the tenant to be updated
Boolean
initial_user
Yes
Email of the user to be the tenant admin  (receives notification to activate tenant)
String
tenant
Yes
The tenant structure
Object
validate_fields
No
User interface validation purposes
Array of string
To create a basic setup with no applications, use the following payload in application/json format, as an example:
You can run the
PUT API
later to update and add apps to this basic tenant.
{ "tenant": { "name": "mytenant", "url": "mytenant.multicloud-ibm.com", "global_idp": "KYNW3", "type": "client", "service_instances": [] }, "initial_user": "[email protected]"}
To create a full tenant with the required applications, there are two steps that you need to complete.
Step 1:
Query the catalog API.
Scroll to the Brokers API section, and run the following API:
  • Method:
    GET
  • API:
    /catalogs
  • Try it out
From the response body copy the broker information needed to include in the payload for the following step.
Kyndryl's application catalog is based on the Open Service Broker (OSB) API specification, and it shows the inventory of applications that are available to deploy in your tenant and the descriptions of the parameters needed to run Step 2. Also, some applications have dependencies that need to be considere
Step 2:
Build the service instances payload based on the parameters fetched in Step 1.
Imagine that you want to create a new tenant with the DevOps application enabled. Use the following payload in application/json format as an example:
{ ... ... "service_instances": [ { "broker": "mcmp:devops-intelligence:service", "service_id": "0285bec9-9993-409e-9a39-3127c3c803f3", "plan_id": "ce6e1d83-61f3-40aa-a2d5-45e6678e78d2", "parameters": { "non-connection-param1-key": "value1", ... ... } } ]}

Updating a customer tenant

This API updates a tenant that has been previously created; you can add applications, delete applications ,or edit other parameters.
  • Method:
    PUT
  • API:
    /tenants/{tenantid}
  • Parameters:
Name
Required
Description
Type
tenantid
Yes
The ID of the tenant to be updated
String
  • Body:
    Provide the payload for the tenant to be updated in application/json format as shown in the following example:
{ ... ... "service_instances": [ { "broker": "mcmp:devops-intelligence:service", "service_id": "0285bec9-9993-409e-9a39-3127c3c803f3", "plan_id": "ce6e1d83-61f3-40aa-a2d5-45e6678e78d2", "status": "my status" "parameters": { "non-connection-param1-key": "value1", ... ... } } ]{

Deleting a customer tenant

This API deletes a tenant, and it should only be used from the service provider tenant.
  • Method:
    DELETE
  • API:
    /tenants/{tenantid}
  • Parameters:
Name
Required
Description
Type
tenantid
Yes
The ID of the tenant to be deleted
String

Getting a customer tenant

This API returns a tenant, and it should only be used from the service provider tenant.
  • Method:
    GET
  • API:
    /tenants/
  • Parameters:
Name
Required
Description
Type
state
No
The status of the tenant
String
brokerState
No
The status of the broker
String
broker
No
The ID of the broker
String

Getting all customer tenants

This API returns all customer tenants managed by the service provider (SP) tenant, and it should only be used from the SP tenant.
  • Method:
    GET
  • API:
    /tenants/{tenantid}
  • Parameters:
Name
Required
Description
Type
tenantid
Yes
The ID of the tenant to be returned
String

Configuring email for user invitations and app notifications

As a service provider administrator, you have the capability to configure your own email to send out invitations to new users of the platform. When the email gateway is configured, then all of your customers tenants use that same configuration for the invitation emails.
To select the proper application and service in the Developer Console, note the following:
  • From the Application dropdown menu, select
    Platform
    .
  • From the Service dropdown menu, select
    IAM
    .
  • Scroll to the
    SMTPConfig
    section.

Setting up email gateway

This API configures an email address to work as a gateway for platform invitations.
  • Method:
    PUT
  • API:
    /iam/v4/smtp
  • Parameters:
    None
  • Body:
    Provide the payload for the notifications to be configured in application/json format as shown in the following example:
    { "host" :"smtp.sendgrid.net", "port" : "465", "user" : "username/apikey", "password":"password/apikey-value", >>>> This will go into vault "sender_email":"[email protected]" >>>> This is optional}
You can set only the email server credentials, which includes server, port, user, and password; or only the sender email input, if required. However, you can set all the information at the same time.
  • Reponse:
    200 { "message" : "Email gateway settings created successfully.", }

Removing email gateway

This API removes the email address that works as a gateway for platform invitations.
  • Method:
    DELETE
  • API:
    /notification/v4/smtp
  • Parameters:
    None
  • Body:
    None
  • Reponse:
    200 { "message" : "Delete is successful" , }

Getting email gateway

This API returns the email address that works as a gateway for platform invitations.
  • Method:
    GET
  • API:
    /iam/v4/smtp
  • Parameters:
    None
  • Body:
    None
  • Reponse:
    200 { "host" :"smtp.sendgrid.net", "port" : "465", "user" : "*********", "password":"**********", "sender_email": "[email protected]", "created_at": "2022-08-24T06:18:42.853Z", "created_by": "6304d580de1362586c013763", "updated_at": "2022-08-24T06:18:42.846Z", "updated_by": "6304d580de1362586c013763" }404 "message" : "Email Gateway settings does not exist",500 "message" : "Internal error"
Do you have two minutes for a quick survey?
Take Survey