Cloud Services

Cost & Asset Management

Supported APIs
Published On Aug 26, 2024 - 1:23 PM

Supported APIs

Understand APIs supported by Cost & Asset Management to integrate other services, extending it functional benefit to your organization.
Cost & Assets Management Platform (CAM)
contains sets of APIs that you can use to work with Generic Provider Data (GPD) files, providers, Dynamic Resource Groups, reports and budgets.
CAM supports the following APIs:
Feature flags
To access the APIs, click your
User
icon in the top-left of the Kyndryl Modern Operations Applications page and select
Developer Console
. For the application select
ecam

GPD upload

Users authorized to set up providers and upload files can manually upload GPD files so that CAM can analyze any provider's files. The purpose of the GPD upload APIs is to enable these authorized users to upload the GPD files.
  • GET /api/ecam/v1/gpd - To return a list of uploaded GPD files
  • POST /api/ecam/v1/gpd - To start the GPD file upload
  • POST /api/ecam/v1/gpd/enrich - To start enrichment for the uploaded GPD file
  • POST /api/ecam/v1/gpd/retry - To retry validation for an uploaded GPD file
  • POST /api/ecam/v1/gpd/cleanup - To clean up the uploaded GPD file

GET

/api/ecam/v1/gpd
Returns a list of uploaded GPD files.
Query parameters
Name
Required
Description
Type
Sample values
providername
Yes
Provider Name for which GPD is being uploaded
String

Response

200: List of uploaded GPD files
500: Internal Error

POST

/api/ecam/v1/gpd
Starts the GPD file upload.
Query parameters
Name
Required
Description
Type
Sample values
providername
Yes
Provider name for which GPD is being uploaded
string
fileName
No
string

Response

202: GPD Upload submitted successfully. Returns GPD upload reference Id.
500: Internal Error

POST

/api/ecam/v1/gpd/enrich
Starts enrichment for the uploaded GPD file.

Query parameters

No parameters
Example value
{ "GPDUploadRefId": [ "123" ], "provider": [ "aws" ], "retry": "true" }

Response

200: Enrichment started successfully
400: Uploaded file is not ready to be enriched. Please wait
500: Failed to start enrichment

POST

/api/ecam/v1/gpd/retry
Retries the validation for an uploaded GPD file.

Query parameters

No parameters
Example value
/api/ecam/v1/gpd/retry

Response

200: Accepted
400: Invalid job ID
500: Failed to retry job

POST

/api/ecam/v1/gpd/cleanup
Cleans up the uploaded GPD file.
Query parameters
Name
Required
Description
Type
Sample values
providername
Yes
Provider name for which GPD is being cleaned
string
requestBody
Yes
Example value
{ "GPDUploadRefId": "string" }

Response

200: Clean up started successfully
500: Failed to cleanup GPD data

Uploading specific raw data to create GPD files

Users can customize GPD data that is required to be shown by adding API information:
Check the connection to the tenant

GET

/api/ecam/extensions/test

Query Parameters

No parameters

Response

200 Lists the profile id of the user
500 Internal server error
Create a signed URL to the AWS S3 to upload the extension file

POST

/api/ecam/extensions/S3ExtensionRepo
Query Parameters
  • Filename: name_of_the_extensionFile_to_be_uploaded
  • ProviderCode: providerName

Response

200 Returns the preSignedUrl to upload the extension file to AWS S3
500 Internal server error

Upload the compressed extension file.

This is the same API received in the response of the POST API above.

PUT

preSignedURL

QueryParams

Auto-populated
Request payload: Select type as Binary and upload the required extension file
Response
  • 200 empty response
  • 500 Internal server error
Validate the uploaded extension file

POST

/api/ecam/extensions/S3ExtensionRepo/validate

QueryParams

Filename = name_of_the_extensionFile_to_be_uploaded ProviderCode = providerName
Response
  • 200 Returns the validation result
  • 500 Internal server error
Create a signed URL to the AWS S3 to upload the compressed raw data file

POST

/api/ecam/extensions/S3InputHandler
Query parameters
  • Filename: name_of_the_rawData_to_be_uploaded>
  • ProviderCode: providerName
Response
  • 200: Returns the preSignedUrl to upload the raw data file to AWS S3
  • 500: Internal server error

Upload the compressed raw data file.

This is the same API received in the response of the POST API above.

PUT

preSignedURL

QueryParams

