IBM Cloud Docs
Deleting your DevOps Insights data

Deleting your DevOps Insights data

IBM Cloud® DevOps Insights hosts your data in a highly available and secure environment. Client and system credentials are stored on encrypted disks. Access to data is limited to only those users that require the data to support and maintain DevOps Insights. Data that is stored in DevOps Insights is indexed by a toolchain ID. When you delete a toolchain, all of the data that is related to repos that was collected as part of the toolchain is deleted.

You can delete data in the following ways:

  • Delete build, test, and deploy records
  • Delete DevOps Insights data for a repo by disabling
  • Delete integration between Toolchain and DevOps Insights
  • Delete a repo from your toolchain

For more information about toolchains, see Creating a toolchain from an app.

IBM doesn't manage data in DevOps Insights. If you stop using DevOps Insights, you must delete your own data. To delete your data, delete the DevOps Insights tool integration from your toolchain. If the DevOps Insights tool integration is not added again to the toolchain within seven days, the data is deleted.

Deleting DevOps Insights data sets

With the Manage data dashboard, you can delete DevOps Insights data for a toolchain, an environment, an application, or a branch. All DevOps Insights data for builds, test results, and deployment records are deleted. This data includes predefined and custom data, but not repo data.

Data can’t be recovered after it is deleted.

To see your manage data dashboard, complete the following steps:

  1. From the IBM Cloud console, click the menu icon hamburger icon and select DevOps.
  2. On the Toolchains page, select your toolchain.
  3. From your toolchain's Overview page, on the IBM Cloud tools card, click DevOps Insights.
  4. Select Manage Data.
  5. Select Quality Data.

Deleting toolchain data

Toolchain data is all of the data that is associated with that toolchain. Deleting toolchain data doesn't delete the toolchain, or the tools that are associated with it. It deletes the data that is used by all of the tools that are attached to that toolchain.

  1. To delete toolchain data, go to Manage Data > Quality Data.
  2. Select Toolchain data.
  3. Click Delete.

Deleting environment data

Environment data refers to data that is associated with a specific location. For example, dallas-dev, dallas-prod, frankfurt-prod, or frankfurt-staging. To delete the environment data, complete the following steps:

  1. Go to Manage Data > Quality Data.
  2. Select Environment data.
  3. Select the environment that has the data that you want to delete
  4. Click Delete.

Deleting application data

Application data is all of the data that is associated with a certain app that is attached to a toolchain. To delete the environment data sets, complete the following steps:

  1. Go to Manage Data > Quality Data.
  2. Select Application data.
  3. Select the app that has the data you want to delete, and click Delete.

Deleting branch data for an application

Branch data for an application is the data that is associated with a specific repo of an application. For example, the master branch or staging repo.

  1. To delete the environment data, go to Manage Data > Quality Data.
  2. Select Branch data for an application.
  3. Select the app and the branch that has the data you want to delete.
  4. Click Delete.

Deleting a DevOps Insights tool integration

To delete the DevOps Insights tool integration, you must delete DevOps Insights from your toolchain. To delete DevOps Insights from your toolchain, complete the following steps to delete the tool integration by using the console, with the API, or with Terraform.

Deleting a DevOps Insights tool integration by using the console

  1. Click the menu icon hamburger icon, and select DevOps.
  2. On the Toolchains page, select your toolchain.
  3. From your toolchain's Overview page, on the IBM Cloud tools card, click the Overflow icon ellipsis icon on your DevOps Insights instance. Then, select Delete.

Deleting a DevOps Insights tool integration with the API

  1. Obtain an IAM bearer token. Alternatively, if you are using an SDK, obtain an IAM API key and set the client options by using environment variables.

    export CD_TOOLCHAIN_AUTH_TYPE=iam && \
    export CD_TOOLCHAIN_APIKEY={iam_api_key} && \
    export CD_TOOLCHAIN_URL={base_url}
    
  2. Determine the region and ID of the toolchain.

  3. Determine the ID of the DevOps Insights tool integration.

    curl -X GET \
      {base_url}/toolchains/{toolchain_id}/tools \
      -H "Authorization: Bearer {token}" \
      -H "Accept: application/json"
    
    const CdToolchainV2 = require('@ibm-cloud/continuous-delivery/cd-toolchain/v2');
    ...
    const toolchainService = CdToolchainV2.newInstance(); 
    const tools = await toolchainService.listTools({
       toolchainId: {toolchain_id},
    });
    
    import (
        "github.com/IBM/continuous-delivery-go-sdk/cdtoolchainv2"
    )
    ...
    toolchainClientOptions := &cdtoolchainv2.CdToolchainV2Options{}
     toolchainClient, err := cdtoolchainv2.NewCdToolchainV2UsingExternalConfig(toolchainClientOptions)
     listToolsOptions := toolchainClient.NewListToolsOptions({toolchain_id})
     tools, response, err := toolchainClient.ListTools(listToolsOptions)
    
    from ibm_continuous_delivery.cd_toolchain_v2 import CdToolchainV2
    ...
    toolchain_service = CdToolchainV2.new_instance()
    tools = toolchain_service.list_tools(
       toolchain_id = {toolchain_id}
    )
    
    import com.ibm.cloud.continuous_delivery.cd_toolchain.v2.CdToolchain;
    import com.ibm.cloud.continuous_delivery.cd_toolchain.v2.model.*;
    ...
    CdToolchain toolchainService = CdToolchain.newInstance();
    ListToolsOptions listToolsOptions = new ListToolsOptions.Builder()
       .toolchainId({toolchain_id})
       .build();
    Response<ToolchainToolCollection> response = toolchainService.listTools(listToolsOptions).execute();
    ToolchainToolCollection tools = response.getResult();
    
  4. Delete the DevOps Insights tool integration from the toolchain.

    curl -X DELETE \
      {base_url}/toolchains/{toolchain_id}/tools/{tool_integration_id} \
      -H 'Authorization: Bearer {token}'
    
    const response = await toolchainService.deleteTool({
       toolchainId: {toolchain_id},
       toolId: {tool_integration_id}
    });
    
    deleteToolOptions := toolchainClient.NewDeleteToolOptions({toolchain_id}, {tool_integration_id})
    response, err := toolchainClient.DeleteTool(deleteToolOptions)
    
    response = toolchainService.delete_tool(
       toolchain_id = {toolchain_id},
       tool_id = {tool_integration_id}
    )
    
    DeleteToolOptions deleteToolOptions = new DeleteToolOptions.Builder()
       .toolchainId({toolchain_id})
       .toolId({tool_integration_id})
       .build();
    Response<Void> response = toolchainService.deleteTool(deleteToolOptions).execute();
    

The following table lists and describes each of the variables that are used in the previous steps.

Table 1. Variables for deleting the DevOps Insights tool integration with the API
Variable Description
{base_url} The Toolchain API endpoint URL, for example https://api.us-south.devops.cloud.ibm.com/toolchain/v2. For more information about this endpoint URL, including a list of values, see Endpoint URL.
{iam_api_key} Your IAM API key.
{tool_integration_id} The ID of the tool integration.
{toolchain_id} The ID of the toolchain in which to delete the tool integration.
{token} A valid IAM bearer token.

For more information about the DevOps Insights tool integration, see Adding DevOps Insights.

Deleting a DevOps Insights tool integration with Terraform

  1. Locate the Terraform file (for example, main.tf) that contains the resource block for the existing DevOps Insights tool integration.

    The resource blocks in the following example describe an existing toolchain and DevOps Insights tool integration.

    data "ibm_resource_group" "group" {
      name = "default"
    }
    
    resource "ibm_cd_toolchain" "cd_toolchain" {
      name              = "my toolchain"
      resource_group_id = data.ibm_resource_group.group.id
    }
    
    resource "ibm_cd_toolchain_tool_devopsinsights" "cd_toolchain_tool_insights" {
      toolchain_id = ibm_cd_toolchain.cd_toolchain.id
    }
    
  2. Remove the resource "ibm_cd_toolchain_tool_devopsinsights" block from your Terraform file.

  3. Initialize the Terraform CLI.

    terraform init
    
  4. Create a Terraform execution plan. This plan summarizes all of the actions that must run to delete the DevOps Insights tool integration.

    terraform plan
    
  5. Apply the Terraform execution plan. Terraform takes all of the required actions to delete the DevOps Insights tool integration.

    terraform apply
    

For more information about using Terraform with Continuous Delivery, see Setting up Terraform for Continuous Delivery.

Deleting a repo

When you delete a repo, all of the data that is related to that repo is also deleted.

  1. Click the menu icon hamburger icon, and select DevOps.
  2. On the Toolchains page, select your toolchain.
  3. From your toolchain's Overview page, on the Repositories card, click the Overflow icon ellipsis icon on the repo that you want to delete. Then, select Delete.