Auto-populated Request payload – Select type as Binary and upload the required raw data zip file
Response
  • 200 Empty response
  • 500 Internal server error
To expand the contents of the compressed raw data file

POST

/api/ecam/extensions/notify/S3InputHandler
Query Params
  • Filename: name_of_the_rawData_to_be_uploaded
  • ProviderCode: providerName
Response
  • 200: {“results”:”ok”}
  • 500: Internal server error
To transform the raw data into GPD format

POST

/api/ecam/extensions/flow

QueryParams

No query parameters
Request payload – { “vars”: {“providerCode”:” ”}}
Response
  • 200 Returns the status and message along with the transformation job id
  • 500 Internal server error
To list all the files (uploaded and transformed) on the S3 repository

GET

/api/ecam/extensions/data/list

Query Params

No query parameters
To delete any file on the S3 repository

POST

/api/ecam/extensions/data/delete

Query Parameters

List of files to be deleted in the below format (The key and size can be obtained from the List API mentioned above [ {“key” : “ ”, “Size”:” ”} ]
Response
  • 200 Returns the status along with count of files deleted
  • 500 Internal server error
To download/view any file on the S3 repository

GET

/api/ecam/extensions/data/download

Query Parameters

key = file_path_on_s3
Response
  • 200 Returns the file contents
  • 500 Internal server error

Currency

The purpose of the currency APIs is to allow you to view the corporate currency set in Core. You must use Core APIs to set the corporate currency.
  • GET /api/ecam/v1/currency/instanceCurrencies - To return the instance currency from Core
  • GET /api/ecam/v1/currency/defaultCurrency - To return the default currency from Core

GET

/api/ecam/v1/currency/instanceCurrencies
Returns the instance currency from CORE.

Query parameters

No parameters

Response

200: Get instance currency from core
500: Internal error

GET

/api/ecam/v1/currency/defaultCurrency
Returns the default currency from CORE.

Query parameters

No parameters

Response

200: Get Default currency from core
500: Internal error

Provider metadata

The purpose of the provider metadata APIs is to enable the user to work with the service category or location mapping details for providers.
  • GET /api/ecam/v1/providermetadata/service_categories - To return the service category mapping
  • POST /api/ecam/v1/providermetadata/service_categories - To add a new service category mapping
  • PATCH /api/ecam/v1/providermetadata/service_categories - To update the service category mapping
  • GET /api/ecam/v1/providermetadata/locations - To return the location mapping
  • POST /api/ecam/v1/providermetadata/locations - To add a new location mapping
  • PATCH /api/ecam/v1/providermetadata/locations - To update the location mapping

GET

/api/ecam/v1/providermetadata/service_categories
Returns the service category mapping.
Query parameters
Name
Required
Description
Type
Sample values
providerName
Yes
Provider Name of the service category mapping entry
string
assetType
No
Asset Type of the service category mapping entry. If empty, returns a list of service categories for given providerName
string

Response

200: Success
401: Record not found
500: Internal error

POST

/api/ecam/v1/providermetadata/service_categories
Adds a new service category mapping.
Query parameters
Name
Required
Description
Type
Sample values
providerName
Yes
Provider Name of the service category mapping entry
string
Example value
[ { "providerName": "string", "serviceCategory": "string", "assetType": "string" } ]

Response

200: Success
500: Error

PATCH

/api/ecam/v1/providermetadata/service_categories
Updates the service category mapping.
Query parameters
Name
Required
Description
Type
Sample values
providerName
Yes
Provider Name of the service category mapping entry
string
Example value
{ "serviceCategory": "string" }

Response

200: Success
401: Record not found
500: Internal error

GET

/api/ecam/v1/providermetadata/locations
Returns the location mapping.
Query parameters
Name
Required
Description
Type
Sample values
providerName
No
Provider Name of the service category mapping entry
string
assetType
No
Asset Type of the service category mapping entry. If empty, returns a list of service categories for given providerName
string

Response

200: Success
401: Record not found
500: Internal error

POST

/api/ecam/v1/providermetadata/locations
Adds a new location mapping.
Query parameters
Name
Required
Description
Type
Sample values
providerName
No
Provider Name of the location mapping entry
string
Example value
[ { "providerName": "string", "dataCenter": "string", "providerRegionCode": "string", "url": "string", "region": "string", "subregion": "string", "location": "string", "state": "string", "country": "string" } ]

Response

200: Success
500: Internal error

PATCH

/api/ecam/v1/providermetadata/locations
Updates the location mapping.
Query parameters
Name
Required
Description
Type
Sample values
providerName
Yes
Provider Name of the location mapping entry
string
providerRegionCode
No
Provider Region Code of the location mapping entry. If empty, returns a list of locations for given providerName
string
Example value
{ "dataCenter": "string", "url": "string", "region": "string", "subregion": "string", "location": "string", "state": "string", "country": "string" }

Response

200: Success
401: Record not found
500: Internal error

Migration

The purpose of the migration APIs is to enable the user to work with accounts.
  • GET /api/ecam/v1/migrationController/accounts/status - To return a list of account records
  • POST /api/ecam/v1/migrationController/accounts/ - To initiate ingestion on the accounts

GET

/api/ecam/v1/migrationController/accounts/status
Returns a list of account records.
Query parameters
Name
Required
Description
Type
Sample values
status
No
string

Response

200: List of records both succeeded and failed
204: No data found
500: Error

POST

/api/ecam/v1/migrationController/accounts/
To initiate ingestion on the accounts.

Query parameters

No parameters
Example value
{ "apiToken": "xsxxxx", "userName": "xxxx", "bcamURL": "https://xx/xx" }

Response

200: Success
500: Error

Dynamic Resource Groups

With Dynamic Resource Groups, you can find cost and asset resources and tag them for inclusion in a group. The purpose of the Dynamic Resource Group APIs is to enable the user to work with Dynamic Resource Groups.
  • GET /api/ecam/v1/dynamicResourceGroups - To return a list of all Dynamic Resource Groups
  • POST /api/ecam/v1/dynamicResourceGroups - To create Dynamic Resource Groups
  • PUT /api/ecam/v1/dynamicResourceGroups - To update a Dynamic Resource Group
  • PATCH /api/ecam/v1/dynamicResourceGroups - To update a Dynamic Resource Group
  • DELETE /api/ecam/v1/dynamicResourceGroups/{id} - To delete a Dynamic Resource Group

GET

/api/ecam/v1/dynamicResourceGroups
Returns a list of all Dynamic Resource Groups.

Query parameters

No parameters

Response

200: Operation successful
204: No authorized Dynamic Resource Groups found
401: Error

POST

/api/ecam/v1/dynamicResourceGroups
Creates Dynamic Resource Groups.

Query parameters

No parameters
Example value
{ "_id": "VTag", "type": "visibility", "version": "1", "expr": "((providerName==\"aws\")&&(billingAccountName==\"1234\")&&(assetAccountId==\"1234\")&&(category==\"Compute\"))", "context": { "department": [ "HR" ] } }

Response

200: Success
400: Error

PUT

/api/ecam/v1/dynamicResourceGroups
Updates a Dynamic Resource Group.

Query parameters

No parameters
Example value
{ "_id": "VTag", "type": "visibility", "version": 1, "expr": "((providerName==\"aws\")&&(billingAccountName==\"1234\")&&(assetAccountId==\"1234\")&&(category==\"Compute\"))", "context": { "department": [ "HR" ] } }

Response

200: Success
400: Error

PATCH

/api/ecam/v1/dynamicResourceGroups
Updates a Dynamic Resource Group.

Query parameters

No parameters
Example value
{ "_id": "VTag", "type": "visibility", "version": 1, "expr": "((providerName==\"aws\")&&(billingAccountName==\"1234\")&&(assetAccountId==\"1234\")&&(category==\"Compute\"))", "context": { "department": [ "HR" ] } }

Response

200: Success
400: Error

DELETE

/api/ecam/v1/dynamicResourceGroups/{id}
Deletes a Dynamic Resource Group.
Query parameters
Name
Required
Description
Type
Sample values
id
Yes
string

Response

200: Operation successful
404: Not found

Report models

The purpose of the report model APIs is to enable users to persist data that has been filtered and sorted from all the data to which a user has access.
  • GET /api/ecam/v1/reportModels/{reportModelID}/execution - To run a report model
  • GET /api/ecam/v1/reportModels - To return a list of all report models
  • GET /api/ecam/v1/reportModels/{reportModelID} - To return a list of all report model IDs
  • POST /api/ecam/v1/reportModels/{reportModelID} - To create a report model
  • PUT /api/ecam/v1/reportModels/{reportModelID} - To delete and replace a specific report model
  • PATCH /api/ecam/v1/reportModels/{reportModelID} - To delete and replace a specific report model
  • DELETE /api/ecam/v1/reportModels/{reportModelID} - To delete a specific report model

GET

/api/ecam/v1/reportModels/{reportModelID}/execution
Runs a report model.
Query parameters
Name
Required
Description
Type
Sample values
reportModelId
Yes
string
templateParams
Yes
query

Response

200: Successful operation
400: Invalid request errors
500: ECAM server error

GET

/api/ecam/v1/reportModels
Returns a list of all report models.

Query parameters

No parameters

Response

200: Successful operation
500: ECAM server error

GET

/api/ecam/v1/reportModels/{reportModelID}
Returns a list of all report model IDs.
Query parameters
Name
Required
Description
Type
Sample values
reportModelId
Yes
ID for report model
string

Response

200: Successful operation
400: Invalid request errors
500: ECAM server error

POST

/api/ecam/v1/reportModels/{reportModelID}
Creates a report model
Query parameters
Name
Required
Description
Type
Sample values
reportModelId
Yes
ID for report model
string
templateId
Yes
ID for template
string
saveOutput
No
boolean
Example value
{ "append": true, "type": "v1", "vtags": [ "SonyVtag" ], "expr": "(period == 201911) && (providerName == \"aws\") && $tag(\"allTags\",cmapplication == \"sonyapp\")" }

Response

200: Successful operation
400: Invalid request errors
500: ECAM server error

PUT

/api/ecam/v1/reportModels/{reportModelID}
Deletes and replaces a specific report model.
Query parameters
Name
Required
Description
Type
Sample values
reportModelId
Yes
ID of report model
string
Example value
{ "append": true, "type": "v1", "scope": "public", "vtags": [ "SonyVtag" ], "expr": "(period == 201911) && (providerName == \"aws\") && $tag(\"allTags\",cmapplication == \"sonyapp\")" }

Response

200: Successful operation
400: Invalid request errors
500: ECAM server error
### PATCH
/api/ecam/v1/reportModels/{reportModelID}
Deletes and replaces a specific report model.
Query parameters
Name
Required
Description
Type
Sample values
reportModelId
Yes
ID for report model
string
Example value
{ "append": true, "type": "v1", "scope": "public", "vtags": [ "SonyVtag" ], "expr": "(period == 201911) && (providerName == \"aws\") && $tag(\"allTags\",cmapplication == \"sonyapp\")" }

Response

200: Successful operation
400: Invalid request errors
500: ECAM server error

DELETE

/api/ecam/v1/reportModels/{reportModelID}
Deletes a specific report model.
Query parameters
Name
Required
Description
Type
Sample values
reportModelId
Yes
string

Response

200: Successful operation
400: Invalid request Data
500: ECAM server error

Budgets

Budgetary units and budgets are features in Kyndryl Modern Operations Applications allows you to help track financial outlays and maintain financial control of the services that your customers provision. The purpose of the budget API is to enable users to work with budgets and budgetary units.
  • GET /api/ecam/v1/budgetController/budgetaryUnits - To return the budget aggregation amount per period

GET

/api/ecam/v1/budgetController/budgetaryUnits
Returns the budget aggregation amount per period.

Query parameters

No parameters

Response

200: Budget aggregation amount per period
204: No budgets available
500: Internal error

Object Storage

It will create/list provider(s) for Object storage.

POST

/api/ecam/v1/providers/object-storage

Query parameters

No parameters
Example value
{ "providerName": "providername", "providerCode": "providername" }

GET

Will list all providers

GET

/api/ecam/v1/providers/object-storage/:
Will return specific provider

Housekeeping

POST

orc/ecam/v1/housekeeping
Cleans up the temporary collections

POST

/orc/ecam/v1/housekeeping/clean
Cleans up all enriched data

POST

/orc/ecam/v1/housekeeping/cleanupoutdateddata
Cleans up data older than period limit

Ingestion

POST

/api/ecam/v1/enrichmentController/ingestion
Start orchestartor from job service

POST

/api/ecam/v1/enrichmentController/ingestion/retry
Retry failed injestion job

POST

/api/ecam/v1/enrichmentController/jobs/terminate
Terminates the running ingestion job

POST

/api/ecam/v2/enrichmentController/ingestion
consolidate ingestion api
Remediate

POST

/api/ecam/v1/remediate
Remediate given tasks

Data Management

POST
/api/ecam/v1/dataManagement
Submit deletion request

GET

/api/ecam/v1/dataManagement
Get all deletion requests

POST

/api/ecam/v1/dataManagement/{id}
Cancel deletion requests

GET

/api/ecam/v1/dataManagement /accounts
List al billing accounts

GET

/api/ecam/v1/dataManagement/filters
Populate filters

Feature Flags

Last Updated: 2022-09-20
ECAM Wrapper API Feature Flag

POST

/api/ecam/v1/featureflag
Wrapper to POST API of /core/featureflagmanagement/v1/featureflag to create feature flag. Payload -
{ "
configurationkey
": "
COSAMetering
", "
configurationvalue
": "true/false" }

Response

Return the same response as returned by the CORE API.

GET

/api/ecam/v1/featureflag Wrapper to GET API of /core/featureflagmanagement/v1/featureflag to get all the feature flags.

Response

Return the same response as returned by the CORE API.

PUT

/api/ecam/v1/featureflag
Wrapper API to PUT API of /core/featureflagmanagement/v1/featureflag/{configurationKey}
{ "
configurationkey
": "
COSAMetering
", "
configurationvalue
": "true/false" }

Response:

Return the same response as returned by the CORE API.

Common Discovery Feature Flag

  • To set up Common Discovery tenant, go to
    Tenant Manager
    and click
    Edit Tenant
    . Then, select
    Common Discovery
    .
  • Then, click the Feature & Logging Flags for all the providers( AWS, Azure, GCP, IBMCloud, Alicloud and its metrics) under the
    Feature Flag
    sections in tenant manager and then click
    Apply Flags
    . If the flags are not enabled, data will not be ingested.
  • Submit the Update the Tenant Request.
  • Set the
    COMMON_DISCOVERY
    Feature Flag to
    true
    in
    cb-core-configuration-service
    in Swagger.

POST

/core/featureflagmanagement/v1/featureflag
Use the following payload to the feature flag:
{ "flag_key": "COMMON_DISCOVERY", "flag_value": "true" }

GET

(To check available entries)
/core/configuration/v1/configvalues/SUPPORTED_CD_PROVIDERS

PUT

(To update)
/core/configuration/v1/configvalues
Use the following payload for the feature flag:
{ "configurationkey": "SUPPORTED_CD_PROVIDERS", "configurationvalue": [ "alicloud", "aws", "gcp", "azure", "ibmcloud" ] }

CAM Insights Feature Flag

  • To set up the Feature Flag, navigate to the
    Developer Console
    page from the
    Main Menu
    , located at the top right of your Kyndryl Modern Operations Applications
  • A new window displays. Select
    CORE
    application and then, on Service, select
    cb-core-configuration-service

POST

/core/featureflagmanagement/v1/featureflag under Feature Flag Management section to Add the Feature Flag.

Payload

  • Use the following payload to the feature flag:
    { "flag_key": "BCM_3243_InsightsNewLayout", "flag_value": "true" }

CAM Supported Utilization Metrics

  • To set up the Feature Flag, navigate to the
    Developer Console
    page from the
    Main Menu
    , located at the top right of your Kyndryl Modern Operations Applications Page.
  • Select Service "core" and Service "cb-core-configuration-service"

POST

/core/featureflagmanagement/v1/featureflag" to add the Feature Flag with "configurationvalue" as "true"{ "configurationkey": "BCM-5392-Utilization-Configuration", "configurationvalue": "true" }{ "configurationkey": "BCM5392_METRIC_PIPELINE_WIRING", "configurationvalue": "true" }

GET

Consume a GET on the API /core/featureflagmanagement/v1/featureflag and confirm the two keys are added.

Payload

Use the following payload to the feature flag:{ "configurationkey": "BCM4110_SHOW_SUPPORTING_METRICS", "configurationvalue": "true" }

Enable Azure Commitment Based Discount

Ativate the following feature flag to enable the Azure dashboard
Core configuration:
/core/configuration/v1/configvalues { "configurationkey":"COMPLETE_ENRICHMENT_COLLECTOR_PROVIDERS", "configurationvalue":[ "azure" ] }
Core feature flag:
/core/featureflagmanagement/v1/featureflag { "configurationkey":"TRANSFORM_PARQUET", "configurationvalue":"true" } { "configurationkey":" BCM_813715_AzureRI ", "configurationvalue":"true" }
Insights BCM flag:
/insights/v2/housekeeping/configuration { "BCM_813715_AzureRI": "true" }
Do you have two minutes for a quick survey?
Take Survey